Home > Uncategorized > Sine oscillator in Yampa

Sine oscillator in Yampa

Yampa can be used to produce sound waves as illustrated here. In order to understand Yampa better I tried out the sine oscillator.

oscSine :: Double -> SF Double Double
oscSine f0 = proc cv -> do
               let f = f0 * (2 ** cv)
               phi <- integral -< 2 * 3.1415 * f
               returnA -< sin phi

sinTest = constant 0 >>> oscSine 1

embed sinTest (0.0, take 250 (repeat (0.01, Nothing)))

Plotting the result yields:


Ok. No problem so far.

Categories: Uncategorized
  1. No comments yet.
  1. August 1, 2012 at 1:13 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: