Skip to content

Instantly share code, notes, and snippets.

@jacobjoaquin
Created August 10, 2011 03:37
Show Gist options
  • Save jacobjoaquin/1136077 to your computer and use it in GitHub Desktop.
Save jacobjoaquin/1136077 to your computer and use it in GitHub Desktop.
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