Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; Deep Bass Nine
- ; Copyright (C) 2013 Henrik Andersson <[email protected]>
- ;
- ; This program is free software: you can redistribute it and/or modify
- ; it under the terms of the GNU General Public License as published by
- ; the Free Software Foundation, either version 3 of the License, or
- ; (at your option) any later version.
- ;
- ; This program is distributed in the hope that it will be useful,
- ; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ; GNU General Public License for more details.
- ;
- ; You should have received a copy of the GNU General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
- ;
- <CsoundSynthesizer>
- <CsOptions>
- -odac -M0 -+rtaudio=alsa -+rtmidi=virtual
- </CsOptions>
- <CsInstruments>
- sr = 44100
- kr = 4410
- ksmps = 10
- nchnls = 1
- massign 0, 0
- massign 1, 1
- ; Register control channels
- chn_k "Waveform", 1, 1, 0, 0, 1 ; 2 waveforms saw / square
- chn_k "Tuning", 1, 2, 0, -1, 1 ; 1 octave range
- chn_k "CutOffFreq", 1, 2, 500, 100, 5000
- chn_k "Resonance", 1, 2, 5, 1, 500
- chn_k "EnvMod", 1, 2, 0.5, 0, 1
- chn_k "Decay", 1, 2, 0.5, 0, 1
- chn_k "Accent", 1, 2, 0.5, 0, 1
- chn_k "Volume", 1, 2, 0.75, 0, 1
- ; Set defaults
- chnset 0, "Waveform"
- chnset 0.00, "Tuning"
- chnset 200, "CutOffFreq"
- chnset 2, "Resonance"
- chnset 1.0, "EnvMod"
- chnset 0.5, "Decay"
- chnset 0.5, "Accent"
- chnset 0.75, "Volume"
- instr Deep_Bass_Nine ; expects MIDI note inputs on channel 1
- iW chnget "Waveform"
- iV chnget "Volume"
- iE chnget "EnvMod"
- iD chnget "Decay"
- iA chnget "Accent"
- iCOF chnget "CutOffFreq"
- iQ chnget "Resonance"
- ifreq cpsmidi
- ivel ampmidi 1
- adec linsegr 0.0, 0.01, 1.0, 10.0 * iD , 0.0, 0.1, 0.0
- kdec linsegr 0.0, 0.01, 1.0, 10.0 * iD , 0.0, 0.1, 0.0
- a1 oscil 32767 * 0.8 * ivel * adec, ifreq, 1+iW
- a2 lowpass2 a1, iCOF * (1.0-((1.0-kdec)*iE)), iQ
- out a2
- endin
- </CsInstruments>
- <CsScore>
- f1 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 0.111 ; Saw
- f2 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 0.111 ; Square
- i1 0 10000
- e
- </CsScore>
- </CsoundSynthesizer>
Advertisement
Add Comment
Please, Sign In to add comment