<div dir="ltr">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. <div><br></div><div>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? </div><div><br></div><div>Dennis</div><div><br></div></div>