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

Safe HaskellNone
LanguageHaskell98

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 = Double Source

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 -> UGen Source

data Assign params sound Source

Constructors

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

lookup :: TableWithAttributes params sound -> ToSound sound Source

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

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

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

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

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

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

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

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

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 instr Source

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

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