Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

Midi.Synth

Contents

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
Show State # 
Instance details

Defined in Midi.Synth

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

type SoundingNote = NoteT (Maybe RealTime) Source #

SoundingNotes may still be open.

data NoteT dur Source #

Instances
Eq dur => Eq (NoteT dur) # 
Instance details

Defined in Midi.Synth

Methods

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

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

Show dur => Show (NoteT dur) # 
Instance details

Defined in Midi.Synth

Methods

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

show :: NoteT dur -> String #

showList :: [NoteT dur] -> ShowS #

Pretty dur => Pretty (NoteT dur) # 
Instance details

Defined in Midi.Synth

Methods

pretty :: NoteT dur -> Text Source #

format :: NoteT dur -> Doc Source #

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

type SynthM a = ReaderT Midi.WriteMessage (StateT State Identity) a Source #

Keep the current msg for warn.

deactivate :: 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 -> MState.Control -> Midi.ControlValue -> SynthM () Source #

Append a CC change to all sounding notes.

pitch_bend :: MState.Addr -> 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.