March Docs

Arcade.SynthFeed

Types

typeAudioCmdAudioCmd(cue) = CmdPlay(cue) | CmdRumble(Float) | CmdDrum(Bool)#

One SoundEngine call. CmdPlay is play(cue), CmdRumble setRumble, CmdDrum setDrumRoll.

typeLevelsLevels = { lvl_rumble : Float, lvl_drum : Bool }#

The rumble and drum levels last asked for: what a synth started late must be set to, so the beds come up with the speakers.

Functions

fnblockblock(voices : SynthConsts -> cue -> List(SynthVoice), s : Synth, cmds : List(AudioCmd(cue)), n : Int) : (List(Float), Synth) needs ()#

fn quantum() : Int needs () do 128 end

fnobey_allobey_all(voices : SynthConsts -> cue -> List(SynthVoice), s : Synth, cmds : List(AudioCmd(cue))) : Synth needs ()#

fn obey(voices : SynthConsts -> cue -> List(SynthVoice), s : Synth, cmd : AudioCmd(cue)) : Synth needs () do match cmd do CmdPlay(c) -> Arcade.Synth.add(s, voices(s.c, c)) CmdRumble(level) -> Arcade.Synth.set_rumble(s, level) CmdDrum(on_) -> Arcade.Synth.set_drum(s, on_) end end

fntracktrack(l : Levels, cmds : List(AudioCmd(cue))) : Levels needs ()#

fn quiet() : Levels needs () do { lvl_rumble: 0.0, lvl_drum: false } end

fn track_one(l : Levels, cmd : AudioCmd(cue)) : Levels needs () do match cmd do CmdPlay(_) -> l CmdRumble(level) -> { l with lvl_rumble: level } CmdDrum(on_) -> { l with lvl_drum: on_ } end end