haskore-supercollider-0.1.2.2: Haskore back-end for SuperCollider

Haskore.Interface.SuperCollider.SoundMap

Contents

Description

This module is quite specific to Haskore.Music.Rhythmic. Maybe the module name should reflect this?

Synopsis

Generic definitions

type Attribute = DoubleSource

Attribute means an optional information for a note. Compare with InstrumentParameters.

type ToSound instr = instr -> (AttributeList, Name)Source

Generic sound maps

with0Attributes :: (() -> AttributeList, sound -> sound)Source

with1Attribute :: (Attribute -> AttributeList, (UGen -> sound) -> sound)Source

with2Attributes :: ((Attribute, Attribute) -> AttributeList, (UGen -> UGen -> sound) -> sound)Source

type Table params sound = [(sound, Sound params)]Source

type TableWithAttributes params sound = [Assign params sound]Source

type TableWithChannels params sound = [(Channel, Assign params sound)]Source

type Sound params = params -> UGenSource

data Assign params sound Source

Constructors

Assign Name (sound -> Maybe AttributeList) (Sound params) 

lookup :: TableWithAttributes params sound -> ToSound soundSource

assignGeneric :: (attributeTuple -> AttributeList, soundGen -> Sound params) -> Name -> (sound -> Maybe attributeTuple) -> soundGen -> Assign params soundSource

assign :: Name -> (sound -> Maybe ()) -> Sound params -> Assign params soundSource

assignEq :: Eq sound => Name -> sound -> Sound params -> Assign params soundSource

assign1 :: Name -> (sound -> Maybe Attribute) -> (UGen -> Sound params) -> Assign params soundSource

assign2 :: Name -> (sound -> Maybe (Attribute, Attribute)) -> (UGen -> UGen -> Sound params) -> Assign params soundSource

assign3 :: Name -> (sound -> Maybe (Attribute, Attribute, Attribute)) -> (UGen -> UGen -> UGen -> Sound params) -> Assign params soundSource

assign4 :: Name -> (sound -> Maybe (Attribute, Attribute, Attribute, Attribute)) -> (UGen -> UGen -> UGen -> UGen -> Sound params) -> Assign params soundSource

withDuration :: (UGen -> Sound params) -> Sound paramsSource

Instrument maps

data InstrumentParameters Source

Parameter means an obligatory information for a note, like frequency, velocity, duration. Compare with Attribute.

Drum maps

Sound Maps with Channel management

newtype ChannelMap drum instr Source

Like a State+Writer monad with the binding operation baked into registerInstrument. This way we can suppress ignoring of results of registerInstrument, which is easily possible with 'do' notation.

registerSound :: params -> ((Channel, Assign params sound) -> (DrumTableWithChannels drum, InstrumentTableWithChannels instr) -> (DrumTableWithChannels drum, InstrumentTableWithChannels instr)) -> Assign params sound -> (UGen -> ChannelMap drum instr) -> ChannelMap drum instrSource

registerInstrument :: InstrumentAssign instr -> (UGen -> ChannelMap drum instr) -> ChannelMap drum instrSource

registerDrum :: DrumAssign drum -> (UGen -> ChannelMap drum instr) -> ChannelMap drum instrSource