Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

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

type SoundingNote = NoteT (Maybe RealTime) Source #

SoundingNotes may still be open.

data NoteT dur Source #

Instances

Eq dur => Eq (NoteT dur) # 

Methods

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

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

Show dur => Show (NoteT dur) # 

Methods

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

show :: NoteT dur -> String #

showList :: [NoteT dur] -> ShowS #

Pretty dur => Pretty (NoteT dur) # 

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.