harmonic_resonance.midiator.part
Part extend the mido MidiFile
object
- keeps track of instruments, channels
- class harmonic_resonance.midiator.part.Part(project: str, title: str, bpm: int = 120, bpM: int = 4, beat_val: int = 4, root: int = 60, key: str = 'C')[source]
Bases:
MidiFile
Part object extends the mido MidoFile
- free_channels = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15]
- perc_channel = None
- instruments = []
- measure_ticks()[source]
return measure duration in ticks used for setting the
M
variable in a composition- Returns:
int
- set_marker(text, duration=0)[source]
appends a
marker
message atduration
to the meta track :duration: offset for placement of marker
- save()[source]
Save to a file.
If file is passed the data will be saved to that file. This is typically an in-memory file or and already open file like sys.stdout.
If filename is passed the data will be saved to that file.
Raises ValueError if both file and filename are None, or if a type 0 file has != one track.
- add_instrument(instrument_type: <module 'harmonic_resonance.midiator.instruments.instrument_types' from '/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/harmonic_resonance/midiator/instruments/instrument_types.py'>) Instrument [source]
add instrument to session set to next available channel
- Instrument_type:
TODO
- Returns:
TODO
- add_voice(voice_type: <module 'harmonic_resonance.midiator.voices.voice_types' from '/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/harmonic_resonance/midiator/voices/voice_types.py'>) Voice [source]
add instrument to session set to next available channel
- Instrument_type:
TODO
- Returns:
TODO