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. -
line
-- plays a list of notes in sequence (one after the other). -
chord
-- plays a list of notes in parallel (at the same time). -
delay
-- delays all notes for some time. -
stretch
-- change the tempo for all notes by the given ratio.
Let's play something:
res = stretch 0.5 $ line [ temp a, stretch 2 $ temp b, rest 1, chord [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 *| line [ temp a, 2 *| temp b, 1 +| chord [temp a, temp b] ]