[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player

Subject: Re: [Haskell-cafe] ANN: Hemkay, the 100% Haskell MOD player
From: "Patai Gergely"
Date: Thu, 17 Dec 2009 12:05:15 +0100
Hello again,

> Your message has motivated me to publish my own PortAudio binding,
> which provides a simpler, more efficient callback-based interface:
> http://github.com/mietek/portaudio
I tried this, and after rewriting the code a bit, I managed to decrease
CPU load by 70-80%, which is not bad for starters. However, I'm getting
random segfaults, and I've no idea why.

Here's the modified player module (hpaste kindly rearranged the empty
lines for some reason):

http://hpaste.org/fastcgi/hpaste.fcgi/view?id=14347

Instead of building a list of samples right away, I use an unfoldr-style
generator to fill the buffer, whose initial state is created by
mixGenerator, and its stepper function is nextSample.

In order to get this working, I renamed your module to avoid conflict
with the other PortAudio binding, and I had to change the dependencies
in the cabal file to base >= 4 && < 5 because of the exception handling
code.

There's also some broken MVar-based code to handle the end of the song,
you can ignore that for the time being.

Gergely

-- 
http://www.fastmail.fm - The professional email service

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>