> >> as a beginner I have a beginner's question: Which is the most simple way
> >> to make my haskell programm play a sound?
> >
> > It really depends what kind of sound you want to make. Play a beep, or a
> > .wav file,
> > or a waveform generated by your program, or just play a piano-like sound,
> > etc...?
> Completely true, a little more context would be helpful here.


Ok, more background: As my first "real" haskell project I am writing a
programm which can take tabs (short form notation of what notes are to
be played in which order but with no information on the notes length)
for different instruments and translates them to tabs for other
instruments. Most of this is text and number manipulation; most of it is
finished and working great and I am confident that people will like it.

For checking the user input I need my prog to be able to play the melody
the user has entered because if there is a wrong note in the melody, the
user will easily hear it. 

Right now I am doing the following: I have all relevant notes saved as
WAV (like e. g. C5.wav, C#5.wav, D5.wav, ...) and when a melody is to be
played I call the program (not the library) sox like this:

runInteractiveCommand "sox --combine concatenate -q C5.wav E5.wav C5.wav
G5.wav E5. wav C5.wav -d"

This works on Linux (where I do my programming) as well as on Windows
(where people will use it). However, it does not seem quite elegant to
me and of course all those WAVs contribute to the download load. If
there was something like a "beep freq time"-command than I wouldn't have
that trouble: I would not have to ship those WAVs, would not have to
bundle sox to my prog, could play higher and lower sounds than what I
have now as WAVs... all of that.

Basically as this is about free software written in my spare time I am
free to choose to play a beep, to play a wav, to play a piano-like sound
or whatever, as long as it is easy to do and has little chance of
failing on whatever system configuration the end user will have. As I
said at the beginning: I am fairly new to haskell and want to
concentrate on learning haskell more than on learning sound programming
(for now).

Sorry for the long text - this is the background you were asking for.

Thanks for your advice,
Bernhard




_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to