Index | Previous Week |
instr 90 ; global slow panning instrument gkpan line 0, p3, 1 ; ramp from 0 to 1 endin
i90 0 5 ; pans right to left in 5 seconds i1 0 .25 10000 8.00 i1 + . i1 + . i1 + . i1 + . ; ...etc e instr 1 ; instrument that accesses global pan kenv line 1, p3, .0001 ; linear ramp audio foscili p4*kenv, cpspch(p5), 1, 3.001, 6, 1 ; fm oscillator outs audio*gkpan, audio*(1-gkpan) ; global panning endinGlobal variables can be used in a similar fashion to control any values that you want applied across multiple instruments.
Index
Index
In the example below, the first section ends (and section section starts) at time 47.5:
It is possible to have instruments which play over section boundaries, by using negative durations. If you specify a duration as a negative value, the instrument will sound past the section boundary. However, the instrument's p3 (which is negative) must be changed to positive in the instrument with the line:
Index
Increasing the Fidelity of your Sound Files
There are a number of ways to increase the quality of your sound files - most of which also increase the computation time of your sound file. The more your piece deals with high frequencies, the more important it is to improve the fidelity.
Score Sections
When working on a large project it is sometimes useful to divide your score into sections, and work on one section at a time. This works particularly well if there are clear breaks in your piece (much more difficult if the composition is continuous). A new section of your score begins after an S-statement in the score (a line beginning with s). In the new score section, you begin again at time 0, and the new section begins as soon as the previous section ends - the last note in the section is complete. If you want a space before the end of one section and the beginning of the next, use a dummy instrument (an instrument starting at he end of the section and having no duration, or use an f0 statement at the desired end time.
...
i1 45.0 .5 10000 8.00
i1 46.0 .5 10000 8.00
i1 47.0 .5 10000 8.00
s1 ; end of section one
i1 0 .25 8000 10.01
i1 1 .25 8000 10.02
i1 2 .25 8000 10.03
...
In the next example, a dummy instrument causes the section boundary to be 48.0
...
i1 46.0 .5 10000 8.00
i1 47.0 .5 10000 8.00
i1 48.0 0 0 0 ; a dummy instrument - no duration
s1 ; end of section one
i1 0 .25 8000 10.01
i1 1 .25 8000 10.02
i1 2 .25 8000 10.03
...
Alternatively, f0 could be used:
f0 48.0 ; an f0 statement at time 48.0
...
i1 46.0 .5 10000 8.00
i1 47.0 .5 10000 8.00
s1 ; end of section one
i1 0 .25 8000 10.01
i1 1 .25 8000 10.02
...
In order to work on one section of the score at a time, you can either block comment out the other sections /* ...... */ or you can use the advance statements (see below).
p3 = abs(p3) ; take the absolute value of p3
Now for the restrictions: The instrument will sound across the section boundary, but will be turned off automatically when it the same instrument is called again. If you are using different instruments in the next section, this will not be a problem; however, if you are using the same instrument, you can give the held instrument a decimal value (e.g. i 1.1) to distinguish it from the other copies. Because the held notes are crossing the section boundary, they will not turn off automatically. To turn off an instrument, use a negative instrument at the appropriate time. If you have more than one copy of the instrument handing over the section boundary, give each one a different decimal value. The example below should help clarify all of this:
f0 4.0 ; cause artificial section ending at 4.0
i1 0 .5 10000 8.00
i1 1 .5 10000 8.00
i1 2 .5 10000 8.00
i1.1 3 -5 2000 9.00 ; 1.1 copy of instrument 1
i1.2 3 -6 2000 9.07 ; 1.2 copy of instrument 1
s 1
/* section 2 starts at time 4.0 */
i1 0 .5 10000 8.00
i1 1 .5 10000 8.00
i1 2 .5 10000 8.00
i1 3 .5 10000 8.00
i1 4 .5 10000 8.00
i-1.1 4 0 ; turn off i 1.1
i-1.2 5 0 ; turn off i 1.2
i1 5 .5 10000 8.00
Advance statements
Advance statements causes the score to skip ahead a specified number of beats. This is useful if you are working on a small section in the middle of a large score, or if you want to advance through an entire score section. p2 refers to the starting beat of the advance, and p3 is the duration (in beat) of the advance.
a0 0 25.0 ; advance 25.0 beats beginning at time 0.
OR
a0 12.0 24.0 ; skip from beat 12.0 to beat 24.0
Index | Previous Week |