diff options
Diffstat (limited to 'examples/scantable.csd')
-rw-r--r-- | examples/scantable.csd | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/examples/scantable.csd b/examples/scantable.csd index 20340b9..94d4470 100644 --- a/examples/scantable.csd +++ b/examples/scantable.csd @@ -1,54 +1,40 @@ <CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform -; Audio out Audio in No messages --odac -iadc -d ;;;RT audio I/O +-odac -+rtmidi=virtual -M0 ;;;realtime audio out and midi in +;-iadc ;;;uncomment -iadc if realtime audio input is needed too ; For Non-realtime ouput leave only the line below: ; -o scantable.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> -; Initialize the global variables. sr = 44100 -kr = 4410 -ksmps = 10 -nchnls = 1 - -; Table #1 - initial position -git1 ftgen 1, 0, 128, 7, 0, 64, 1, 64, 0 -; Table #2 - masses -git2 ftgen 2, 0, 128, -7, 1, 128, 1 -; Table #3 - stiffness -git3 ftgen 3, 0, 128, -7, 0, 64, 100, 64, 0 -; Table #4 - damping -git4 ftgen 4, 0, 128, -7, 1, 128, 1 -; Table #5 - initial velocity -git5 ftgen 5, 0, 128, -7, 0, 128, 0 - -; Instrument #1. +ksmps = 32 +nchnls = 2 +0dbfs = 1 + +gi1 ftgen 1, 0, 128, 7, 0, 64, 1, 64, 0 ; initial position +gi2 ftgen 2, 0, 128, -7, 1, 128, 1 ; masses +gi3 ftgen 3, 0, 128, -7, 0, 64, 100, 64, 0 ; stiffness +gi4 ftgen 4, 0, 128, -7, 1, 128, 1 ; damping +gi5 ftgen 5, 0, 128, -7, 0, 128, 0.5 ; initial velocity + + instr 1 - kamp init 20000 - kpch init 220 - ipos = 1 - imass = 2 - istiff = 3 - idamp = 4 - ivel = 5 - - a1 scantable kamp, kpch, ipos, imass, istiff, idamp, ivel - a2 dcblock a1 - - out a2 -endin +iamp ampmidi .5 +ipch cpsmidi +kenv madsr .1, .1, .8, .3 +asig scantable iamp, ipch, 1, 2, 3, 4, 5 +asig dcblock asig + outs asig*kenv, asig*kenv + +endin </CsInstruments> <CsScore> -; Play Instrument #1 for ten seconds. -i 1 0 10 +f0 60 ; play for 60 seconds e - - </CsScore> </CsoundSynthesizer> |