<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: ; -o hsboscil_midi.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> ; Initialize the global variables. sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 ; synth waveform 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. itona octmidi ; velocity is mapped to brightness ibrite ampmidi 3 ; Map an exponential envelope for the amplitude. kenv expon 20000, 1, 100 asig hsboscil kenv, itona, ibrite, ibase, giwave, giblend, ioctcnt out asig endin </CsInstruments> <CsScore> ; Play Instrument #1 for ten minutes i 1 0 600 e </CsScore> </CsoundSynthesizer>