[Haskell-beginners] audio generation

Dennis Raddle dennis.raddle at gmail.com
Sat Apr 30 03:58:18 UTC 2016


I'm writing a program that will use functions to generate audio. The
Haskell code will write the audio samples to disk---no need for real time
playback. I see some useful libraries for writing audio files.

My question concerns efficiency when generating several million to 20
million samples (or even many times more than that if I use high-resolution
sampling rates). They can be generated one at a time in sequence, so
there's no need to occupy a lot of memory or postpone thunk evaluation. I'm
going to need efficient disk writing. Note that I may need some
pseudorandom numbers in my calculations, so I might want to calculate
samples by state monadic computations to carry the generator state. What is
my general strategy going to be for memory and time efficiency? I am pretty
confused by Haskell "strictness" and normal head form and all that, which
often doesn't seem to be very strict. Or bang patterns, etc. Is it going to
be simple to understand what I need?

Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160429/04d58512/attachment.html>


More information about the Beginners mailing list