
I'm looking for advice on generating sounds from a desktop app. I'm
perfectly happy if it doesn't have a GUI, but runs from the command line.
The desire is to take a config file for an embedded device that encodes
tunes it plays back and play them on the desktop. The data could be
represented as:
type Note = Integer
type Duration = Integer
data Tone = Tone Note Duration
newtype Tune = Tune [Tone]
[N.B. - I don't necessarily plan on using the above, I just wanted to
illustrate the types.
Now I just need to play back the resulting tune.
Looking through hackage and hoogle find a number of sound libraries, but
they either seem to be targeted at manipulating audio files and the data
therein, or dealing with midi events and associated devices. I suspect that
at least one of them can do what I want, but before I start delving into
one I'd like to know that it can do this with minimal extra code and pain.
So, anyone want to suggest a library for this task?
Thanks,

On Tue, Sep 15, 2015 at 2:23 PM, Mike Meyer
I'm looking for advice on generating sounds from a desktop app. I'm perfectly happy if it doesn't have a GUI, but runs from the command line.
http://hackage.haskell.org/package/csound-expression was recently updated (and announced in here). -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Or Supercollider! Which you can interact with with my "vivid" libarary or the "hsc3" library (both on hackage).
In vivid 0.1 (0.2 is coming soon but not out yet), you'd do something like
playTune :: Tune -> IO ()
playTune (Tune ts) = mapM_ playTone ts
playTone :: Tone -> IO ()
playTone (Tone note dur) = do
s <- play $ do
s0 <- sinOsc (Freq $ midiCPS note)
out 0 [s0, s0]
sleep dur
free s
(There may be a typo here; writing it on my phone)
I'm happy to answer any questions, too.
tom
El Sep 15, 2015, a las 14:36, Brandon Allbery
On Tue, Sep 15, 2015 at 2:23 PM, Mike Meyer
wrote: I'm looking for advice on generating sounds from a desktop app. I'm perfectly happy if it doesn't have a GUI, but runs from the command line.
http://hackage.haskell.org/package/csound-expression was recently updated (and announced in here).
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

If you decide to use my lib for desktop (csound-expression).
The examples can lead you to think that the audio
is generated with Haskell which is not so.
It requires the installation of csound command line utility.
The Haskell just generates the code for csound.
2015-09-15 21:23 GMT+03:00 Mike Meyer
I'm looking for advice on generating sounds from a desktop app. I'm perfectly happy if it doesn't have a GUI, but runs from the command line.
The desire is to take a config file for an embedded device that encodes tunes it plays back and play them on the desktop. The data could be represented as:
type Note = Integer type Duration = Integer data Tone = Tone Note Duration newtype Tune = Tune [Tone]
[N.B. - I don't necessarily plan on using the above, I just wanted to illustrate the types.
Now I just need to play back the resulting tune.
Looking through hackage and hoogle find a number of sound libraries, but they either seem to be targeted at manipulating audio files and the data therein, or dealing with midi events and associated devices. I suspect that at least one of them can do what I want, but before I start delving into one I'd like to know that it can do this with minimal extra code and pain.
So, anyone want to suggest a library for this task?
Thanks,
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
participants (4)
-
amindfv@gmail.com
-
Anton Kholomiov
-
Brandon Allbery
-
Mike Meyer