Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Real time synthesizer written in Haskell

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,114
Loading...
Alert icon
Sign in or sign up now!
Alert icon
Ratings have been disabled for this video.

Uploaded by on Nov 29, 2009

This is a demo of interactive real-time sound-synthesis written in Haskell.
You find the project files in
http://code.haskell.org/synthesizer/alsa/

Technical details:
I'm running a Linux notebook at 2 GHz.
There is an E-MU X-board plugged to the machine via USB, that sends NoteOn and NoteOff messages.
They are received via ALSA's MIDI facility.
The Haskell program treats the MIDI events as a lazy list
and transforms this list to a lazy StorableVector, that is written to ALSA output.
To be honest, I could cheat here, and could just record the MIDI events and render the music offline.
Actually I have cheated a bit: The sounds are played in realtime, but I get some buffer underruns whenever I play too many notes simultaneously.
In order to get full quality in stereo without those underruns,
I have written the audio stream not only to ALSA output, but also to a file.
Then I have extracted the audio stream from the video recorded with the camera using ffmpeg.
In the next step I have synchronized the rendered audio stream to the recorded one using Audacity.
Then I have assembled the cut rendered audio stream and the recorded video stream using ffmpeg, again.
However, although the video I uploaded is exactly synchronized and of good sound quality, the YouTube replay is slightly desynchronized and the sound quality is poor.

The sounds are rendered in stereo, single precision float (rendering time with double precision is equally fast or equally slow) at 48000 Hz sample rate.
I have chosen quite simple sounds:
The first three sounds are purely synthesized,
whereas the last two sounds (piano and strings) are sampled sounds.
I have modified the sampled string sound in order to get a nice loop.
This is just for testing the phase and time modification method, that I have developed.
http://arxiv.org/abs/0911.5171

I can also utilize pitch bender, the modulation wheel, aftertouch and the other control knobs,
however all effects further increase computation time and thus reduce polyphony.
Currently I can also not switch between instruments that respond to a different set of controllers within the performance.

There is still much room for optimization,
but it becomes more and more difficult to find out the bottlenecks.

Category:

Music

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • Seriously, that carpet brings back memories...

  • coooooooooooooooooooooooool :)

  • nice...

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more