spell-music / csound-expression

Haskell Framework for Electronic Music
320 stars 31 forks source link

(doc request) loops / all Tracks are finite? #54

Open jwaldmann opened 5 years ago

jwaldmann commented 5 years ago

I found that mel $ repeat ... does not work (it is type-correct, but it gives stack overflow)

mix $ sco (\ f -> return $ osc $ sig f ) $ mel $ repeat $ mel [ temp 300, rest 1 ]

On reason is implementation (mel uses foldl1, at least the default implementation does, https://github.com/spell-music/temporal-media/blob/master/src/Temporal/Class.hs#L24 ) but if I use

... foldr1 (+:+) $ repeat ...

it's still the same (stack overflow).

I guess that each Track Sig D object must have finite duration?

And this is because it can contain only a finite number of notes since they will be written to the csound expression?

Does csound have some "loop" operator? (we construct some finite object, and csound loops over it)