CsoundManual - Previous section - Contents - Index - Next

SCOT: A Score Translator

Scot is a language for describing scores in a fashion that parallels traditional music notation. Scot is also the name of a program which translates scores written in this language into standard numeric score format so that the score can be performed by Csound. The result of this translation is placed in a file called score. A score file written in Scot (named file.sc, say) can be sent through the translator by the command

     scot  file.sc 

The resulting numeric score can then be examined for errors, edited, or performed by typing

     csound  file.orc  score 

Alternatively, the command

     csound  file.orc  -S file.sc 

would combine both processes by informing Csound of the initial score format.

Internally, a Scot score has at least three parts: a section to define instrument names, a section to define functions, and one or more actual score sections. It is generally advisable to keep score sections short to facilitate finding errors. The overall layout of a Scot score has three main sections:

     orchestra { .... }
     functions { .... }
     score     { .... } 

The last two sections may be repeated as many times as desired. The functions section is also optional. You are free to break up each of these divisions into as many lines as seem convenient, or to place a carriage return anywhere you are allowed to insert a space, including before and after the curly brackets. Furthermore, you may use as many spaces or tabs as you need to make the score easy to read. Scot imposes no formatting restrictions except that numbers, instrument names, and keywords (for example, orchestra) may not be broken with spaces. You may insert comments (such as measure numbers) anywhere in the score by preceding them with a semicolon. A semicolon causes Scot to ignore the rest of a line.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Orchestra Declaration Section

The orchestra section of a Scot score serves to designate instrument names for use within the score. This is a matter of convenience, since an orchestra knows instruments only by numbers, not names. If you declare three instruments, such as:

     orchestra { flute=1 cello=2 trumpet=3 } 

Csound will neither know nor care what you have named the note lists. However, when you use the name $flute, Scot will know you are referring to instr 1 in the orchestra, $cello will refer to instr 2, and $trumpet will be instr 3. You may meaningfully skip numbers or give several instruments the same number. It is up to you to make sure that your orchestra has the correct instruments and that the association between these names and the instruments is what you intend. There is no limit (or a very high one, at least) as to how many instruments you can declare.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Function Declaration Section

The major purpose of this division is to allow you to declare function tables for waveforms, envelopes, etc. These functions are declared exactly as specified for Csound. In fact, everything you type between the brackets in this section will be passed directly to the resulting numeric score with no modification, so that mistakes will not be caught by the Scot program, but rather by the subsequent performance. You can use this section to write notes for instruments for which traditional pitch-rhythm notation is inappropriate. The most common example would be turning on a reverb instrument. Instruments referenced in this way need not appear in the Scot orchestra declaration. Here is a possible function declaration:

     functions {
     f1 0 256 10 1 0 .5 0 .3
     f2 0 256 7 0 64 1 64 .7 64 0
     i9 0 -1 3           ; this turns on instr 9
     }


CsoundManual - Top of this section - Previous - Contents - Index - Next

Score Section

The Scot statements contained inside the braces of each score statement is translated into a numeric score Section. It is wise to keep score sections small, say seven or eight measures of five voices at a time. This avoids overloading the system, and simplifies error checking.

The beginning of the score section is specified by typing:

     score { 

Everything which follows until the braces are closed is within a single section. Within this section you write measures of notes in traditional pitch and rhythm notation for any of the instrument names listed in your orchestra declaration. These notes may carry additional information such as slurs, ties and parameter fields. Let us now consider the format for notes entered in a Scot score.

The first thing to do is name the instrument you want and the desired meter. For example, to write some 4/4 measures for the cello, type:

     $cello
     !ti "4/4" 

The dollar sign and exclamation point tell Scot that a special declarator follows. The time signature declarator is optional; if present, Scot will check the number of beats in each measure for you.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Pitch and Rhythm

The two basic components of a note statement are the pitch and duration. Pitch is specified using the alphabetic note name, and duration is specified using numeric characters. Duration is indicated at the beginning of the note as a number representing the division of a whole beat. You may always find the number specifying a given duration by thinking of how many times that duration would fit in a 4/4 measure. Also, if the duration is followed by a dot (`.') it is increased by 50%, exactly as in traditional notation. Some sample durations are listed below:

     whole note               1
     half note                2
     double dotted quarter    4..
     dotted quarter note      4.
     quarter note             4
     half note triplet        6
     eighth note              8
     eighth note triplet      12
     sixteenth note           16
     thirty-second note       32

Pitch is indicated next by first (optionally) specifying the register and then the note name, followed by an accidental if desired. Normally, the "octave following" feature is in effect. This feature causes any note named to lie within the interval of an augmented fourth of the previous note, unless a new register is chosen. The first note you write will always be within a fourth of middle c unless you choose a different register.

For example, if the first note of an instrument part is notated g flat, the Scot program assigns the pitch corresponding to the g flat below middle c. On the other hand, if the first note is f sharp, the pitch assigned will be the f sharp above middle c. Changes of register are indicated by a preceding apostrophe for each octave displacement upward or a preceding comma for each octave displacement downward. Commas and apostrophes always displace the pitch by the desired number of octaves starting from that note which is within an augmented fourth of the previous pitch.

If you ever get lost, prefacing the pitch specification with an `=' returns the reference to middle c. It is usually wise to use the equals sign in your first note statement and whenever you feel uncertain as to what the current registration is. Let us now write two measures for the cello part, the first starting in the octave below middle c and the second repeating but starting in the octave above middle c:

     $cello
     !ti "4/4"
     4=g 4e 4d 4c/ 4='g 4e 4d 4c 

As you can see, a slash indicates a new measure and we have chosen to use the dummy middle c to indicate the new register. A more convenient way of notating these two measures would be to type the following:

     $cello
     !ti "4/4"
     4=g e d c/ ''g e d c 

You may observe in this example that the quarter note duration carries to the following notes when the following durations are left unspecified. Also, two apostrophes indicate an upward pitch displacement of two octaves from two g's below middle c, where the pitch would have fallen without any modification. It is important to remember three things, then, when specifying pitches:

1) Note pitches specified by letter name only (with or without accidental) will always fall within an interval of a fourth from the preceding pitch.

2) These pitches can be octave displaced upward or downward by preceding the note letter with the desired number of apostrophes or commas.

3) If you are unsure of the current register, you may begin the pitch component of the note with an equals sign which acts as a dummy middle c.

The pitch may be modified by an accidental after the note name:

     n                   natural
     #                   sharp
     -  (hyphen)         flat
     ##                  double sharp
     -- (double hyphen)  double flat 

Accidentals are carried throughout the measure just as in traditional music notation. However, an accidental specified within a measure will hold for that note in all registers, in contrast with traditional notation. Therefore, make sure to specify n when you no longer want an accidental applied to that pitch-class.

Pitches entered in the Scot score are translated into the appropriate octave point pitch-class value and appear as parameter p5 in the numeric score output. This means you must design your instruments to accept p5 as pitch.

Rests are notated just like notes but using the letter r instead of a pitch name. 4r therefore indicates a quarter rest and 1r a whole rest. Durations carry from rest to rest or to following pitches as mentioned above.

The tempo in beats per minute is specified in each section by choosing a single instrument part and using tempo statements (e.g. t90) at the various points in the score as needed. A quarter note is interpreted as a single beat, and tempi are interpolated between the intervening beats ( see score t statement).

Scot EXAMPLE I:



A Scot encoding of this score might appear as follows:

     ; A BASIC Tune
     orchestra { guitar=1 bass=2 }
     functions  {
     f1 0 512 10 1 .5 .25 .126
     f2 0 256  7 1 120 1 8 0 128 1
     }
     score     {  ;section 1
     $guitar
     !ti "4/4"
     4=c 8d e- f r 4='c/
     8.b- 16a a- g  g- f  4e- c/
     $bass
     2=,,c 'a-/
     g  =,c/
     }
     score     {  ;section 2
     $guitar
     !ti "4/4"
     6='c r c 4..c## 16e- /
     6f r f 4..f## 16b /
     $bass
     4=,,c 'g, c 'g/
     2=a-  g /
     }

Output file score from Scot Example I.

     f1 0 512 10 1 .5 .25 .126
     f2 0 256  7 1 120 1 8 0 128 1
     i1.01 0 1 0 8.00
     i1.01 1 0.5 0 8.02
     i1.01 1.5 0.5 0 8.03
     i1.01 2 0.5 0 8.05
     i1.01 3 1 0 9.00
     i1.01 4 0.75 0 8.10
     i1.01 4.75 0.25 0 8.09
     i1.01 5 0.25 0 8.08
     i1.01 5.25 0.25 0 8.07
     i1.01 5.5 0.25 0 8.06
     i1.01 5.75 0.25 0 8.05
     i1.01 6 1 0 8.03
     i1.01 7 1 0 8.00
     i2.01 0 2 0 6.00
     i2.01 2 2 0 6.08
     i2.01 4 2 0 6.07
     i2.01 6 2 0 7.00
     t0 60
     f0 8
     s
     i1.01 0 0.6667 0 9.00
     i1.01 1.3333 0.6667 0 9.00
     i1.01 2 1.75 0 9.02
     i1.01 3.75 0.25 0 9.03
     i1.01 4 0.6667 0 9.05
     i1.01 5.3333 0.6667 0 9.05
     i1.01 6 1.75 0 9.07
     i1.01 7.75 0.25 0 9.09
     i2.01 0 1 0 6.00
     i2.01 1 1 0 6.07
     i2.01 2 1 0 6.00
     i2.01 3 1 0 6.07
     i2.01 4 2 0 7.08
     i2.01 6 2 0 7.07
     t0 60
     f0 8
     s



CsoundManual - Top of this section - Previous - Contents - Index - Next

Groupettes

Duration numbers can have any integral value; for instance,

     !time "4/4"
     5cdefg/ 

would encode a measure of 5 in the time of 4 quarter notes. However, specification of arbitrary rhythmic groupings in this way is at best awkward. Instead, arbitrary portions of the score section may be enclosed in groupette brackets. The durations of all notes inside groupette brackets will be multiplied by a fraction n/d, where the musical meaning is d in the time of n. Assuming d and n here are integers, groupette brackets may take these several forms:

     {d:n:  ....      :}   d in the time of n
     {d::   ....      :}   n will be the largest power of 2 less than d
     {:     ....      :}   d=3, n=2 (normal triplets) 

It can be seen that the second and third form are abbreviations for the more common kinds of groupettes. (Observe the punctuation of each form carefully.) Groupettes may be nested to a reasonable depth. Also, groupette factors apply only after the written duration is carried from note to note. Thus, the following example is a correct specification for two measures of 6/8 time:

     !time "6/8" 8cde {4:3: fgab :} / crc 4.c / 

The notes inside the groupette are 4 in the space of 3 8th notes, and the written-8th-note duration carries normally into the next measure. This closely parallels the way groupette brackets and note durations interact in standard notation.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Slurs and Ties

Now that you understand part writing in the Scot language, we can start discussing more elaborate features. Immediately following the pitch specification of each note, one may indicate a slur or a tie into the next note (assuming there is one), but not both simultaneously. The slur is typed as a single underscore (`_') and a tie as a double underscore (`__'). Despite the surface similarity, there is a substantial difference in the effect of these modifiers.

For purposes of Scot, tied notes are notes which, although comprised of several graphic symbols, represent only a single musical event. (Tied notes are necessary in standard music notation for several reasons, the most common being notes which span a measure line and notes with durations not specifiable with a single symbol, such as quarter note tied to a sixteenth.) Notes which are tied together are summed by duration and output by Scot as a single event. This means you cannot, for example, change the parameters of a note in the middle of a tie (see below). Two or more notes may be tied together, as in the following example, which plays an f# for eleven beats:

     !ti "4/4"
     1 f#__ / 1 f#__ / 2. f# 4r / 

By contrast, slurred notes are treated as distinct notes at the Csound level, and may be of arbitrary pitch. The presence of a slur is reflected in parameter p4, but the slur has no other meaning beyond the interpretation of p4 by your instrument. Since instrument design is beyond the scope of this manual, it will suffice for now to explain that the Scot program gives sets p4 to one of four values depending on the existence of a slur before and after the note in question. This means Scot pays attention not only to the slur attached to a given note, but whether the preceding note specified a slur. The four possibilities are as follows, where the p4 values are taken to apply to the note `d':

     4c  d         (no slur)            p4 = 0
     4c  d_        (slur after only)    p4 = 1
     4c_ d         (slur before only)   p4 = 2
     4c_ d_        (before & after)     p4 = 3


CsoundManual - Top of this section - Previous - Contents - Index - Next

Parameters

The information contained in the Scot score notation we have considered so far is manifested in the output score in parameters p1 through p5 in the following way:

     p1:  instrument number
     p2:  initialization time of instrument
     p3:  duration
     p4:  slur information
     p5:  pitch information in octave point pitch-class notation 

Any additional parameters you may want to enter are listed in brackets as the last part of a note specification. These parameters start with p6 and are separated from each other with spaces. Any parameters not specified for a particular note have their value carried from the most recently specified value. You may choose to change some parameters and not others, in which case you can type a dot (`.') for parameters whose values don't change, and new values for those that do. Alternatively, the construction N:, where N is an integer, may be used to indicate that the following parameter specifications apply to successive parameters starting with parameter N. For example:

     4e[15000 3 4 12:100 150] g_ d_[10000 . 5]    c 

Here, for the first two quarter notes p6, p7, p8, p12, and p13 respectively assume the values 15000, 3, 4, 100, and 150. The values of p9 through p11 are either unchanged, or implicitly zero if they have never been specified in the current section. On the third quarter note, the value of p6 is changed to 10000, and the value of p8 is changed to 5. All others are unchanged.

Normally, parameter values are treated as globalsÑthat is, a value specification will carry to successive notes if no new value is specified. However, if a parameter specification begins with an apostrophe, the value applies locally to the current note only, and will not carry to successive notes either horizontally or vertically ( see divisi).


CsoundManual - Top of this section - Previous - Contents - Index - Next

Pfield Macros

Scot has a macro text substitution facility which operates only on the pfield specification text within brackets. It allows control values to be specified symbolically rather than numerically. Macro definitions appear inside brackets in the orchestra section. A single bracketed list of macro definitions preceding the first instrument declaration defines macros which apply to all instruments. An additional bracketed list of definitions may follow each instrument to specify macros that apply to that particular instrument.

     orchestra {
          [ pp=2000 p=4000 mp=7000 mf=10000 f=20000 ff=30000
            modi = 11: w = 1 x = 2 y = 3 z = 4
            vib = "10:1 " novib = "10:0 1"
          ]
     violin = 1     [ pizz = " 20:1" arco = " 20:0" ]
     serpent = 3    [ ff = 25000 sfz = 'f sffz = 'ff]
     }
     score {
      $violin = 4c[mf modi z.y novib] d e a['f vib3] /
               8 b[pizz]c 4d[f] 2c[ff arco] /
      $serpent =, 4.c[mp modi y.x] 8b 2c /
               'g[f ], c[ff] /
     } 

As can be seen from this example, a macro definition consists of the macro name, which is a string of alphabetic characters, followed by an equal sign, followed by the macro value. As usual, spaces, tabs, and newlines may be used freely. The macro value may contain arbitrary characters, and may be quoted if spacing characters need to be included.

When a macro name is encountered in bracketed pfield lists in a score section, that name is replaced with the macro text with no additional punctuation supplied. The macro text may itself invoke other macros, although it is a serious error for a macro to contain itself, directly or indirectly. Since macro names are identified as strings of alphabetic characters, and no additional spaces are provided when a macro is expanded, macros may easily perform such concatenations as found in the first serpent note above, where the integer and fractional parts of a single pfield are constructed. Also, a macro may do no more than define a symbolic pfield, as in the definition of modi. The primary intention of macros is in fact not only to reduce the number of characters required, but also to enable symbolic definitions of parameter numbers and parameter values. For instance, a particular instrument's interpretation of the dynamic ff can be changed merely by changing a macro value, rather than changing all occurrences of that particular value in the score.


CsoundManual - Top of this section - Previous- Contents - Index - Next

Divisi

Notes may be stacked on top of each other by using a back arrow (`<') between the notes of the divisi. Each time Scot encounters a back arrow, it understands that the following note is to start at the same time as the note to the left of the back arrow. Durations, accidentals and parameters carry from left to right through the divisi. Each time these are given new values, the notes to the right of the back arrows also take on the new values unless they are specified again.

When writing divisi you can stack compound events by enclosing them in parentheses. Also, divisi which occur at the end of the measure must have the proper durations or the Scot program will mis-interpret the measure duration length.

Scot EXAMPLE II:

Scot encoding:

     orchestra { right=1 left=2 }
     functions { f1 0 256 10 1}
     score {
     $right !key "-b"
     ; since p5 is pitch, p7 is set to the pitch of next note
     !ti "2/4"
     !next p5 "p7"  ;since p5 is pitch, p7 refers to pitch of next note
     !next p6 "p8"  ;If p6 is vol, say, then p8 refers to vol of next note
     t90
     8r c[3 np5]<e<='g r c<f<a / t90 r d-<g<b r =c[5]<f<a__ /
     !ti "4/4"
     t80
     4d_<f__<(8a g__) 4c<(8fe)<4g 4.c<f<f 8r/

     $left  !key "-b"
     !next p5 "p7"
     !next p6 "p8"
     !ti "2/4"
     8=,c[3 np5] r f r/ e r f r/
     !ti "4/4"
     2b_[5]<(4=,b_c) 4.a<f 8r/
     } 

Numeric score output:

     f1 0 256 10 1
     c r1 n 7 5
     c r1 n 8 6
     i1.01 0.5000 0.5000 0 8.00 3 8.00 3
     i1.02 0.5000 0.5000 0 8.04 3 8.05 3
     i1.03 0.5000 0.5000 0 8.07 3 8.09 3
     i1.01 1.5000 0.5000 0 8.00 3 8.01 3
     i1.02 1.5000 0.5000 0 8.05 3 8.07 3
     i1.03 1.5000 0.5000 0 8.09 3 8.10 3
     i1.01 2.5000 0.5000 0 8.01 3 8.00 5
     i1.02 2.5000 0.5000 0 8.07 3 8.05 5
     i1.03 2.5000 0.5000 0 8.10 3 8.09 5
     i1.01 3.5000 0.5000 0 8.00 5 8.02 5
     i1.02 3.5000 0.5000 0 8.05 5 8.05 5
     i1.01 4.0000 1.0000 1 8.02 5 8.00 5
     i1.03 3.5000 1.0000 0 8.09 5 8.07 5
     i1.01 5.0000 1.0000 2 8.00 5 8.00 5
     i1.02 4.0000 1.5000 0 8.05 5 8.04 5
     i1.02 5.5000 0.5000 0 8.04 5 8.05 5
     i1.03 4.5000 1.5000 0 8.07 5 8.05 5
     i1.01 6.0000 1.5000 0 8.00 5 8.00 5
     i1.02 6.0000 1.5000 0 8.05 5 8.05 5
     i1.03 6.0000 1.5000 0 8.05 5 8.05 5
     c r2 n 7 5
     c r2 n 8 6
     i2.01 0.0000 0.5000 0 7.00 3 7.05 3
     i2.01 1.0000 0.5000 0 7.05 3 7.04 3
     i2.01 2.0000 0.5000 0 7.04 3 7.05 3
     i2.01 3.0000 0.5000 0 7.05 3 7.10 5
     i2.01 4.0000 2.0000 1 7.10 5 7.09 5
     i2.02 4.0000 1.0000 1 6.10 5 7.00 5
     i2.02 5.0000 1.0000 2 7.00 5 7.05 5
     i2.01 6.0000 1.5000 2 7.09 5 7.09 5
     i2.02 6.0000 1.5000 0 7.05 5 7.05 5
     t0 60 0.0000 90.0000 2.0000 90.0000 4.0000 80.0000 4.0000 90.0000
     f0 8.0000
     s
     e


Notice in this example that tempo statements occurred in instrument `right' only. Also, all notes had p6=3 until the third measure, at which point p6 took on the value 5 for all notes. The next parameter option used is described in Additional Features.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Additional Features in the Scot Score

Several options can be included in any of the individual instrument parts within a section.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Key Signatures

Any desired key signature is specified by listing the accidentals as they occur in a key signature statement. Thereafter, all notes of that instrument part are sharpened or flattened accordingly. For example, for the key of D, type

      !key "#fc"

The keyword which follows the `!' may be abbreviated to the first two characters.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Accidental Following

Accidental following may be turned on or off as needed. When turned off, accidentals no longer carry throughout the measure as in traditional notation. This convention is sometimes used in contemporary scores.

     !accidentals "off" 

The keyword which follows the `!' may be abbreviated to the first two characters.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Octave Following

Turning off octave following indicates that pitches stay in the same absolute octave register until explicitly moved. An absolute octave starts at pitch c and ends at the b above it. The octave middle-c-to-b is indicated with an equals sign (`=') and octave displacement is indicated with the appropriate number of commas or apostrophes. These displacements are cummulative. For example,

     !octaves "off"
     4='c g b 'c 

starts at the c above middle c and ends at two c's above middle c.

The keyword which follows the `!' may be abbreviated to the first two characters.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Vertical Following

Turning off vertical following means that durations, register, and parameters only carry horizontally from note to note and not vertically as described in the section on divisi .

     !vertical "off"

The keyword which follows the `!' may be abbreviated to the first two characters.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Transposition

Any instrument part can be transposed to another key by indicating the intervalic difference between the notated key and the desired key. This difference is always taken with reference to middle c - to transpose a whole step upward, for example, type

     !transpose "d" 

This indicates that the part is transposed by the interval difference between middle c and d.

The keyword which follows the `!' may be abbreviated to the first two characters.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Next-value and Previous-value Parameters

In order to play a note, it is sometimes necessary for an instrument to know what value one or more parameters will have for the next note. For instance, an instrument might be designed which glisses during the last portion of its performance (perhaps only when a slur is indicated) from its written pitch to the pitch of the next note. This can only be done, of course, if the instrument can know what the pitch of the next note will be.

The necessary information can be provided using next-value parameters. A next value parameter might be declared by

     !next p5 "p6" 

which is interpreted to mean that for the current instrument, p6 will contain the next note's p5 value. This holds true globally for all occurences of this instrument until further modifications. If for any reason you wish to override this value, p6 may be filled in explicitly. This is sometimes useful for the last note of a section, for which p6 will otherwise assume the p5 value for the current note. The next-value feature is illustrated in the Scot example II.

The necessary information may also be provided using standard numeric score next-value parameters. A parameter argument containing the symbol npx (where x is an integer) will substitute parameter number x of the following note for that instrument. Similarly, the value of a parameter occurring during the previous note may be referenced with the symbol ppx (where x is an integer). Details of the next- and previous-value parameter feature may be found in the Numeric Scores section.


CsoundManual - Top of this section - Previous - Contents - Index - Next

Ramping Pfields

containing the symbol < will be replaced by values derived from linear interpolation of a time-based ramp. Ramp endpoints are defined by the first real number found in the same pfield of a preceding and following note played by the same instrument. Details of the ramping feature are likewise found in the Numeric Scores section.


CsoundManual - Top of this section - Previous - Contents - Index - Next section

f0 Statements

In each score section, Scot automatically produces an f0 statement with a p2 equal to the ending time of the last note or rest in the section. Thus, `dead time' at the end of a section for reverberation decay or whatever purpose may be specified musically by rests in one or more parts. See the eighth rest at the end of Scot example II .