Created
February 15, 2012 19:22
-
-
Save HeinrichApfelmus/1838304 to your computer and use it in GitHub Desktop.
Strange behavior with stereo panning in hsc3-0.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Exception | |
import qualified Sound.SC3 as SC | |
-- Haskell version | |
incorrectPan = withSuperCollider $ do | |
SC.audition $ SC.out 0 $ | |
0.2* SC.balance2 (osc 220) (osc 220) mod (SC.constant 1) | |
getChar | |
where | |
osc freq = SC.sinOsc SC.AR (SC.constant freq) (SC.constant 0) | |
mod = SC.sinOsc SC.KR (SC.constant 0.2) (SC.constant 0) | |
withSuperCollider = bracket_ | |
(SC.withSC3 $ \fd -> SC.send fd (SC.g_new [(1, SC.AddToTail, 0)])) | |
(SC.withSC3 $ \fd -> SC.send fd (SC.n_free [1])) | |
-- Presumably equivalent SuperCollider code | |
{- | |
( | |
SynthDef.new("test-balance", { | |
Out.ar(0, | |
0.2 * Balance2.ar(SinOsc.ar(220,0), SinOsc.ar(220,0), SinOsc.kr(0.2,0)) | |
) }).play; | |
) | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment