Arcade.SynthFeed
Types
One SoundEngine call. CmdPlay is play(cue), CmdRumble setRumble, CmdDrum setDrumRoll.
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
fn quantum() : Int needs () do 128 end
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
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