TOOT 2: Difference between revisions

From OLPC
Jump to navigation Jump to search
(New page: The first instrument was not interesting because it could play only one note at one amplitude level. We can make things more interesting by allowing the pitch and amplitude to be defined b...)
 
No edit summary
 
Line 3: Line 3:


p1 = instrument number
p1 = instrument number

p2 = start time
p2 = start time

p3 = duration
p3 = duration



Latest revision as of 22:18, 23 March 2008

The first instrument was not interesting because it could play only one note at one amplitude level. We can make things more interesting by allowing the pitch and amplitude to be defined by parameters in the score. Each column in the score constitutes a parameter field, numbered from the left. The first three parameter fields of the i statement have a reserved function:


p1 = instrument number

p2 = start time

p3 = duration


All other parameter fields are determined by the way the sound designer defines his instrument. In the instrument below, the oscillator's amplitude argument is replaced by p4 and the frequency argument by p5. Now we can change these values at i-time, i.e. with each note in the score. The orchestra and score files now look like:


orchestra

 File: Toot02.orc
        instr 2

a1        oscil     p4, p5, 1      ; p4=amp

          out       a1             ; p5=freq

          endin

score

 File: Toot02.sco
f1   0    4096 10 1      ; sine wave



;ins strt dur  amp(p4)   freq(p5)

i2   0    1    2000      880

i2   1.5  1    4000      440

i2   3    1    8000      220

i2   4.5  1    16000     110

i2   6    1    32000     55



e