Skip to content

Instantly share code, notes, and snippets.

@jacobjoaquin
Created September 29, 2010 21:03
Show Gist options
  • Save jacobjoaquin/603559 to your computer and use it in GitHub Desktop.
Save jacobjoaquin/603559 to your computer and use it in GitHub Desktop.
Four Fundamental Waveforms
Jacob Joaquin
September 29, 2010
[email protected]
csoundblog.com
<CsoundSynthesizer>
<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 1.0
instr 1
iamp = p4 ; Amplitude
ifreq = p5 ; Frequency
a1 oscils iamp, ifreq, 0 ; Sine Oscillator
out a1
endin
instr 2
iamp = p4 ; Amplitude
ifreq = p5 ; Frequency
iwave = p6 ; Waveform. 0 = sawtooth, 2 = square, 12 = triangle
a1 vco2 iamp, ifreq, iwave, 0.5 ; Oscillator
out a1
endin
</CsInstruments>
<CsScore>
f 1 0 8192 10 1
; Sine
i 1 0 1 0.707 110
i 1 1 1 0.707 220
i 1 2 1 0.707 440
i 1 3 1 0.707 880
s
; Triangle
i 2 0 1 0.707 110 12
i 2 1 1 0.707 220 12
i 2 2 1 0.707 440 12
i 2 3 1 0.707 880 12
s
; Square
i 2 0 1 0.707 110 2
i 2 1 1 0.707 220 2
i 2 2 1 0.707 440 2
i 2 3 1 0.707 880 2
s
; Sawtooth
i 2 0 1 0.707 110 0
i 2 1 1 0.707 220 0
i 2 2 1 0.707 440 0
i 2 3 1 0.707 880 0
</CsScore>
</CsoundSynthesizer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment