Safe Haskell | None |
---|---|
Language | Haskell98 |
This module is quite specific to Haskore.Music.Rhythmic. Maybe the module name should reflect this?
- type Name = String
- type Attribute = Double
- type AttributeList = [Attribute]
- type ToSound instr = instr -> (AttributeList, Name)
- attributeControl :: Int -> UGen
- attributeName :: Int -> String
- attributeNames :: [String]
- control :: String -> UGen
- pitchName :: String
- velocityName :: String
- durationName :: String
- with0Attributes :: (() -> AttributeList, sound -> sound)
- with1Attribute :: (Attribute -> AttributeList, (UGen -> sound) -> sound)
- with2Attributes :: ((Attribute, Attribute) -> AttributeList, (UGen -> UGen -> sound) -> sound)
- with3Attributes :: ((Attribute, Attribute, Attribute) -> AttributeList, (UGen -> UGen -> UGen -> sound) -> sound)
- with4Attributes :: ((Attribute, Attribute, Attribute, Attribute) -> AttributeList, (UGen -> UGen -> UGen -> UGen -> sound) -> sound)
- type Table params sound = [(sound, Sound params)]
- type TableWithAttributes params sound = [Assign params sound]
- type TableWithChannels params sound = [(Channel, Assign params sound)]
- type Sound params = params -> UGen
- class SoundParameters params where
- soundParameters :: params
- ugenFromSound :: SoundParameters params => Sound params -> UGen
- data Assign params sound = Assign Name (sound -> Maybe AttributeList) (Sound params)
- lookup :: TableWithAttributes params sound -> ToSound sound
- assignGeneric :: (attributeTuple -> AttributeList, soundGen -> Sound params) -> Name -> (sound -> Maybe attributeTuple) -> soundGen -> Assign params sound
- assign :: Name -> (sound -> Maybe ()) -> Sound params -> Assign params sound
- assignEq :: Eq sound => Name -> sound -> Sound params -> Assign params sound
- assign1 :: Name -> (sound -> Maybe Attribute) -> (UGen -> Sound params) -> Assign params sound
- assign2 :: Name -> (sound -> Maybe (Attribute, Attribute)) -> (UGen -> UGen -> Sound params) -> Assign params sound
- assign3 :: Name -> (sound -> Maybe (Attribute, Attribute, Attribute)) -> (UGen -> UGen -> UGen -> Sound params) -> Assign params sound
- assign4 :: Name -> (sound -> Maybe (Attribute, Attribute, Attribute, Attribute)) -> (UGen -> UGen -> UGen -> UGen -> Sound params) -> Assign params sound
- withDuration :: (UGen -> Sound params) -> Sound params
- data InstrumentParameters = InstrumentParameters {}
- instrumentParameters :: InstrumentParameters
- type InstrumentTable instr = Table InstrumentParameters instr
- type InstrumentTableWithAttributes instr = TableWithAttributes InstrumentParameters instr
- type InstrumentTableWithChannels instr = TableWithChannels InstrumentParameters instr
- type Instrument = Sound InstrumentParameters
- type InstrumentAssign instr = Assign InstrumentParameters instr
- instrumentFromUGen :: (UGen -> UGen -> UGen) -> Instrument
- data DrumParameters = DrumParameters {
- drumDuration :: UGen
- drumVelocity :: UGen
- drumParameters :: DrumParameters
- type DrumTable instr = Table DrumParameters instr
- type DrumTableWithAttributes instr = TableWithAttributes DrumParameters instr
- type DrumTableWithChannels instr = TableWithChannels DrumParameters instr
- type Drum = Sound DrumParameters
- type DrumAssign instr = Assign DrumParameters instr
- drumFromUGen :: (UGen -> UGen) -> Drum
- newtype ChannelMap drum instr = ChannelMap {
- runChannelMap :: Channel -> (UGen, (DrumTableWithChannels drum, InstrumentTableWithChannels instr))
- registerSound :: params -> ((Channel, Assign params sound) -> (DrumTableWithChannels drum, InstrumentTableWithChannels instr) -> (DrumTableWithChannels drum, InstrumentTableWithChannels instr)) -> Assign params sound -> (UGen -> ChannelMap drum instr) -> ChannelMap drum instr
- registerInstrument :: InstrumentAssign instr -> (UGen -> ChannelMap drum instr) -> ChannelMap drum instr
- registerDrum :: DrumAssign drum -> (UGen -> ChannelMap drum instr) -> ChannelMap drum instr
- soundEffect :: UGen -> ChannelMap drum instr
Generic definitions
type Attribute = Double Source
Attribute
means an optional information for a note.
Compare with InstrumentParameters
.
type AttributeList = [Attribute] Source
type ToSound instr = instr -> (AttributeList, Name) Source
attributeControl :: Int -> UGen Source
attributeName :: Int -> String Source
attributeNames :: [String] 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
with3Attributes :: ((Attribute, Attribute, Attribute) -> AttributeList, (UGen -> UGen -> UGen -> sound) -> sound) Source
with4Attributes :: ((Attribute, Attribute, Attribute, Attribute) -> AttributeList, (UGen -> UGen -> UGen -> UGen -> sound) -> sound) Source
type TableWithAttributes params sound = [Assign params sound] Source
type TableWithChannels params sound = [(Channel, Assign params sound)] Source
class SoundParameters params where Source
soundParameters :: params Source
ugenFromSound :: SoundParameters params => Sound params -> UGen Source
lookup :: TableWithAttributes params sound -> ToSound sound Source
assignGeneric :: (attributeTuple -> AttributeList, soundGen -> Sound params) -> Name -> (sound -> Maybe attributeTuple) -> soundGen -> 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
.
type InstrumentTable instr = Table InstrumentParameters instr Source
type InstrumentTableWithAttributes instr = TableWithAttributes InstrumentParameters instr Source
type InstrumentTableWithChannels instr = TableWithChannels InstrumentParameters instr Source
type InstrumentAssign instr = Assign InstrumentParameters instr Source
instrumentFromUGen :: (UGen -> UGen -> UGen) -> Instrument Source
Drum maps
data DrumParameters Source
type DrumTable instr = Table DrumParameters instr Source
type DrumTableWithAttributes instr = TableWithAttributes DrumParameters instr Source
type DrumTableWithChannels instr = TableWithChannels DrumParameters instr Source
type Drum = Sound DrumParameters Source
type DrumAssign instr = Assign DrumParameters instr Source
drumFromUGen :: (UGen -> UGen) -> Drum Source
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.
ChannelMap | |
|
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
soundEffect :: UGen -> ChannelMap drum instr Source