Safe Haskell | None |
---|
Defines instance of CsdSco
for Score
.
We can trigger Csound orchestra with Score
.
How to put the values in the container Score
? There are many functions to construct the Score
.
They live in the module Temporal.Music.Score. If you are not familiar with it, you can start with six basic functions.
-
rest
-- makes a pause that lasts for some time (in seconds). -
temp
-- makes a score of one note that lasts for one second. -
mel
-- plays a list of notes in sequence (one after the other, short formelody
). -
har
-- plays a list of notes in parallel (at the same time, short forharmony
). -
del
-- delays all notes for some time (short fordelay
). -
str
-- change the tempo for all notes by the given ratio (short forstretch
).
Let's play something:
res = str 0.5 $ mel [ temp a, str 2 $ temp b, rest 1, har [temp a, temp b] ]
There are two handy infix operators for delay and stretch: (+|)
and (*|)
. So we can write the previous score:
res = 0.5 *| mel [ temp a, 2 *| temp b, 1 +| har [temp a, temp b] ]