On Sun, 8 Jul 2012, CK Kashyap wrote:
After this, I tried to do "play childSong6" - nothing happened - my sound card
probably does not support
midi. So I installed timidity and
ran it as follows "timidity -iA -Os&" - I re-ran ghci and found that it still
did not play the music. So did
a "" and generated the midi file. timidity played it beautifully!!!!
Are you on Linux? 'play' is part of the SoX package and should only play
pcm audio files. It may try to play the MIDI data as raw pcm data, though.
As a first test you can play a MIDI file using simply 'timidity file.mid'.
If you run timidity with -iA option, then it is in server mode and may be
controlled by other programs like an external keyboard, 'pmidi', our
live-sequencer or some Haskell code from GHCi like reactive-balsa. In
order to actually control timidity by another program you must connect the
controlling program and the controlled program either from the
command-line with 'aconnect' or from a GUI like 'patchage', 'qjackctl',
'alsa-patch-bay' or 'kaconnect'. With 'pmidi -l' or 'aconnect -o -i' you
can list servers and clients with their ALSA address.
I assume that Euterpea uses PortMidi which uses ALSA but in order to be
portable PortMidi does not integrate so nicely with the ALSA framework. A
program using PortMidi does not appear as an ALSA client or server, it can
only directly control other programs. I think the default is that PortMidi
writes to the Client 'Midi Through'. So you must connect 'Midi Through' to
TiMidity:
$ aconnect 'Midi Through' TiMidity
I still cannot believe "the quality of synthesis" .... does timidity synthesize
the instruments or it has
stored samples???
TiMidity is a sampling synthesizer. If you want better samples you may
install package fluid-soundfont-gm. (For real sound synthesis in Haskell I
can assist building synthesizer-llvm. :-)
_______________________________________________
haskell-art mailing list
haskell-art@lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art