/*Getting started.. 1.3 Basic Elements: Opcodes The fundamental building blocks of a Csound instrument is the opcode. Each opcode can be seen as little program itself, that does a specific task. Opcodes get a bold-blue highlighting in the CsoundQt editor. In this example 'line', 'expon', 'oscil', 'outvalue' and 'outs', are the opcodes used. The names of opcodes are usually a short form of their functionality. 'line' - generates a linear changing value between specified points 'expon' - generates a exponential curve between two points 'oscil' - is a tone generator (an oscillator) 'outvalue' - sends a value to a user defined channel, in this case to the widget display 'outs' - writes stereo audio data to an external audio device It is important to remember that opcodes receive their input arguments on the right and output their results on the left, like this: output Opcode input1, input2 */ sr = 44100 ksmps = 128 nchnls = 2 0dbfs = 1 instr 1 kFreq line 100, 5, 1000 ; 'line' generates a linear ramp, from 100-1000 Hz, taking 5 seconds aOut oscili 0.2, kFreq, 1 ; an oscillator whose frequency is taken from the value produced by 'line' outvalue "freqsweep", kFreq ; show the value from 'line' in a widget outs aOut, aOut ; send the oscillator's audio to the audio output endin instr 2 kFreq expon 100, 5, 1000 ; the 'expon' exponential curve is more useful when working with frequencies aOut oscili 0.2, kFreq, 1 outvalue "freqsweep", kFreq outs aOut, aOut endin f 1 0 1024 10 1 ; the basic sine waveform for the oscillator is generated here i 1 0 5 i 2 5 5 ; the exponential curve goes more even thought the octaves e ; written by Alex Hofmann (Nov. 2009) - Incontri HMT-Hannover 1013 279 563 397 true 160 158 162 21 7 248 71 {8a703a13-1bbf-4338-8e0a-993e086a405e} true 0 -3 left top Noto Sans 14 3 0 0 0 255 255 255 false 1 0 freqsweep 108 37 144 29 {30e5e14c-4c4b-46a1-8584-d8d488ec61e9} true 0 -3 center center Sans Serif 16 3 0 0 0 182 109 0 true 1 1 22 365 255 150 {3e0a7775-89a7-4f52-85ea-52e3ff2348b1} true 0 -3 -255.00000000 scope 2.00000000 1.00000000 1.00000000 1.00000000 0.00000000 NoTrigger 22 313 254 53 {f47b80f1-e5e6-4020-9065-17df4bb3ed44} true 0 -3 left top Noto Sans 14 3 0 0 0 255 255 255 false 1 0 20 180 251 109 {17cbc48e-c1f3-4cae-aabc-d738a68aa532} true 0 -3 0 1.00000000 1.00000000 1.00000000 1.00000000 auto auto true true true true true true true 21 105 251 69 {9e3bc813-428f-4648-b9cd-5084a7fbe634} true 0 -3 left top Noto Sans 14 3 0 0 0 255 255 255 false 1 0