[Haskell-cafe] [haskell art] the library of beautiful instruments implemented in haskell / csound

Anton Kholomiov anton.kholomiov at gmail.com
Wed Sep 16 07:05:35 UTC 2015


Alas there is no CsdSco typeclass anymore.
The original idea was to implement score type with
the most basic type and give the user a chance to write converters
and use score playing functionality by the class CsdSco.
But I've noticed that this approach was preventing me from using
advanced score structures (they are implemented in the separate package).
And type signatures become scary for the novice.
So I've settled down the type. It's like choosing between Prelude.List
ListLike.List. I've decided to pick the simplest one.

You can write your own converter to the `Sco` type.

````
type Sco a = Track
<http://hackage.haskell.org/package/temporal-media-0.6.0/docs/Temporal-Media.html#t:Track>
 D
<http://hackage.haskell.org/package/csound-expression-4.8.2/docs/Csound-Types.html#t:D>
 a
```

The `Track` comes from temporal-media package.
It's very easy to construct it from list of events.
One possible solution:

```
type Note = (Double, Double, a)

fromEvents :: [Note] -> Sco a
fromEvents = har . fmap f
     where f (start, duration, a) = del (double start) $ str (double
duration) $ temp a
```

Notice the need for converting to csound doubles (`D`s). The `har` is
parallel composition.
`del` is for delaying nd `str` is for stretching in time domain. `temp`
creates an event
that lasts for one seconds and starts right away.
I don't know your type, but I think it can be rendered to a list of notes.

Then you can plug the converter to the functions: `sco` or `atSco` (used
for patches).


Cheers,
Anton

2015-09-15 22:11 GMT+03:00 Edward Lilley <ejlilley at gmail.com>:

> Hi
>
> The most useful part of this (for me) is the ability to play midi-style
> instruments at arbitrary frequencies, so this looks great!
>
> To that end, I'm looking for the definition of the 'CsdSco' typeclass,
> as I want to write my own instance. It seems to be referenced in the
> csound-expression documentation, and once in a code comment, but is
> otherwise absent from the source. Indeed, installing temporal-csound
> from hackage fails with the error
>
> src/Csound.hs:135:10:
>     Not in scope: type constructor or class ‘CsdSco’
>
> Where do I find it?
>
> thanks,
> Edward
>
> Anton Kholomiov <anton.kholomiov at gmail.com> writes:
>
> > Status update for my haskell synth csound-expression. The main point is
> > presence of many cool instruments. They are implemented in the package
> > csound-catalog. All packages are compiled with GHC-7.10 So the hackage
> > fails to build them and unfortunately docs a broken too. But you can look
> > at the source code of the module Csound.Patch to now  the names of the
> > instruments. The usage is pretty straightforward. It's described here:
> >
> >
> https://github.com/spell-music/csound-expression/blob/master/tutorial/chapters/Patches.md
> >
> > There is an mp3 file to listen to the instruments.
> http://ge.tt/1jNETqN2/v/0
> >
> > *The 4.8.3 is out! New features:*
> >
> > This is a very important release to me. It tries to solve the problem
> > present in the most open source music-production libraries. It's often
> the
> > pack of beautiful sounds/timbres is missing. User is presented with many
> > audio primitives but no timbres are present to show the real power of the
> > framework. This release solves this problem. See the friend package
> > csound-catalog on Hackage. It defines 200+ beautiful instruments ready to
> > be used.
> >
> > The csound-expression defines a new type called Patch for description of
> an
> > instrument with a chain of effects. It's good place to start the journey
> to
> > the world of music production.
> >
> > There are new functions for synchronized reaction on events. The
> triggering
> > of events can be synchronized with given BPM.
> >
> > The library is updated for GHC-7.10!
> >
> >
> > github repo: https://github.com/spell-music/csound-expression
> >
> > hackage: http://hackage.haskell.org/package/csound-expression
> >
> >
> > Cheers!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150916/64c2d960/attachment.html>


More information about the Haskell-Cafe mailing list