Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Midi.Synth

Description

Simulate a MIDI synth and turn low level MIDI msgs back into a medium level form. This is a bit like "unperform".

Synopsis

analyze

compute

data State Source #

Constructors

State 

Fields

Instances

Instances details
Show State Source # 
Instance details

Defined in Midi.Synth

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

type SoundingNote = NoteT (Maybe RealTime.RealTime) Source #

SoundingNotes may still be open.

data NoteT end Source #

Instances

Instances details
Show end => Show (NoteT end) Source # 
Instance details

Defined in Midi.Synth

Methods

showsPrec :: Int -> NoteT end -> ShowS #

show :: NoteT end -> String #

showList :: [NoteT end] -> ShowS #

Eq end => Eq (NoteT end) Source # 
Instance details

Defined in Midi.Synth

Methods

(==) :: NoteT end -> NoteT end -> Bool #

(/=) :: NoteT end -> NoteT end -> Bool #

Pretty end => Pretty (NoteT end) Source # 
Instance details

Defined in Midi.Synth

Methods

pretty :: NoteT end -> Text Source #

format :: NoteT end -> Doc Source #

formatList :: [NoteT end] -> Doc Source #

deactivate :: RealTime.RealTime -> State -> State Source #

After notes have had a note-off time for a certain amount of time, move them from state_active to state_notes. The certain amount of time should be the note's decay time, but since I don't really know that, just pick an arbitrary constant.

msgs

control :: MState.Addr -> RealTime.RealTime -> MState.Control -> Midi.ControlValue -> SynthM () Source #

Append a CC change to all sounding notes.

pitch_bend :: MState.Addr -> RealTime.RealTime -> Midi.PitchBendValue -> SynthM () Source #

Append pitch bend to all sounding notes.

util

pretty

pretty_state :: State -> Text Source #

Format synth state in an easier to read way.