Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Positive or Negative
Positive or Negative
Jacob Joaquin
Aug 9, 2011
jacobjoaquin@gmail.com
CodeHop.com
<CsoundSynthesizer>
<CsInstruments>
sr = 44100
kr = 441
ksmps = 100
nchnls = 1
0dbfs = 1.0
instr 1
; Generate a 100Hz sine wave
a1 oscils 1.0, 100, 0
; Limit the signal between 0.0 and 1.0
a1 limit a1, 0.0, 1.0
; If the signal equals 0.0, output 0.0
; else output a signal of 1.0
a1 = ceil(a1)
; Output
out a1
endin
</CsInstruments>
<CsScore>
i 1 0 4
</CsScore>
</CsoundSynthesizer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.