summaryrefslogtreecommitdiff
path: root/examples/hsboscil_midi.csd
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hsboscil_midi.csd')
-rw-r--r--examples/hsboscil_midi.csd40
1 files changed, 17 insertions, 23 deletions
diff --git a/examples/hsboscil_midi.csd b/examples/hsboscil_midi.csd
index 7be64eb..f2b9f6f 100644
--- a/examples/hsboscil_midi.csd
+++ b/examples/hsboscil_midi.csd
@@ -1,49 +1,43 @@
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-; Audio out Audio in No messages MIDI in
--odac -iadc -d -M0 ;;;RT audio I/O with MIDI in
-; For Non-realtime ouput leave only the line below:
+; Audio out
+-odac -M0 ;;;realtime audio out and realtime MIDI in
+;-iadc ;;;uncomment -iadc if realtime audio input is needed too
; -o hsboscil_midi.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
-; Initialize the global variables.
sr = 44100
-kr = 4410
-ksmps = 10
-nchnls = 1
+ksmps = 32
+nchnls = 2
+0dbfs = 1
; synth waveform
-giwave ftgen 1, 0, 1024, 10, 1, 1, 1, 1
+giwave ftgen 1, 0, 1024, 10, 1, 1, 1, 1
; blending window
giblend ftgen 2, 0, 1024, -19, 1, 0.5, 270, 0.5
-; Instrument #1 - use hsboscil in a MIDI instrument.
instr 1
- ibase = cpsoct(6)
- ioctcnt = 5
- ; all octaves sound alike.
+ibase = cpsoct(6)
+ioctcnt = 5
+
+; all octaves sound alike.
itona octmidi
; velocity is mapped to brightness
- ibrite ampmidi 3
+ ibrite ampmidi 4
- ; Map an exponential envelope for the amplitude.
- kenv expon 20000, 1, 100
+; Map an exponential envelope for the amplitude.
+kenv expon .8, 1, .01
+asig hsboscil kenv, itona, ibrite, ibase, giwave, giblend, ioctcnt
+ outs asig, asig
- asig hsboscil kenv, itona, ibrite, ibase, giwave, giblend, ioctcnt
- out asig
endin
-
-
</CsInstruments>
<CsScore>
-; Play Instrument #1 for ten minutes
-i 1 0 600
+i 1 0 30 ; play for 30 seconds
e
-
-
</CsScore>
</CsoundSynthesizer>