YampaSynth: Software synthesizer

[ bsd3, music, sound ] [ Propose Tags ] [ Report a vulnerability ]

YampaSynth is a software synthesizer implemented in Yampa, domain specific language embedded in Haskell. It contains a little framework of sound generating and sound shaping modules (e.g. oscillator, amplifier, mixer, envelope generator, filter, etc.) and example applications:

  • "yampasynth-wav" is an application which synthesizes a MIDI music and writes result into a WAVE audio file.

  • "yampasynth-openal" is an application which synthesizes a MIDI music and sends audio data in real-time to a sound card. We use Haskell binding of OpenAL library as an interface to audio hardware.

  • "yampasynth-gtk" is an application with the simple graphical user interface which allows you to play a music with various instruments in real-time using the keyboard of your computer. We use Haskell binding of GTK library for GUI programming and Haskell binding of OpenAL library as an interface to audio hardware.

Software synthesizer uses the MIDI standard as a music description and the SoundFont standard as an instrument description.

Implementation is based on the paper "Switched-on Yampa: Declarative Programming of Modular Synthesizers", by George Giorgidze and Henrik Nilsson (http://www.cs.nott.ac.uk/~ggg/publications/padl2008.pdf), In Proceedings of 10th International Symposium on Practical Aspects of Declarative Languages, San Francisco, CA, USA, January 7-8, 2008.

This is mainly a proof of concept, but already useful to some extent.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
wav

Builds yampasynth-wav executable which synthesizes a MIDI music and writes result into a WAVE audio file.

Enabled
openal

Builds yampasynth-openal executable which synthesizes MIDI music and sends audio data in real-time to a sound card. We use Haskell binding of OpenAL library as an interface to audio hardware.

Disabled
gtk

Builds yampasynth-gtk executable with simple graphical user interface which allows you to play music with various instruments in real-time using keyboard of your computer. We use Haskell binding of GTK library for GUI programming and Haskell binding of OpenAL library as an interface to audio hardware.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.0.2, 0.1, 0.1.1, 0.1.2, 0.2
Dependencies array, base (<5), bytestring, containers, glade, gtk, HCodecs (>=0.5), OpenAL, Yampa [details]
License BSD-3-Clause
Copyright (c) 2007-2014 George Giorgidze and Henrik Nilsson
Author George Giorgidze and Henrik Nilsson
Maintainer George Giorgidze (giorgidze@gmail.com)
Category Sound, Music
Home page http://www-db.informatik.uni-tuebingen.de/team/giorgidze
Source repo head: git clone https://github.com/giorgidze/YampaSynth.git
Uploaded by GeorgeGiorgidze at 2014-05-30T00:20:40Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables yampasynth-gtk, yampasynth-openal, yampasynth-wav
Downloads 6226 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2016-10-26 [all 10 reports]

Readme for YampaSynth-0.2

[back to package description]
YampaSynth Release Notes  
-------------------------------------------

Description
-----------
YampaSynth is a software synthesizer implemented in Haskell, using Yampa domain specific language. It contains little framework of sound generating and sound shaping modules and example applications:
  * yampasynth-wav is an application which synthesizes a MIDI music and writes result into a WAVE audio file.
  * yampasynth-openal is an application which synthesizes MIDI music and sends audio data in real-time to a sound card. We use Haskell binding of OpenAL library as an interface to audio hardware.
  * yampasynth-gtk is an application with simple graphical user interface which allows you to play music with various instruments in real-time using keyboard of your computer. We use Haskell binding of GTK library for GUI programming and Haskell binding of OpenAL library as an interface to audio hardware.

Software synthesizer uses the MIDI standard as a music description and the SoundFont standard as an instrument description.

Implementation is based on the paper "Switched-on Yampa: Declarative Programming of Modular Synthesizers" by George Giorgidze and Henrik Nilsson (http://www.cs.nott.ac.uk/~ggg/publications/padl2008.pdf).

This is mainly a proof of concept, but already useful to some extent.
             
Prerequisites
-------------
* You will need Glasgow Haskell Compiler (GHC) version 6.8 or higher.
* Cabal version 1.2 or higher.
* To install any of the example applications you will need the following packages:
    * base
    * array
    * containers
    * bytestring
    * Yampa
    * HCodecs
  All of them are either included with GHC or are available for download from Hackage (http://hackage.haskell.org/).
  
  Aforementioned dependencies are enough to build yampasynth-wav application.
  To build yampasynth-openal in addition you will need OpenAL package from Hackage.
  To build yampasynth-gtk in addition you will need to install GTK and Glade from Hackage.

  For further details about dependencies see cabal package description file (YampaSynth.cabal).

Installation
------------
Use standard steps for Cabal package installation.

runhaskell Setup.hs configure
runhaskell Setup.hs build
runhaskell Setup.hs install

This will install applications for which your system satisfies dependencies.

Usage
-----
Some typical usage example are:

yampasynth-wav -r 44100  -s /path/to/SoundFontFile.sf2  -m /path/to/MidiFile.mid  -o /path/to/result.wav

yampasynth-openal -r 11025 -s /path/to/SoundFontFile.sf2 -m /path/to/MidiFile.mid

yampasynth-gtk -r 22050 -s /path/to/SoundFontFile.sf2

If you have dual core CPU add "+RTS -N2 -RTS" to your options (this works only for yampasynth-openal and yampasynth-gtk).
You may also try "+RTS -N2 -C -RTS".

Option "-r 44100" sets sampling rate (or sampling frequency) of a synthesizer to 44100 samples per second.
With yampasynth-wav I recommend to use 44100 Hz, which will generate audio CD quality .wav files.
With yampasynth-openal I recommend to use 11025 Hz to get a smooth real-time playback without interruption, especially when playing a polyphonic music with several instruments. But sometimes you can afford higher sampling rates, feel free to experiment with this value.
With yampasynth-gtk I recommend to use 22050 Hz, if you get interruptions decrease it.

SoundFonts
----------
SoundFonts are instrument description files. They are used in software and hardware synthesis. Free soundfonts are available for download. Try to google "free soundfont". Here are some links which I have found and used:
http://soundfonts.homemusician.net/
http://www.sf2midi.com/

I recommend to search for "FluidR3_GM.SF2" (it is also included in some linux distributions). However the file size is about 150 MB and it takes some time for synthesizer to parse and import it into memory. But quality of the generated audio is very good.
There are smaller ones e.g. "Ultimate.SF2" which is only 8 MB in size.

OpenAL
------
For real-time playback I use Haskell binding of OpenAL library.
On some linux systems (including my Ubuntu 7.10, OpenAL version libopenal0a 1:0.0.8) there are some issues with original C library, it is very buggy. For example on my system there were problems with ALSA output, so I had to put "(define devices '(native esd))" into my "~/.openalrc" file.
Also output was not that good on sampling rates other than 11025, 22050 and 44100.
In general I recommend to use these sampling rates if you experience similar problems.