csound-expression 5.2.0 → 5.2.1
raw patch · 5 files changed
+248/−467 lines, 5 filesdep ~csound-expression-typedPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: csound-expression-typed
API changes (from Hackage documentation)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig4)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig6)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig8)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig4))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig6))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig4)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig6)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig8)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8)
- Csound.IO: instance Csound.IO.RenderCsd (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8)
- Csound.IO: instance Csound.IO.RenderCsd Csound.Typed.Types.Prim.Sig
- Csound.IO: instance Csound.IO.RenderCsd Csound.Typed.Types.Prim.Sig2
- Csound.IO: instance Csound.IO.RenderCsd Csound.Typed.Types.Prim.Sig4
- Csound.IO: instance Csound.IO.RenderCsd Csound.Typed.Types.Prim.Sig6
- Csound.IO: instance Csound.IO.RenderCsd Csound.Typed.Types.Prim.Sig8
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig3)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig4)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig5)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig6)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig8)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2)))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8)))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8)))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig3))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig4))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig5))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig6))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2, Csound.Typed.Types.Prim.Sig2))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8, Csound.Typed.Types.Prim.Sig8))
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig3)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig4)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig6)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source Csound.Typed.Types.Prim.Sig8)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Types.Prim.Sig)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Types.Prim.Sig2)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Types.Prim.Sig3)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Types.Prim.Sig4)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Types.Prim.Sig6)
- Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (a -> Csound.Typed.Types.Prim.Sig8)
+ Csound.IO: instance (Csound.Typed.Types.Tuple.Sigs a, Csound.Typed.Types.Tuple.Sigs b) => Csound.IO.RenderCsd (a -> Csound.Typed.GlobalState.SE.SE b)
+ Csound.IO: instance (Csound.Typed.Types.Tuple.Sigs a, Csound.Typed.Types.Tuple.Sigs b) => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE b))
+ Csound.IO: instance (Csound.Typed.Types.Tuple.Sigs a, Csound.Typed.Types.Tuple.Sigs b) => Csound.IO.RenderCsd (a -> Csound.Typed.Gui.Widget.Source b)
+ Csound.IO: instance (Csound.Typed.Types.Tuple.Sigs a, Csound.Typed.Types.Tuple.Sigs b) => Csound.IO.RenderCsd (a -> b)
+ Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (Csound.Typed.GlobalState.SE.SE a)
+ Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source (Csound.Typed.GlobalState.SE.SE a))
+ Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (Csound.Typed.Gui.Widget.Source a)
+ Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd a
+ Csound.Types: type Sig2_2 = (Sig2, Sig2)
+ Csound.Types: type Sig2_3 = (Sig2, Sig2, Sig2)
+ Csound.Types: type Sig2_4 = (Sig2, Sig2, Sig2, Sig2)
+ Csound.Types: type Sig2_5 = (Sig2, Sig2, Sig2, Sig2, Sig2)
+ Csound.Types: type Sig2_6 = (Sig2, Sig2, Sig2, Sig2, Sig2, Sig2)
+ Csound.Types: type Sig2_7 = (Sig2, Sig2, Sig2, Sig2, Sig2, Sig2, Sig2)
+ Csound.Types: type Sig2_8 = (Sig2, Sig2, Sig2, Sig2, Sig2, Sig2, Sig2, Sig2)
- Csound.Air.Fx.FxBox: chory' :: Sigs a => Sig -> a -> a
+ Csound.Air.Fx.FxBox: chory' :: Sig2s a => Sig -> a -> a
- Csound.Air.Fx.FxBox: chory1 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: chory1 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: chory2 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: chory2 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: chory3 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: chory3 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: chory4 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: chory4 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: chory5 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: chory5 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: oscPany' :: Sigs a => Sig -> a -> a
+ Csound.Air.Fx.FxBox: oscPany' :: Sig2s a => Sig -> a -> a
- Csound.Air.Fx.FxBox: oscPany1 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: oscPany1 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: oscPany2 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: oscPany2 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: oscPany3 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: oscPany3 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: oscPany4 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: oscPany4 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: oscPany5 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: oscPany5 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: pongy :: Sigs a => Balance -> DelayTime -> Feedback -> ToneSig -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy :: Sig2s a => Balance -> DelayTime -> Feedback -> ToneSig -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy1 :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy1 :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy1b :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy1b :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy1m :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy1m :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy2 :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy2 :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy2b :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy2b :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy2m :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy2m :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy3 :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy3 :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy3b :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy3b :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy3m :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy3m :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy4 :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy4 :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy4b :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy4b :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy4m :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy4m :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy5 :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy5 :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy5b :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy5b :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: pongy5m :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a
+ Csound.Air.Fx.FxBox: pongy5m :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a
- Csound.Air.Fx.FxBox: sqrPany' :: Sigs a => Sig -> a -> a
+ Csound.Air.Fx.FxBox: sqrPany' :: Sig2s a => Sig -> a -> a
- Csound.Air.Fx.FxBox: sqrPany1 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: sqrPany1 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: sqrPany2 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: sqrPany2 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: sqrPany3 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: sqrPany3 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: sqrPany4 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: sqrPany4 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: sqrPany5 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: sqrPany5 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: triPany' :: Sigs a => Sig -> a -> a
+ Csound.Air.Fx.FxBox: triPany' :: Sig2s a => Sig -> a -> a
- Csound.Air.Fx.FxBox: triPany1 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: triPany1 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: triPany2 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: triPany2 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: triPany3 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: triPany3 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: triPany4 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: triPany4 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: triPany5 :: Sigs a => a -> a
+ Csound.Air.Fx.FxBox: triPany5 :: Sig2s a => a -> a
- Csound.Air.Fx.FxBox: uiCave :: Sigs a => Double -> Source (Fx a)
+ Csound.Air.Fx.FxBox: uiCave :: Sig2s a => Double -> Source (Fx a)
- Csound.Air.Fx.FxBox: uiCave1 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiCave1 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiCave2 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiCave2 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiCave3 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiCave3 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiCave4 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiCave4 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiCave5 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiCave5 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChamber :: Sigs a => Double -> Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChamber :: Sig2s a => Double -> Source (Fx a)
- Csound.Air.Fx.FxBox: uiChamber1 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChamber1 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChamber2 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChamber2 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChamber3 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChamber3 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChamber4 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChamber4 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChamber5 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChamber5 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChory' :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChory' :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChory1 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChory1 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChory2 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChory2 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChory3 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChory3 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChory4 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChory4 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiChory5 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiChory5 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiHall :: Sigs a => Double -> Source (Fx a)
+ Csound.Air.Fx.FxBox: uiHall :: Sig2s a => Double -> Source (Fx a)
- Csound.Air.Fx.FxBox: uiHall1 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiHall1 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiHall2 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiHall2 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiHall3 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiHall3 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiHall4 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiHall4 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiHall5 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiHall5 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiRoom :: Sigs a => Double -> Source (Fx a)
+ Csound.Air.Fx.FxBox: uiRoom :: Sig2s a => Double -> Source (Fx a)
- Csound.Air.Fx.FxBox: uiRoom1 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiRoom1 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiRoom2 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiRoom2 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiRoom3 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiRoom3 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiRoom4 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiRoom4 :: Sig2s a => Source (Fx a)
- Csound.Air.Fx.FxBox: uiRoom5 :: Sigs a => Source (Fx a)
+ Csound.Air.Fx.FxBox: uiRoom5 :: Sig2s a => Source (Fx a)
- Csound.Types: class (Tuple a, Num a, Fractional a, SigSpace a, BindSig a, SigSpace2 a, BindSig2 a) => Sigs a
+ Csound.Types: class (Tuple a, Num a, Fractional a, SigSpace a, BindSig a) => Sigs a
Files
- csound-expression.cabal +21/−21
- src/Csound/Air/Fx/FxBox.hs +114/−114
- src/Csound/Air/Live.hs +45/−45
- src/Csound/IO.hs +40/−260
- src/Csound/Types.hs +28/−27
csound-expression.cabal view
@@ -1,5 +1,5 @@ Name: csound-expression-Version: 5.2.0+Version: 5.2.1 Cabal-Version: >= 1.6 License: BSD3 License-file: LICENSE@@ -11,15 +11,15 @@ Category: Music, Sound Maintainer: <anton.kholomiov@gmail.com> -Description: +Description: Welcome to the simplest textual synthesizer. . > dac $ osc 440 . Csound-expression is a Haskell framework for computer music.- With the help of the library we can create our instruments on the fly. + With the help of the library we can create our instruments on the fly. A few lines in the interpreter is enough to get the cool sound going- out of your speakers. It can be used for simple daily sound-file processing + out of your speakers. It can be used for simple daily sound-file processing or for a full-blown live performances. . Got interested? Check out the guide: <https://github.com/anton-k/csound-expression/blob/master/tutorial/Index.md>@@ -27,22 +27,22 @@ Acknowledgements (I'd like to mention those who supported me a lot with their music and ideas): . * music: entertainment for the braindead, three pandas and the moon, odno no, ann's'annat & alizbar, toe, iamthemorning, atoms for piece / radiohead, loscil, boards of canada,- Hozan Yamamoto, Tony Scott and Shinichi Yuize. + Hozan Yamamoto, Tony Scott and Shinichi Yuize. . * ideas: Conal Elliott, Oleg Kiselyov, Paul Hudak, Gabriel Gonzalez, Rich Hickey and Csound's community. * Thanks a lot to all who patiently answered my questions and provided skillful solutions, encouragement and ideas: . Iain McCurdy, Victor Lazzarini, Rory Walsh, Steven Yi, John Ffitch, Joachim Heintz, Peter Burgess, Dr. Richard Boulanger, Michael Gogins, Oeyvind Brandtsegg,- Richard Dobson, Partev Barr Sarkissian, Dave Phillips, Guillermo Senna, Art Hunkins, + Richard Dobson, Partev Barr Sarkissian, Dave Phillips, Guillermo Senna, Art Hunkins, Ben McAllister, Michael Rhoades, Gleb Rogozinsky, Eugene Cherny, Brian Merchant, Wolf Peuker, Hlöðver Sigurðsson, Aaron Krister Johnson, Andy Fillebrown and friends :)- -Extra-Source-Files : ++Extra-Source-Files : examples/README.txt- + examples/Test.hs examples/Heartbeat.hs- + examples/Color.hs examples/Gm.hs examples/Tibetan.hs@@ -53,10 +53,10 @@ examples/Events.hs examples/DubBass.hs - examples/Gui/Button.hs - examples/Gui/Harmonics.hs - examples/Gui/EnvelopeAndHarmonics.hs - examples/Gui/Key.hs + examples/Gui/Button.hs+ examples/Gui/Harmonics.hs+ examples/Gui/EnvelopeAndHarmonics.hs+ examples/Gui/Key.hs examples/Gui/Waves.hs examples/Api/message.py@@ -79,13 +79,13 @@ Ghc-Options: -Wall Build-Depends: base >= 4, base < 5, process, data-default, Boolean >= 0.1.0, colour >= 2.0, transformers >= 0.3, containers,- csound-expression-typed >= 0.2.0.0, csound-expression-dynamic >= 0.3.0, temporal-media >= 0.6.1,+ csound-expression-typed >= 0.2.0.1, csound-expression-dynamic >= 0.3.0, temporal-media >= 0.6.1, csound-expression-opcodes >= 0.0.3.2 Hs-Source-Dirs: src/ Exposed-Modules: Csound.Base - Csound.Air + Csound.Air Csound.Air.Wave Csound.Air.Wave.Sync Csound.Air.Granular@@ -105,9 +105,9 @@ Csound.Air.Misc Csound.Air.Hvs Csound.Air.Fm- Csound.Air.Pan - Csound.Air.Padsynth - + Csound.Air.Pan+ Csound.Air.Padsynth+ Csound.Types Csound.Tab Csound.SigSpace@@ -120,7 +120,7 @@ Csound.Control.Evt Csound.Control.Instr Csound.Control.SE- + Csound.Control.Midi Csound.Control.Sf Csound.Control.Osc@@ -136,4 +136,4 @@ Csound.Control.Overload Csound.Control.Overload.Outs Csound.Control.Overload.MidiInstr- Csound.Control.Overload.SpecInstr + Csound.Control.Overload.SpecInstr
src/Csound/Air/Fx/FxBox.hs view
@@ -15,7 +15,7 @@ -- *** Muted adele1m, adele2m, adele3m, adele4m, adele5m, - -- ** Ping Pong Delay + -- ** Ping Pong Delay pongy1, pongy2, pongy3, pongy4, pongy5, -- *** Bright@@ -57,17 +57,17 @@ triPany1, triPany2, triPany3, triPany4, triPany5, sqrPany',- sqrPany1, sqrPany2, sqrPany3, sqrPany4, sqrPany5, + sqrPany1, sqrPany2, sqrPany3, sqrPany4, sqrPany5, -- ** Tremolo oscTremy',- oscTremy1, oscTremy2, oscTremy3, oscTremy4, oscTremy5, + oscTremy1, oscTremy2, oscTremy3, oscTremy4, oscTremy5, triTremy',- triTremy1, triTremy2, triTremy3, triTremy4, triTremy5, + triTremy1, triTremy2, triTremy3, triTremy4, triTremy5, sqrTremy',- sqrTremy1, sqrTremy2, sqrTremy3, sqrTremy4, sqrTremy5, + sqrTremy1, sqrTremy2, sqrTremy3, sqrTremy4, sqrTremy5, -- ** Ring modulation ringo',@@ -78,7 +78,7 @@ -- -- Let's take a distortion fr instance: --- -- > type FxFun = Sig2 -> SE Sig2 + -- > type FxFun = Sig2 -> SE Sig2 -- > -- > uiTort2 :: Source FxFun --@@ -92,19 +92,19 @@ -- All these functions stack the effects in the list -- and align visuals. The visuals can be stacked horizontally, vertically -- or placed on a square grid.- -- + -- -- Let's create a chain of effects and apply it to the input signal: -- -- > > let pedals ain = lift1 (\f -> f ain) $ fxHor [uiFlan1, uiAdele2 0.25 0.5, uiHall 0.2, uiGain 0.4] -- > -- > > vdac $ pedals =<< (atMidi $ dryPatch vibraphone) --- -- With @uiGain@ we can change the volume of the output. + -- With @uiGain@ we can change the volume of the output. -- ** Reverb - -- *** Rooms + -- *** Rooms uiRoom, uiRoom1, uiRoom2, uiRoom3, uiRoom4, uiRoom5, -- ** Chambers@@ -118,7 +118,7 @@ -- ** Mono Reverb - -- *** Rooms + -- *** Rooms uiMonoRoom, uiRoom1m, uiRoom2m, uiRoom3m, uiRoom4m, uiRoom5m, -- ** Chambers@@ -138,7 +138,7 @@ -- ** Ping Pong Delay uiPongy1, uiPongy2, uiPongy3, uiPongy4, uiPongy5, uiPongy1b, uiPongy2b, uiPongy3b, uiPongy4b, uiPongy5b,- uiPongy1m, uiPongy2m, uiPongy3m, uiPongy4m, uiPongy5m, + uiPongy1m, uiPongy2m, uiPongy3m, uiPongy4m, uiPongy5m, -- ** Distortion uiTort1, uiTort2, uiTort3, uiTort4, uiTort5,@@ -177,12 +177,12 @@ uiCrusher, -- ** Ring modulation- uiRingo', uiRingo1, uiRingo2, uiRingo3, uiRingo4, uiRingo5 + uiRingo', uiRingo1, uiRingo2, uiRingo3, uiRingo4, uiRingo5 -- ** Compressor -- | TODO - + ) where import Data.Default@@ -194,13 +194,13 @@ import Csound.SigSpace import qualified Csound.Typed.Plugins as P(pitchShifterDelay,- fxAnalogDelay, fxDistortion, fxEnvelopeFollower, fxFlanger, fxFreqShifter, fxLoFi, + fxAnalogDelay, fxDistortion, fxEnvelopeFollower, fxFlanger, fxFreqShifter, fxLoFi, fxPanTrem, fxMonoTrem, fxPhaser, fxPitchShifter, fxReverse, fxRingModulator, fxChorus2) import Csound.Air.Patch(Fx, Fx1, Fx2)-import Csound.Air.Fx(Balance, DelayTime, Feedback, ToneSig, SensitivitySig, - BaseCps, Resonance, DepthSig, RateSig, TremWaveSig, FoldoverSig, BitsReductionSig, - DriveSig, TimeSig, WidthSig, +import Csound.Air.Fx(Balance, DelayTime, Feedback, ToneSig, SensitivitySig,+ BaseCps, Resonance, DepthSig, RateSig, TremWaveSig, FoldoverSig, BitsReductionSig,+ DriveSig, TimeSig, WidthSig, rever2, pingPong, pingPong', PingPongSpec(..)) import Csound.Air.Live(fxBox, fxColor)@@ -234,9 +234,9 @@ -- -- Note that the center frequency of the filter is measured in normalized units (form 0 to 1). tort :: Sigs a => DriveSig -> ToneSig -> a -> a-tort kdrive ktone = mapSig $ P.fxDistortion 1 kdrive ktone +tort kdrive ktone = mapSig $ P.fxDistortion 1 kdrive ktone --- | Envelope follower. +-- | Envelope follower. -- -- > fowler sensitivity baseFrequencyRatio resonance ain --@@ -260,9 +260,9 @@ -- | A flanger effect following the typical design of a so called 'stomp box'--- --- > flan rate depth delayTime feedback ain = --+-- > flan rate depth delayTime feedback ain =+-- -- Arguments -- -- * @rate @ -- rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)@@ -281,47 +281,47 @@ -- | Phaser -- -- An phase shifting effect that mimics the design of a so called 'stomp box'--- +-- -- > phasy rate depth freq fback ain--- +-- -- Arguments:--- +-- -- * @rate @ -- rate of lfo of the effect (range 0 to 1) -- -- * @depth @ -- depth of lfo of the effect (range 0 to 1) -- -- * @freq @ -- centre frequency of the phase shifting effect in octaves (suggested range 0 to 1) ----- * @fback @ -- feedback and therefore intensity of the effect (range 0 to 1) +-- * @fback @ -- feedback and therefore intensity of the effect (range 0 to 1) -- -- * @ain @ -- input audio to be pitch shifted phasy :: Sigs a => RateSig -> DepthSig -> BaseCps -> Feedback -> a -> a phasy krate kdepth cps kfback = mapSig $ P.fxPhaser krate kdepth (6 + 5 * cps) kfback -- | LoFi (Bit Crusher)--- +-- -- 'Low Fidelity' distorting effects of bit reduction and downsampling (foldover)--- +-- -- > crusher bits fold ain = ...--- +-- -- Arguments--- +-- -- * @bits @ -- bit depth reduction (range 0 to 1) ----- * @fold @ -- amount of foldover (range 0 to 1) +-- * @fold @ -- amount of foldover (range 0 to 1) -- -- * @ain @ -- input audio to have low fidelity distortion effects applied crusher :: Sigs a => BitsReductionSig -> FoldoverSig -> a -> a crusher kbits kfold = mapSig $ P.fxLoFi (0.6 * kbits) kfold -- | Stereo Chorus--- +-- -- A stereo chorus effect--- +-- -- > chory rate depth width (ainLeft, ainRight)--- +-- -- Arguments--- +-- -- * @rate @ -- rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1) -- -- * @depth @ -- depth of the lfo of the effect (range 0 to 1)@@ -334,11 +334,11 @@ -- | Auto pan--- +-- -- > pany wave rate depth ain--- +-- -- ; Arguments:--- +-- -- * @wave @ -- waveform used by the lfo (0=sine 1=triangle 2=square) -- -- * @rate @ -- rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)@@ -369,13 +369,13 @@ -- | Tremolo--- +-- -- tremolo effect--- +-- -- > tremy wave rate depth ain--- +-- -- ; Arguments:--- +-- -- * @wave @ -- waveform used by the lfo (0=sine 1=triangle 2=square) -- -- * @rate @ -- rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)@@ -409,11 +409,11 @@ type EnvelopeModSig = Sig -- | RingModulator--- +-- -- An ring modulating effect with an envelope follower--- +-- -- > ringo balance rate envelopeMod ain--- +-- -- * @balance @ -- dry / wet mix of the output signal (range 0 to 1) -- ; @rate @ -- frequency of thew ring modulator *NOT IN HERTZ* (range 0 to 1) -- ; @envelopeMod @ -- amount of dynamic envelope following modulation of frequency (range 0 to 1)@@ -467,17 +467,17 @@ -- | Ping-pong delay -- -- > pongy kmix delayTime feedback tone ain-pongy :: Sigs a => Balance -> DelayTime -> Feedback -> ToneSig -> WidthSig -> a -> a+pongy :: Sig2s a => Balance -> DelayTime -> Feedback -> ToneSig -> WidthSig -> a -> a pongy balance delTime fbk tone width = mapSig2 (pingPong' (def { pingPongDamp = absTone, pingPongWidth = width }) delTime fbk balance) where absTone = scale (expcurve tone 4) 12000 100 -pongyBy :: Sigs a => ToneSig -> Feedback -> Balance -> DelayTime -> WidthSig -> a -> a+pongyBy :: Sig2s a => ToneSig -> Feedback -> Balance -> DelayTime -> WidthSig -> a -> a pongyBy tone size balance delTime width = pongy balance delTime size tone width -pongyBy_ :: Sigs a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a+pongyBy_ :: Sig2s a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a pongyBy_ = pongyBy 0.5 -pongy1, pongy2, pongy3, pongy4, pongy5 :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a+pongy1, pongy2, pongy3, pongy4, pongy5 :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a pongy1 = pongyBy_ size1 pongy2 = pongyBy_ size2@@ -485,10 +485,10 @@ pongy4 = pongyBy_ size4 pongy5 = pongyBy_ size5 -pongyByB :: Sigs a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a+pongyByB :: Sig2s a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a pongyByB = pongyBy 0.8 -pongy1b, pongy2b, pongy3b, pongy4b, pongy5b :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a+pongy1b, pongy2b, pongy3b, pongy4b, pongy5b :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a pongy1b = pongyByB size1 pongy2b = pongyByB size2@@ -496,10 +496,10 @@ pongy4b = pongyByB size4 pongy5b = pongyByB size5 -pongyByM :: Sigs a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a+pongyByM :: Sig2s a => Feedback -> Balance -> DelayTime -> WidthSig -> a -> a pongyByM = pongyBy 0.2 -pongy1m, pongy2m, pongy3m, pongy4m, pongy5m :: Sigs a => Balance -> DelayTime -> WidthSig -> a -> a+pongy1m, pongy2m, pongy3m, pongy4m, pongy5m :: Sig2s a => Balance -> DelayTime -> WidthSig -> a -> a pongy1m = pongyByM size1 pongy2m = pongyByM size2@@ -588,10 +588,10 @@ -- Chorus -chory' :: Sigs a => Sig -> a -> a+chory' :: Sig2s a => Sig -> a -> a chory' size = mapSig2 (chory size size size) -chory1, chory2, chory3, chory4, chory5 :: Sigs a => a -> a+chory1, chory2, chory3, chory4, chory5 :: Sig2s a => a -> a chory1 = chory' size1 chory2 = chory' size2@@ -603,10 +603,10 @@ -- pany :: TremWaveSig -> DepthSig -> RateSig -> Sig2 -> Sig2 -oscPany' :: Sigs a => Sig -> a -> a+oscPany' :: Sig2s a => Sig -> a -> a oscPany' size = mapSig2 (oscPany size size) -oscPany1, oscPany2, oscPany3, oscPany4, oscPany5 :: Sigs a => a -> a+oscPany1, oscPany2, oscPany3, oscPany4, oscPany5 :: Sig2s a => a -> a oscPany1 = oscPany' size1 oscPany2 = oscPany' size2@@ -614,10 +614,10 @@ oscPany4 = oscPany' size4 oscPany5 = oscPany' size5 -triPany' :: Sigs a => Sig -> a -> a+triPany' :: Sig2s a => Sig -> a -> a triPany' size = mapSig2 (triPany size size) -triPany1, triPany2, triPany3, triPany4, triPany5 :: Sigs a => a -> a+triPany1, triPany2, triPany3, triPany4, triPany5 :: Sig2s a => a -> a triPany1 = triPany' size1 triPany2 = triPany' size2@@ -625,10 +625,10 @@ triPany4 = triPany' size4 triPany5 = triPany' size5 -sqrPany' :: Sigs a => Sig -> a -> a+sqrPany' :: Sig2s a => Sig -> a -> a sqrPany' size = mapSig2 (sqrPany size size) -sqrPany1, sqrPany2, sqrPany3, sqrPany4, sqrPany5 :: Sigs a => a -> a+sqrPany1, sqrPany2, sqrPany3, sqrPany4, sqrPany5 :: Sig2s a => a -> a sqrPany1 = sqrPany' size1 sqrPany2 = sqrPany' size2@@ -636,7 +636,7 @@ sqrPany4 = sqrPany' size4 sqrPany5 = sqrPany' size5 --- Tremolo +-- Tremolo oscTremy' :: Sigs a => Sig -> a -> a oscTremy' size = oscTremy size size@@ -686,7 +686,7 @@ ringo5 = ringo' size5 ------------------------------------------------------------- UI +-- UI setAll :: Double -> [String] -> [(String, Double)] setAll size names = fmap (\s -> (s, size)) names@@ -694,7 +694,7 @@ -- colors -tortColor = red +tortColor = red fowlerColor = maroon adeleColor = blue pongColor = orange@@ -706,7 +706,7 @@ panyColor = aqua tremyColor = green ringoColor = maroon-reverbColor = olive +reverbColor = olive paintTo = fxColor . C.sRGB24read @@ -728,7 +728,7 @@ uiAdeleBy :: Sigs a => Double -> Double -> Double -> Double -> Source (Fx a) uiAdeleBy initTone initFeedback initBalance initDelayTime = mapSource bindSig $ paintTo adeleColor $ fxBox "Delay" fx True [("balance", initBalance), ("del time", initDelayTime), ("fbk", initFeedback), ("tone", initTone)]- where + where fx [balance, delayTime, feedback, tone] = return . adele balance delayTime feedback tone uiAdeleBy_ :: Sigs a => Double -> Double -> Double -> Source (Fx a)@@ -768,7 +768,7 @@ uiPongyBy :: Sigs a => Double -> Double -> Double -> Double -> Double -> Source (Fx a) uiPongyBy initTone initWidth initFeedback initBalance initDelayTime = mapSource bindSig $ paintTo adeleColor $ fxBox "Ping-pong" fx True [("balance", initBalance), ("del time", initDelayTime), ("fbk", initFeedback), ("tone", initTone), ("width", initWidth)]- where + where fx [balance, delayTime, feedback, tone, width] = return . pongy balance delayTime feedback tone width defWidth = 0.7@@ -810,7 +810,7 @@ uiTortBy :: Sigs a => Double -> Double -> Source (Fx a) uiTortBy initTone initDrive = mapSource bindSig $ paintTo tortColor $ fxBox "Distort" fx True [("drive", initDrive), ("tone", initTone)]- where + where fx [drive, tone] = return . tort drive tone uiTortBy_ :: Sigs a => Double -> Source (Fx a)@@ -850,12 +850,12 @@ uiFowler' :: Sigs a => Source (Fx a) uiFowler' = mapSource bindSig $ paintTo fowlerColor $ fxBox "Follower" fx True [("size", size1)]- where + where fx [size] = return . fowler' size uiFowlerBy :: Sigs a => Double -> Source (Fx a) uiFowlerBy size = mapSource bindSig $ paintTo fowlerColor $ fxBox "Follower" fx True [("sense", size), ("freq", size), ("reson", size)]- where + where fx [sense, freq, resonance] = return . fowler sense freq resonance uiFowler1, uiFowler2, uiFowler3, uiFowler4, uiFowler5 :: Sigs a => Source (Fx a)@@ -870,12 +870,12 @@ uiFlan' :: Sigs a => Source (Fx a) uiFlan' = mapSource bindSig $ paintTo flanColor $ fxBox "Flanger" fx True [("size", size1)]- where + where fx [size] = return . flan' size uiFlanBy :: Sigs a => Double -> Source (Fx a) uiFlanBy size = mapSource bindSig $ paintTo flanColor $ fxBox "Flanger" fx True $ setAll size ["rate", "depth", "del time", "fbk"]- where + where fx [rate, depth, delayTime, fbk] = return . flan rate depth delayTime fbk uiFlan1, uiFlan2, uiFlan3, uiFlan4, uiFlan5 :: Sigs a => Source (Fx a)@@ -892,12 +892,12 @@ uiPhasy' :: Sigs a => Source (Fx a) uiPhasy' = mapSource bindSig $ paintTo phasyColor $ fxBox "Phaser" fx True $ [("size", size1)]- where + where fx [x] = return . phasy' x uiPhasyBy :: Sigs a => Double -> Source (Fx a) uiPhasyBy size = mapSource bindSig $ paintTo phasyColor $ fxBox "Phaser" fx True $ setAll size ["rate", "depth", "cps", "fbk"]- where + where fx [rate, depth, cps, fbk] = return . phasy rate depth cps fbk uiPhasy1, uiPhasy2, uiPhasy3, uiPhasy4, uiPhasy5 :: Sigs a => Source (Fx a)@@ -910,17 +910,17 @@ -- Chorus -uiChory' :: Sigs a => Source (Fx a)+uiChory' :: Sig2s a => Source (Fx a) uiChory' = paintTo choryColor $ fxBox "Chorus" fx True [("size", size1)]- where + where fx [size] = return . chory' size -uiChoryBy :: Sigs a => Double -> Source (Fx a)+uiChoryBy :: Sig2s a => Double -> Source (Fx a) uiChoryBy size = paintTo choryColor $ fxBox "Chorus" fx True $ setAll size ["rate", "depth", "width"]- where + where fx [rate, depth, width] = return . mapSig2 (chory rate depth width) -uiChory1, uiChory2, uiChory3, uiChory4, uiChory5 :: Sigs a => Source (Fx a)+uiChory1, uiChory2, uiChory3, uiChory4, uiChory5 :: Sig2s a => Source (Fx a) uiChory1 = uiChoryBy size1 uiChory2 = uiChoryBy size2@@ -934,18 +934,18 @@ genUiPany' :: (Sig -> Sig2 -> Sig2) -> Source Fx2 genUiPany' mkPany = paintTo panyColor $ fxBox "Pan" fx True [("size", size1)]- where + where fx [size] = return . mkPany size uiOscPany', uiTriPany', uiSqrPany' :: Source Fx2 -uiOscPany' = genUiPany' oscPany' +uiOscPany' = genUiPany' oscPany' uiTriPany' = genUiPany' triPany'-uiSqrPany' = genUiPany' sqrPany' +uiSqrPany' = genUiPany' sqrPany' genUiPanyBy :: Sig -> Double -> Source Fx2 genUiPanyBy wave size = paintTo panyColor $ fxBox "Pan" fx True $ setAll size ["depth", "rate"]- where + where fx [depth, rate] = return . pany wave depth rate uiOscPanyBy, uiTriPanyBy, uiSqrPanyBy :: Double -> Source Fx2@@ -976,11 +976,11 @@ uiSqrPany4 = uiSqrPanyBy size4 uiSqrPany5 = uiSqrPanyBy size5 --- Tremolo +-- Tremolo genUiTremy' :: Sigs a => (Sig -> Sig -> Sig) -> Source (Fx a) genUiTremy' mkTremy = mapSource bindSig $ paintTo tremyColor $ fxBox "Tremolo" fx True [("size", size1)]- where + where fx [size] = return . mkTremy size uiOscTremy', uiTriTremy', uiSqrTremy' :: Sigs a => Source (Fx a)@@ -991,7 +991,7 @@ genUiTremyBy :: Sigs a => Sig -> Double -> Source (Fx a) genUiTremyBy wave size = mapSource bindSig $ paintTo tremyColor $ fxBox "Tremolo" fx True $ setAll size ["depth", "rate"]- where + where fx [depth, rate] = return . tremy wave depth rate uiOscTremyBy, uiTriTremyBy, uiSqrTremyBy :: Sigs a => Double -> Source (Fx a)@@ -1026,12 +1026,12 @@ uiRingo' :: Sigs a => Source (Fx a) uiRingo' = mapSource bindSig $ paintTo ringoColor $ fxBox "Ringo" fx True [("size", size1)]- where + where fx [size] = return . ringo' size uiRingoBy :: Sigs a => Double -> Source (Fx a) uiRingoBy size = mapSource bindSig $ paintTo ringoColor $ fxBox "Ring Mod" fx True $ setAll size ["mix", "rate", "env mod"]- where + where fx [balance, rate, envMod] = return . ringo balance rate envMod uiRingo1, uiRingo2, uiRingo3, uiRingo4, uiRingo5 :: Sigs a => Source (Fx a)@@ -1046,39 +1046,39 @@ uiCrusher :: Sigs a => Double -> Double -> Source (Fx a) uiCrusher initReduction initFoldover = mapSource bindSig $ paintTo revsyColor $ fxBox "LoFi" fx True [("redux", initReduction), ("foldover", initFoldover)]- where + where fx [redux, foldover] = return . crusher redux foldover -- Reverse uiRevsy :: Sigs a => Double -> Source (Fx a) uiRevsy initTime = mapSource bindSig $ paintTo revsyColor $ fxBox "Reverse" fx True [("time", initTime)]- where + where fx [time] = return . revsy time --------------------------------------------------------------- Reverbs +-- Reverbs -uiRevBy :: Sigs a => Double -> Double -> Source (Fx a)+uiRevBy :: Sig2s a => Double -> Double -> Source (Fx a) uiRevBy initFeedback initMix = paintTo reverbColor $ fxBox "Reverb" fx True [("mix", initMix), ("fbk", initFeedback)]- where + where fx [balance, feedback] = \asig -> return $ mapSig2 (\x -> mul (1 - balance) x + mul balance (rever2 feedback x)) asig -uiRoom :: Sigs a => Double -> Source (Fx a)-uiRoom = uiRevBy 0.6 +uiRoom :: Sig2s a => Double -> Source (Fx a)+uiRoom = uiRevBy 0.6 -uiRoom1, uiRoom2, uiRoom3, uiRoom4, uiRoom5 :: Sigs a => Source (Fx a)+uiRoom1, uiRoom2, uiRoom3, uiRoom4, uiRoom5 :: Sig2s a => Source (Fx a) -uiRoom1 = uiRoom size1 -uiRoom2 = uiRoom size2 -uiRoom3 = uiRoom size3 -uiRoom4 = uiRoom size4 -uiRoom5 = uiRoom size5 +uiRoom1 = uiRoom size1+uiRoom2 = uiRoom size2+uiRoom3 = uiRoom size3+uiRoom4 = uiRoom size4+uiRoom5 = uiRoom size5 -uiChamber :: Sigs a => Double -> Source (Fx a)+uiChamber :: Sig2s a => Double -> Source (Fx a) uiChamber = uiRevBy 0.8 -uiChamber1, uiChamber2, uiChamber3, uiChamber4, uiChamber5 :: Sigs a => Source (Fx a)+uiChamber1, uiChamber2, uiChamber3, uiChamber4, uiChamber5 :: Sig2s a => Source (Fx a) uiChamber1 = uiChamber size1 uiChamber2 = uiChamber size2@@ -1086,10 +1086,10 @@ uiChamber4 = uiChamber size4 uiChamber5 = uiChamber size5 -uiHall :: Sigs a => Double -> Source (Fx a)+uiHall :: Sig2s a => Double -> Source (Fx a) uiHall = uiRevBy 0.9 -uiHall1, uiHall2, uiHall3, uiHall4, uiHall5 :: Sigs a => Source (Fx a)+uiHall1, uiHall2, uiHall3, uiHall4, uiHall5 :: Sig2s a => Source (Fx a) uiHall1 = uiHall size1 uiHall2 = uiHall size2@@ -1097,10 +1097,10 @@ uiHall4 = uiHall size4 uiHall5 = uiHall size5 -uiCave :: Sigs a => Double -> Source (Fx a)+uiCave :: Sig2s a => Double -> Source (Fx a) uiCave = uiRevBy 0.99 -uiCave1, uiCave2, uiCave3, uiCave4, uiCave5 :: Sigs a => Source (Fx a)+uiCave1, uiCave2, uiCave3, uiCave4, uiCave5 :: Sig2s a => Source (Fx a) uiCave1 = uiCave size1 uiCave2 = uiCave size2@@ -1109,26 +1109,26 @@ uiCave5 = uiCave size5 --------------------------------------------------------------- Mono Reverbs +-- Mono Reverbs rever1 :: Sig -> Sig -> Sig rever1 fbk = toMono . rever2 fbk . fromMono uiMonoRevBy :: Double -> Double -> Source Fx1 uiMonoRevBy initFeedback initMix = paintTo reverbColor $ fxBox "Reverb" fx True [("mix", initMix), ("fbk", initFeedback)]- where + where fx [balance, feedback] = \asig -> return $ mixAt balance (rever1 feedback) asig uiMonoRoom :: Double -> Source Fx1-uiMonoRoom = uiMonoRevBy 0.6 +uiMonoRoom = uiMonoRevBy 0.6 uiRoom1m, uiRoom2m, uiRoom3m, uiRoom4m, uiRoom5m :: Source Fx1 -uiRoom1m = uiMonoRoom size1 -uiRoom2m = uiMonoRoom size2 -uiRoom3m = uiMonoRoom size3 -uiRoom4m = uiMonoRoom size4 -uiRoom5m = uiMonoRoom size5 +uiRoom1m = uiMonoRoom size1+uiRoom2m = uiMonoRoom size2+uiRoom3m = uiMonoRoom size3+uiRoom4m = uiMonoRoom size4+uiRoom5m = uiMonoRoom size5 uiMonoChamber :: Double -> Source Fx1 uiMonoChamber = uiMonoRevBy 0.8
src/Csound/Air/Live.hs view
@@ -18,12 +18,12 @@ -- ** Fx units uiDistort, uiChorus, uiFlanger, uiPhaser, uiDelay, uiEcho, uiFilter, uiReverb, uiGain, uiCompress, uiWhite, uiPink, uiFx, uiDry,- uiSig, uiMix, uiMidi, + uiSig, uiMix, uiMidi, -- uiPatch, -- * Static widgets AdsrBound(..), AdsrInit(..),- linAdsr, expAdsr, + linAdsr, expAdsr, classicWaves, masterVolume, masterVolumeKnob ) where@@ -67,14 +67,14 @@ gMasterTag <- box "master" (gMaster, masterVol) <- defSlider ""- (gMasterMute, masterMute) <- toggleSig "" False - let g = parentGui $ zipWith3 (\tag slid mute -> childGui [sca 0.8 tag, sca 8 slid, sca 1.1 mute]) + (gMasterMute, masterMute) <- toggleSig "" False+ let g = parentGui $ zipWith3 (\tag slid mute -> childGui [sca 0.8 tag, sca 8 slid, sca 1.1 mute]) (gMasterTag : gTags) (gMaster : gs) (gMasterMute : gMutes) muteVols = zipWith appMute mutes vols masterMuteVol = appMute masterMute masterVol res <- fmap (mul masterMuteVol . mean) $ zipWithM (\v ain -> fmap (mul v) ain) muteVols sigs return (g, res)- where + where (names, sigs) = unzip as appMute mute vol = (port (1 - mute) 0.05) * vol @@ -95,7 +95,7 @@ -- -- > uiGain :: Double -> Source FxFun -- > uiGain isOn gain = fxBox "Gain" fx isOn [("gain", gain)]--- > where +-- > where -- > fx :: Sig -> Sig2 -> Sig2 -- > fx = mul --@@ -105,10 +105,10 @@ -- -- * @name@ -- is the name of the widget ----- * @fx@ -- is signal processing function (see the class @FxUI@). +-- * @fx@ -- is signal processing function (see the class @FxUI@). -- -- * @isOn@ -- whether widget in the active state--- +-- -- * @args@ -- list of initial values for arguments and names of the arguments. -- -- It's cool to set the color of the widget with @fxColor@ function.@@ -120,20 +120,20 @@ let gOff = setFontSize 25 gOff0 offRef <- newGlobalRef (0 :: Sig) writeRef offRef off- let (names, initVals) = unzip args - (gs, as) <- fmap unzip $ mapM (\(name, initVal) -> slider name (linSpan 0 1) initVal) $ zip names initVals + let (names, initVals) = unzip args+ (gs, as) <- fmap unzip $ mapM (\(name, initVal) -> slider name (linSpan 0 1) initVal) $ zip names initVals let f x = do ref <- newRef (0 :: a) goff <- readRef offRef- writeRef ref x + writeRef ref x when1 (goff ==* 1) $ do x2 <- readRef ref writeRef ref =<< fx as x2- res <- readRef ref - return res + res <- readRef ref+ return res let gui = setBorder UpBoxBorder $ go (length names) gOff gs return (gui, f)- where + where go n gOff gs | n == 0 = gOff | n < 4 = f (gs ++ replicate (4 - n) space)@@ -145,13 +145,13 @@ uiBox :: (Sigs a) => String -> Source (Fx a) -> Bool -> Source (Fx a) uiBox name fx onOff = mapGuiSource (setBorder UpBoxBorder) $ vlift2' uiOnOffSize uiBoxSize go off fx where- off = mapGuiSource (setFontSize 25) $ toggleSig name onOff + off = mapGuiSource (setFontSize 25) $ toggleSig name onOff go off fx arg = fmap (mul off) $ fx arg uiOnOffSize = 1.7 uiBoxSize = 8 -uiGroupGui :: Gui -> Gui -> Gui +uiGroupGui :: Gui -> Gui -> Gui uiGroupGui a b =ver [sca uiOnOffSize a, sca uiBoxSize b] sourceColor2 :: Color -> Source a -> Source a@@ -173,7 +173,7 @@ Nothing -> return $ (guiGroup $ gsA ++ gsB, fA >=> fB . fromMono) Just widget -> do (gBridge, fBridge) <- widget- return $ (guiGroup $ gsA ++ gBridge : gsB, fA >=> fBridge >=> fB) + return $ (guiGroup $ gsA ++ gBridge : gsB, fA >=> fBridge >=> fB) where getChain xs = do (gs, fs) <- fmap unzip $ sequence xs@@ -181,20 +181,20 @@ fxGroup :: ([Gui] -> Gui) -> [Source (Fx a)] -> Source (Fx a) fxGroup guiGroup as = do- (gs, fs) <- fmap unzip $ sequence as + (gs, fs) <- fmap unzip $ sequence as return (guiGroup gs, foldl (\a b -> a >=> b) return fs) -- | Scales the gui for signal processing widgets. fxSca :: Double -> Source (Fx a) -> Source (Fx a) fxSca d a = fxGroup (\xs -> sca d $ head xs) [a] --- | Groups the signal processing widgets. +-- | Groups the signal processing widgets. -- The functions are composed the visuals are -- grouped horizontally. fxHor :: [Source (Fx a)] -> Source (Fx a) fxHor = fxGroup hor --- | Groups the signal processing widgets. +-- | Groups the signal processing widgets. -- The functions are composed the visuals are -- grouped vertically. fxVer :: [Source (Fx a)] -> Source (Fx a)@@ -233,7 +233,7 @@ fxApply fx a = joinSource $ lift1 (\f -> f a) fx -- | Applies a function to a signal processing function.-fxMap :: Fx a -> Source (Fx a) -> Source (Fx a) +fxMap :: Fx a -> Source (Fx a) -> Source (Fx a) fxMap f = mapSource (>=> f) -- | Applies FX to the Patch.@@ -243,14 +243,14 @@ -- | The distortion widget. The arguments are -- -- > uiDistort isOn levelOfDistortion drive tone-uiDistort :: Sigs a => Bool -> Double -> Double -> Double -> Source (Fx a) -uiDistort isOn level drive tone = mapSource bindSig $ sourceColor2 C.red $ fxBox "Distortion" (\[level, drive, tone] -> return . fxDistort level drive tone) isOn +uiDistort :: Sigs a => Bool -> Double -> Double -> Double -> Source (Fx a)+uiDistort isOn level drive tone = mapSource bindSig $ sourceColor2 C.red $ fxBox "Distortion" (\[level, drive, tone] -> return . fxDistort level drive tone) isOn [("level", level), ("drive", drive), ("tone", tone)] -- | The chorus widget. The arguments are ----- > uiChorus isOn mix rate depth width +-- > uiChorus isOn mix rate depth width uiChorus :: Bool -> Double -> Double -> Double -> Double -> Source Fx2 uiChorus isOn mix rate depth width = sourceColor2 C.coral $ fxBox "Chorus" (\[mix, rate, depth, width] -> return . stChorus2 mix rate depth width) isOn [("mix",mix), ("rate",rate), ("depth",depth), ("width",width)]@@ -263,7 +263,7 @@ -- > uiFlanger isOn rate depth delay feedback uiFlanger :: Sigs a => Bool -> Double -> Double -> Double -> Double -> Source (Fx a) uiFlanger isOn rate depth delay fback = mapSource bindSig $ sourceColor2 C.indigo $ fxBox "Flanger" (\[fback, rate, depth, delay] -> return . fxFlanger fback rate depth delay) isOn- [("rate",rate), ("depth",depth), ("delay",delay), ("fback", fback)] + [("rate",rate), ("depth",depth), ("delay",delay), ("fback", fback)] -- | The phaser widget. The arguments are@@ -312,30 +312,30 @@ -- | The filtered white noize widget. The arguments are ----- > uiWhite isOn centerFreqOfFilter amountOfNoize +-- > uiWhite isOn centerFreqOfFilter amountOfNoize uiWhite :: Sigs a => Bool -> Double -> Double -> Source (Fx a)-uiWhite isOn freq depth = mapSource bindSig $ sourceColor2 C.dimgray $ fxBox "White" (\[freq, depth] -> fxWhite freq depth) isOn +uiWhite isOn freq depth = mapSource bindSig $ sourceColor2 C.dimgray $ fxBox "White" (\[freq, depth] -> fxWhite freq depth) isOn [("freq", freq), ("depth", depth)] -- | The filtered pink noize widget. The arguments are ----- > uiPink isOn centerFreqOfFilter amountOfNoize +-- > uiPink isOn centerFreqOfFilter amountOfNoize uiPink :: Sigs a => Bool -> Double -> Double -> Source (Fx a) uiPink isOn freq depth = mapSource bindSig $ sourceColor2 C.deeppink $ fxBox "Pink" (\[freq, depth] -> fxPink freq depth) isOn [("freq", freq), ("depth", depth)] -- | The constructor for signal processing functions with no arguments (controlls). uiFx :: Sigs a => String -> Fx a -> Bool -> Source (Fx a)-uiFx name f isOn = fxBox name (\[] -> f) isOn [] +uiFx name f isOn = fxBox name (\[] -> f) isOn [] -- | Midi chooser implemented as FX-box.-uiMidi :: (Sigs a) => [(String, Msg -> SE a)] -> Int -> Source (Fx a) +uiMidi :: (Sigs a) => [(String, Msg -> SE a)] -> Int -> Source (Fx a) uiMidi xs initVal = sourceColor2 C.forestgreen $ uiBox "Midi" fx True where fx = lift1 (\aout arg -> return $ aout + arg) $ vmidiChooser xs initVal {- -- | Patch chooser implemented as FX-box.-uiPatch :: [(String, Patch2)] -> Int -> Source FxFun +uiPatch :: [(String, Patch2)] -> Int -> Source FxFun uiPatch xs initVal = sourceColor2 C.forestgreen $ uiBox "Patch" fx True where fx = lift1 (\aout arg -> return $ aout + arg) $ vpatchChooser xs initVal -}@@ -345,8 +345,8 @@ uiSig name onOff widget = source $ do (gs, asig) <- widget (gOff0, off) <- toggleSig name onOff- let gOff = setFontSize 25 gOff0 - f x = return $ x + mul (portk off 0.05) asig + let gOff = setFontSize 25 gOff0+ f x = return $ x + mul (portk off 0.05) asig return (setBorder UpBoxBorder $ uiGroupGui gOff gs, f) -- | A mixer widget represented as an effect.@@ -382,7 +382,7 @@ genAdsr mkAdsr name b inits = source $ do (gatt, att) <- knob "A" (linSpan expEps $ attBound b) (attInit inits) (gdec, dec) <- knob "D" (linSpan expEps $ decBound b) (decInit inits)- (gsus, sus) <- knob "S" (linSpan expEps 1) (susInit inits) + (gsus, sus) <- knob "S" (linSpan expEps 1) (susInit inits) (grel, rel) <- knob "R" (linSpan expEps $ relBound b) (relInit inits) let val = mkAdsr (ir att) (ir dec) (ir sus) (ir rel) gui <- setTitle name $ hor [gatt, gdec, gsus, grel]@@ -391,7 +391,7 @@ -- | A widget with four standard waveforms: pure tone, triangle, square and sawtooth. -- The last parameter is a default waveform (it's set at init time). classicWaves :: String -> Int -> Source (Sig -> Sig)-classicWaves name initVal = funnyRadio name +classicWaves name initVal = funnyRadio name [ ("osc", osc) , ("tri", tri) , ("sqr", sqr)@@ -440,21 +440,21 @@ ---------------------------------------------------- -- effect choosers -hpatchChooser :: (SigSpace a, Sigs a) => [(String, Patch D a)] -> Int -> Source a +hpatchChooser :: (SigSpace a, Sigs a) => [(String, Patch D a)] -> Int -> Source a hpatchChooser = genPatchChooser hradioSig -vpatchChooser :: (SigSpace a, Sigs a) => [(String, Patch D a)] -> Int -> Source a +vpatchChooser :: (SigSpace a, Sigs a) => [(String, Patch D a)] -> Int -> Source a vpatchChooser = genPatchChooser vradioSig genPatchChooser :: (SigSpace a, Sigs a) => ([String] -> Int -> Source Sig) -> [(String, Patch D a)] -> Int -> Source a genPatchChooser widget xs initVal = joinSource $ lift1 go $ widget names initVal- where - (names, patches) = unzip xs + where+ (names, patches) = unzip xs go instrId = routeInstr fxs instrId =<< midi (routeInstr instrs instrId . ampCps) instrs = fmap patchInstr patches fxs = fmap getPatchFx patches- + -} @@ -465,13 +465,13 @@ -- -- > uiCompress thresh loknee hiknee ratio att rel gain uiCompress :: Sigs a => Double -> Double -> Double -> Double -> Double -> Double -> Double -> Source (Fx a)-uiCompress initThresh initLoknee initHiknee initRatio initAtt initRel initGain = mapSource bindSig $ paintTo orange $ fxBox "Compress" fx True +uiCompress initThresh initLoknee initHiknee initRatio initAtt initRel initGain = mapSource bindSig $ paintTo orange $ fxBox "Compress" fx True [("thresh", initThresh), ("loknee", initLoknee), ("hiknee", initHiknee), ("ratio", initRatio), ("att", initAtt), ("rel", initRel), ("gain", initGain)]- where - fx [thresh, loknee, hiknee, ratio, att, rel, gain] = return . fxCompress thresh (loknee, hiknee) ratio (att, rel) gain + where+ fx [thresh, loknee, hiknee, ratio, att, rel, gain] = return . fxCompress thresh (loknee, hiknee) ratio (att, rel) gain - paintTo = fxColor . C.sRGB24read + paintTo = fxColor . C.sRGB24read orange = "#FF851B" fromMonoFx :: Sigs a => (Sig -> Sig) -> Fx a-fromMonoFx f = \asig2 -> bindSig (return . f) asig2 +fromMonoFx f = \asig2 -> bindSig (return . f) asig2
src/Csound/IO.hs view
@@ -1,12 +1,12 @@-{-# Language FlexibleInstances #-}+{-# Language FlexibleInstances, UndecidableInstances #-} -- | Rendering of Csound files and playing the music in real time. ----- How are we going to get the sound out of Haskell code? --- Instruments are ready and we have written all the scores for them. +-- How are we going to get the sound out of Haskell code?+-- Instruments are ready and we have written all the scores for them. -- Now, it's time to use the rendering functions. We can render haskell expressions -- to Csound code. A rendering function takes a value that represents a sound (it's a tuple of signals)--- and produces a string with Csound code. It can take a value that represents --- the flags for the csound compiler and global settings ('Csound.Options'). +-- and produces a string with Csound code. It can take a value that represents+-- the flags for the csound compiler and global settings ('Csound.Options'). -- Then we can save this string to file and convert it to sound with csound compiler -- -- > csound -o music.wav music.csd@@ -19,16 +19,16 @@ -- -- The main function of this module is 'Csound.IO.renderCsdBy'. Other function are nothing but -- wrappers that produce the Csound code and make something useful with it (saving to file,--- playing with specific player or in real time). -module Csound.IO ( +-- playing with specific player or in real time).+module Csound.IO ( -- * Rendering RenderCsd(..),- renderCsd, - writeCsd, writeCsdBy, + renderCsd,+ writeCsd, writeCsdBy, writeSnd, writeSndBy,- + -- * Playing the sound- playCsd, playCsdBy, + playCsd, playCsdBy, mplayer, mplayerBy, totem, totemBy, -- * Live performance@@ -76,269 +76,50 @@ import Csound.Options(setSilent, setDac, setCabbage) render :: Sigs a => Options -> SE a -> IO String-render = renderOutBy +render = renderOutBy render_ :: Options -> SE () -> IO String-render_ = renderOutBy_ +render_ = renderOutBy_ class RenderCsd a where renderCsdBy :: Options -> a -> IO String -instance RenderCsd (SE ()) where+instance {-# OVERLAPPING #-} RenderCsd (SE ()) where renderCsdBy = render_ -instance RenderCsd Sig where- renderCsdBy opt a = render opt (return a)--instance RenderCsd Sig2 where- renderCsdBy opt a = render opt (return a)--instance RenderCsd Sig4 where- renderCsdBy opt a = render opt (return a)--instance RenderCsd (Sig2, Sig2) where- renderCsdBy opt a = render opt (return a)--instance RenderCsd Sig6 where- renderCsdBy opt a = render opt (return a)--instance RenderCsd (Sig2, Sig2, Sig2) where- renderCsdBy opt a = render opt (return a)--instance RenderCsd Sig8 where- renderCsdBy opt a = render opt (return a)--instance RenderCsd (Sig2, Sig2, Sig2, Sig2) where- renderCsdBy opt a = render opt (return a)--instance RenderCsd (Sig8, Sig8) where - renderCsdBy opt a = render opt (return a)--instance RenderCsd (Sig8, Sig8, Sig8, Sig8) where +instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd a where renderCsdBy opt a = render opt (return a) -instance RenderCsd (SE Sig) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE Sig2) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE Sig4) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE (Sig2, Sig2)) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE Sig6) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE (Sig2, Sig2, Sig2)) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE Sig8) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE (Sig2, Sig2, Sig2, Sig2)) where- renderCsdBy opt a = render opt a--instance RenderCsd (SE (Sig8, Sig8)) where - renderCsdBy opt a = render opt a--instance RenderCsd (SE (Sig8, Sig8, Sig8, Sig8)) where +instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd (SE a) where renderCsdBy opt a = render opt a -instance (Sigs a) => RenderCsd (a -> Sig) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> Sig2) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> Sig3) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> Sig4) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> (Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> Sig6) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> (Sig2, Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> Sig8) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> (Sig2, Sig2, Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> (Sig8, Sig8)) where- renderCsdBy opt f = renderEffBy opt (return . f)--instance (Sigs a) => RenderCsd (a -> (Sig8, Sig8, Sig8, Sig8)) where+instance {-# OVERLAPPABLE #-} (Sigs a, Sigs b) => RenderCsd (a -> b) where renderCsdBy opt f = renderEffBy opt (return . f) -instance (Sigs a) => RenderCsd (a -> SE Sig) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE Sig2) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE Sig3) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE Sig4) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE Sig5) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE Sig6) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE (Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE (Sig2, Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE Sig8) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE (Sig2, Sig2, Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE (Sig8, Sig8)) where- renderCsdBy opt f = renderEffBy opt f--instance (Sigs a) => RenderCsd (a -> SE (Sig8, Sig8, Sig8, Sig8)) where+instance {-# OVERLAPPABLE #-} (Sigs a, Sigs b) => RenderCsd (a -> SE b) where renderCsdBy opt f = renderEffBy opt f -instance (Sigs a) => RenderCsd (a -> Source Sig) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source Sig2) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source Sig3) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source Sig4) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source (Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source Sig6) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source (Sig2, Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source Sig8) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source (Sig2, Sig2, Sig2, Sig2)) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source (Sig8, Sig8)) where- renderCsdBy opt f = renderEffBy opt (fromSource . f)--instance (Sigs a) => RenderCsd (a -> Source (Sig8, Sig8, Sig8, Sig8)) where+instance {-# OVERLAPPABLE #-} (Sigs a, Sigs b) => RenderCsd (a -> Source b) where renderCsdBy opt f = renderEffBy opt (fromSource . f) -instance (Sigs a) => RenderCsd (a -> Source (SE Sig)) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE Sig2)) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE Sig3)) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE Sig4)) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE Sig5)) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE Sig6)) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE (Sig2, Sig2))) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE (Sig2, Sig2, Sig2))) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE Sig8)) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE (Sig2, Sig2, Sig2, Sig2))) where- renderCsdBy opt f = renderEffBy opt (fromSourceSE . f)--instance (Sigs a) => RenderCsd (a -> Source (SE (Sig8, Sig8))) where+instance (Sigs a, Sigs b) => RenderCsd (a -> Source (SE b)) where renderCsdBy opt f = renderEffBy opt (fromSourceSE . f) -instance (Sigs a) => RenderCsd (a -> Source (SE (Sig8, Sig8, Sig8, Sig8))) where+instance {-# OVERLAPPING #-} (Sigs a) => RenderCsd (a -> Source (SE Sig2)) where renderCsdBy opt f = renderEffBy opt (fromSourceSE . f) -instance RenderCsd (Source Sig) where- renderCsdBy opt a = renderCsdBy opt (fromSource a)--instance RenderCsd (Source Sig2) where- renderCsdBy opt a = renderCsdBy opt (fromSource a)--instance RenderCsd (Source Sig4) where- renderCsdBy opt a = renderCsdBy opt (fromSource a)--instance RenderCsd (Source (Sig2, Sig2)) where- renderCsdBy opt a = renderCsdBy opt $ mapSource (\((a1, a2), (b1, b2)) -> (a1, a2, b1, b2)) a--instance RenderCsd (Source Sig6) where- renderCsdBy opt a = renderCsdBy opt (fromSource a)--instance RenderCsd (Source (Sig2, Sig2, Sig2)) where- renderCsdBy opt a = renderCsdBy opt $ mapSource (\((a1, a2), (b1, b2), (c1, c2)) -> (a1, a2, b1, b2, c1, c2)) a--instance RenderCsd (Source Sig8) where+instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd (Source a) where renderCsdBy opt a = renderCsdBy opt (fromSource a) -instance RenderCsd (Source (Sig2, Sig2, Sig2, Sig2)) where- renderCsdBy opt a = renderCsdBy opt $ mapSource (\((a1, a2), (b1, b2), (c1, c2), (d1, d2)) -> (a1, a2, b1, b2, c1, c2, d1, d2)) a--instance RenderCsd (Source (SE Sig)) where- renderCsdBy opt a = renderCsdBy opt (fromSourceSE a)--instance RenderCsd (Source (SE Sig2)) where- renderCsdBy opt a = renderCsdBy opt (fromSourceSE a)--instance RenderCsd (Source (SE Sig4)) where- renderCsdBy opt a = renderCsdBy opt (fromSourceSE a)--instance RenderCsd (Source (SE (Sig2, Sig2))) where- renderCsdBy opt a = renderCsdBy opt $ mapSource (fmap $ \((a1, a2), (b1, b2)) -> (a1, a2, b1, b2)) a--instance RenderCsd (Source (SE Sig6)) where- renderCsdBy opt a = renderCsdBy opt (fromSourceSE a)--instance RenderCsd (Source (SE (Sig2, Sig2, Sig2))) where- renderCsdBy opt a = renderCsdBy opt $ mapSource (fmap $ \((a1, a2), (b1, b2), (c1, c2)) -> (a1, a2, b1, b2, c1, c2)) a--instance RenderCsd (Source (SE Sig8)) where+instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd (Source (SE a)) where renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) -instance RenderCsd (Source (SE (Sig2, Sig2, Sig2, Sig2))) where- renderCsdBy opt a = renderCsdBy opt $ mapSource (fmap $ \((a1, a2), (b1, b2), (c1, c2), (d1, d2)) -> (a1, a2, b1, b2, c1, c2, d1, d2)) a--instance RenderCsd (Source ()) where+instance {-# OVERLAPPING #-} RenderCsd (Source ()) where renderCsdBy opt src = renderCsdBy opt $ do- (ui, _) <- src + (ui, _) <- src panel ui -instance RenderCsd (Source (SE ())) where+instance {-# OVERLAPPING #-} RenderCsd (Source (SE ())) where renderCsdBy opt src = renderCsdBy opt (joinSource src) -- | Renders Csound file.@@ -362,12 +143,12 @@ writeSndBy opt file a = do writeCsdBy opt fileCsd a runWithUserInterrupt $ "csound -o " ++ file ++ " " ++ fileCsd- where fileCsd = "tmp.csd" + where fileCsd = "tmp.csd" -- | Renders Csound file, saves it to the given file, renders with csound command and plays it with the given program.--- --- > playCsd program file csd --+-- > playCsd program file csd+-- -- Produces files @file.csd@ (with 'Csound.Render.Mix.renderCsd') and @file.wav@ (with @csound@) and then invokes: -- -- > program "file.wav"@@ -382,7 +163,7 @@ player fileWav return () where fileCsd = file ++ ".csd"- fileWav = file ++ ".wav" + fileWav = file ++ ".wav" simplePlayCsdBy :: (RenderCsd a) => Options -> String -> String -> a -> IO () simplePlayCsdBy opt player = playCsdBy opt phi@@ -398,18 +179,18 @@ dacBy :: (RenderCsd a) => Options -> a -> IO () dacBy opt' a = do writeCsdBy opt "tmp.csd" a- runWithUserInterrupt $ "csound " ++ "tmp.csd" + runWithUserInterrupt $ "csound " ++ "tmp.csd" where opt = opt' <> setDac -- | Output to dac with virtual midi keyboard. vdac :: (RenderCsd a) => a -> IO ()-vdac = dacBy (setVirtual def) +vdac = dacBy (setVirtual def) -- | Output to dac with virtual midi keyboard with specified options. vdacBy :: (RenderCsd a) => Options -> a -> IO ()-vdacBy opt = dacBy (setVirtual opt) +vdacBy opt = dacBy (setVirtual opt) -setVirtual :: Options -> Options +setVirtual :: Options -> Options setVirtual a = a { csdFlags = (csdFlags a) { rtmidi = Just VirtualMidi, midiRT = m { midiDevice = Just "0" } } } where m = midiRT $ csdFlags a @@ -421,8 +202,7 @@ csdBy :: (RenderCsd a) => Options -> a -> IO () csdBy options a = do writeCsdBy (setSilent <> options) "tmp.csd" a- runWithUserInterrupt $ "csound tmp.csd" -+ runWithUserInterrupt $ "csound tmp.csd" ---------------------------------------------------------- -- players@@ -452,23 +232,23 @@ E.catch (waitForProcess pid >> return ()) (onUserInterrupt pid) where onUserInterrupt :: ProcessHandle -> E.AsyncException -> IO ()- onUserInterrupt pid x = case x of + onUserInterrupt pid x = case x of E.UserInterrupt -> terminateProcess pid >> E.throw x e -> E.throw e ---------------------------------------------------------- --- | Runs the csound files with cabbage engine. +-- | Runs the csound files with cabbage engine. -- It invokes the Cabbage command line utility and setts all default cabbage flags. runCabbage :: (RenderCsd a) => a -> IO () runCabbage = runCabbageBy def --- | Runs the csound files with cabbage engine with user defined options. +-- | Runs the csound files with cabbage engine with user defined options. -- It invokes the Cabbage command line utility and setts all default cabbage flags. runCabbageBy :: (RenderCsd a) => Options -> a -> IO () runCabbageBy opt' a = do writeCsdBy opt "tmp.csd" a- runWithUserInterrupt $ "Cabbage " ++ "tmp.csd" + runWithUserInterrupt $ "Cabbage " ++ "tmp.csd" where opt = opt' <> setCabbage ------------------------------@@ -491,4 +271,4 @@ -- | Alias to process inputs of audio-card with 8 inputs. onCard8 :: (Sig8 -> a) -> (Sig8 -> a)-onCard8= id +onCard8= id
src/Csound/Types.hs view
@@ -12,22 +12,23 @@ -- -- * @Spec@ and @Wspec@ - sound spectrums ----- A signal is a stream of numbers. Signals carry sound or time varied +-- A signal is a stream of numbers. Signals carry sound or time varied -- control values. Numbers are constants. 1-dimensional arrays contain some useful -- data which is calculated at the initial run of the program. -- -- There is only one compound type. It's a tuple of Csound values. The empty tuple--- is signified with special type called @Unit@. +-- is signified with special type called @Unit@. -- module Csound.Types(- -- * Primitive types - Sig, D, Tab, Str, Spec, Wspec, - BoolSig, BoolD, Val(..), SigOrD, + -- * Primitive types+ Sig, D, Tab, Str, Spec, Wspec,+ BoolSig, BoolD, Val(..), SigOrD, Sig2, Sig3, Sig4, Sig5, Sig6, Sig8,+ Sig2_2, Sig2_3, Sig2_4, Sig2_5, Sig2_6, Sig2_7, Sig2_8, -- ** Constructors- double, int, text, - + double, int, text,+ -- ** Constants idur, getSampleRate, getControlRate, getBlockSize, @@ -35,33 +36,33 @@ ar, kr, ir, sig, -- ** Init values- withInits, withDs, withSigs, withTabs, + withInits, withDs, withSigs, withTabs, withD, withSig, withTab, withSeed, -- ** Numeric functions- quot', rem', div', mod', ceil', floor', round', int', frac', - + quot', rem', div', mod', ceil', floor', round', int', frac',+ -- ** Logic functions boolSig, when1, whens, whenElse, whenD1, whenDs, whileDo, untilDo, whileDoD, untilDoD, whenElseD, compareWhenD, equalsTo, notEqualsTo, lessThan, greaterThan, lessThanEquals, greaterThanEquals, - -- ** Aliases + -- ** Aliases -- | Handy for functions that return tuples to specify the utput type -- -- > (aleft, aright) = ar2 $ diskin2 "file.wav" 1- -- + -- -- or --- -- > asig = ar1 $ diskin2 "file.wav" 1 + -- > asig = ar1 $ diskin2 "file.wav" 1 ar1, ar2, ar4, ar6, ar8, -- * Tuples Tuple(..), makeTupleMethods, Unit, unit, atTuple, -- *** Logic functions- ifTuple, guardedTuple, caseTuple, - - -- * Instruments + ifTuple, guardedTuple, caseTuple, + -- * Instruments+ -- | An instrument is a function that takes a tpule of csound values as an argument -- and returns a tuple of signals as an output. The type of the instrument is: --@@ -70,7 +71,7 @@ -- ** Arguments Arg, atArg, -- *** Logic functions- ifArg, guardedArg, caseArg, + ifArg, guardedArg, caseArg, -- ** Monophonic arguments MonoArg(..), MonoAdsr, adsrMonoSynt, monoAdsr,@@ -79,11 +80,11 @@ Sigs, -- * Arrays- Arr, newLocalArr, newGlobalArr, newLocalCtrlArr, newGlobalCtrlArr, + Arr, newLocalArr, newGlobalArr, newLocalCtrlArr, newGlobalCtrlArr, writeArr, readArr, modifyArr, mixArr, -- ** Type inference helpers Arr1, DArr1, Arr2, DArr2, Arr3, DArr3,- arr1, darr1, arr2, darr2, arr3, darr3, + arr1, darr1, arr2, darr2, arr3, darr3, -- ** Traverse and fold foreachArr, foreachArrD, forRowArr, forColumnArr, forRowArrD, forColumnArrD,@@ -91,20 +92,20 @@ -- ** Array opcodes fillLocalArr, fillGlobalArr, fillLocalCtrlArr, fillGlobalCtrlArr,- maparrayNew, lenarray, copyf2array, copya2ftab, minarray, maxarray, sumarray, + maparrayNew, lenarray, copyf2array, copya2ftab, minarray, maxarray, sumarray, scalearray, slicearrayNew, maparrayCopy, slicearrayCopy, -- ** Spectral opcodes- SpecArr, + SpecArr, - fftNew, fftinvNew, rfftNew, rifftNew, pvs2tab, tab2pvs, cmplxprodNew, - rect2polNew, pol2rectNew, pol2rect2New, windowArrayNew, + fftNew, fftinvNew, rfftNew, rifftNew, pvs2tab, tab2pvs, cmplxprodNew,+ rect2polNew, pol2rectNew, pol2rect2New, windowArrayNew, r2cNew, c2rNew, magsArrayNew, phsArrayNew, - fftCopy, fftinvCopy, rfftCopy, rifftCopy, cmplxprodCopy, - rect2polCopy, pol2rectCopy, pol2rect2Copy, windowArrayCopy, + fftCopy, fftinvCopy, rfftCopy, rifftCopy, cmplxprodCopy,+ rect2polCopy, pol2rectCopy, pol2rect2Copy, windowArrayCopy, r2cCopy, c2rCopy, magsArrayCopy, phsArrayCopy ) where @@ -125,14 +126,14 @@ whenElseD :: BoolD -> SE () -> SE () -> SE () whenElseD cond ifDo elseDo = whenDs [(cond, ifDo)] elseDo -whenElse :: BoolSig -> SE () -> SE () -> SE () +whenElse :: BoolSig -> SE () -> SE () -> SE () whenElse cond ifDo elseDo = whens [(cond, ifDo)] elseDo -- | Performs tree search f the first argument lies within the interval it performs the corresponding procedure. compareWhenD :: D -> [(D, SE ())] -> SE () compareWhenD val conds = case conds of [] -> return ()- [(cond, ifDo)] -> ifDo + [(cond, ifDo)] -> ifDo (cond1, do1):(cond2, do2): [] -> whenElseD (val `lessThan` cond1) do1 do2 _ -> whenElseD (val `lessThan` rootCond) (compareWhenD val less) (compareWhenD val more) where