summaryrefslogtreecommitdiff
path: root/examples/goto.csd
diff options
context:
space:
mode:
Diffstat (limited to 'examples/goto.csd')
-rw-r--r--examples/goto.csd42
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/goto.csd b/examples/goto.csd
new file mode 100644
index 0000000..1f69f24
--- /dev/null
+++ b/examples/goto.csd
@@ -0,0 +1,42 @@
+<CsoundSynthesizer>
+<CsOptions>
+; Select audio/midi flags here according to platform
+; Audio out Audio in
+-odac -iadc ;;;RT audio I/O
+; For Non-realtime ouput leave only the line below:
+; -o goto.wav -W ;;; for file output any platform
+</CsOptions>
+<CsInstruments>
+
+; Initialize the global variables.
+sr = 44100
+kr = 4410
+ksmps = 10
+nchnls = 1
+
+; Instrument #1.
+instr 1
+ a1 oscil 10000, 440, 1
+ goto playit
+
+ ; The goto will go to the playit label.
+ ; It will skip any code in between like this comment.
+
+playit:
+ out a1
+endin
+
+
+</CsInstruments>
+<CsScore>
+
+; Table #1: a simple sine wave.
+f 1 0 32768 10 1
+
+; Play Instrument #1 for one second.
+i 1 0 1
+e
+
+
+</CsScore>
+</CsoundSynthesizer>