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

Toot 1: Play One Note

For this and all instrument examples , there exist orchestra and score files in the Csound subdirectory tutorfiles that the user can run to soundtest each feature introduced. The instrument code shown below is actually preceded by an orchestra header section similar to that shown above. If you are running on a RISC computer, each example will likely run in realtime. During playback (realtime or otherwise) the audio rate may automatically be modified to suit the local d-a converters.

The first orchestra file, called toot1.orc, contains a single instrument which uses an oscil unit to play a 440Hz sine wave (defined by f1 in the score) at an amplitude of 10000.

  instr 1
    a1     oscil     10000, 440, 1
           out       a1
   endin
Run this with its corresponding score file, toot1.sco :
  f1     0    4096 10   1    ; use "gen1" to compute a sine wave
  i1     0    4              ; run "instr 1" from time 0 
                             ; for 4 seconds
  e                          ; indicate the "end" of the score

QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 
HTML Csound Manual - © Jean Piché & Peter J. Nix, 1994-97