API#
Synthesizer#
- class midistream.synthesizer.Synthesizer[source]#
MIDI Synthesizer.
- property config: dict#
Synthesizer configuration dictionary.
- property reverb: ReverbPreset#
Reverb effect preset.
- Getter:
Returns the current
ReverbPreset.- Setter:
Set
ReverbPresetto use.
- property volume: int#
Master volume in dB, 100 is max.
- Getter:
Returns the volume for the mix engine.
- Setter:
Set the master volume for the mix engine.
- class midistream.synthesizer.ReverbPreset(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Parameter settings for reverb effect.
- CHAMBER = 2#
Chamber preset
- HALL = 1#
Hall preset
- LARGE_HALL = 0#
Large hall preset
- OFF = -1#
Reverb effect off
- ROOM = 3#
Room preset
Helpers#
- class midistream.helpers.Note[source]#
Note number.
>>> Note.A0 21 >>> Note.As0 22 >>> Note.Ab0 20 >>> Note.G9 127
Dynamic note attributes parse note names into MIDI note numbers. For example,
Note.C4is60,Note.Cs4is61, andNote.Cb4is59.
- class midistream.helpers.Control(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Control function number for Control Change messages.
See: https://midi.org/midi-1-0-control-change-messages
- all_sound_off = 120#
All Sound Off
- modulation = 1#
Modulation Wheel
- pan = 10#
Pan
- volume = 7#
Channel Volume
- midistream.helpers.midi_note_on(note: int, channel: int = 0, velocity: int = 64) List[int][source]#
MIDI 9nH message - note on.
>>> midi_note_on(70) [144, 70, 64] >>> midi_note_on(70, velocity=127, channel=15) [159, 70, 127]
- midistream.helpers.midi_note_off(note: int, channel: int = 0, velocity: int = 0) List[int][source]#
MIDI 8nH message - note off.
>>> midi_note_off(70) [128, 70, 0] >>> midi_note_off(70, channel=15) [143, 70, 0]
- midistream.helpers.midi_program_change(program: int, channel: int = 0) List[int][source]#
MIDI CnH message - program change.
>>> midi_program_change(80, 1) [193, 80]
- midistream.helpers.midi_control_change(controller: int, value: int = 0, channel: int = 0) List[int][source]#
MIDI BnH message - control change.
>>> midi_control_change(7, value=127, channel=1) [177, 7, 127]
- midistream.helpers.midi_command_increase_channel(command: List[int], inc: int) List[int][source]#
Increase channel number of a given command.
>>> command = [177, 7, 127] >>> midi_command_increase_channel(command, -7) [170, 7, 127] >>> command [177, 7, 127]
- midistream.helpers.midi_channels() Generator[int, None, None][source]#
Generate MIDI channel numbers, with percussion channel 9 omitted.
>>> list(midi_channels()) [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15]