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 at duration to the meta track :duration: offset for placement of marker

get_mid_path() Path[source]
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.

play()[source]

this overrides the mido play function

convert()[source]

this overrides the mido play function

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

add_kick()[source]
add_piano()[source]
add_vibes()[source]
add_bass()[source]
add_horns()[source]
add_strings()[source]
add_solo_ooh()[source]
add_solo_aah()[source]
add_choir_aah()[source]
add_choir_ooh()[source]
add_choir_mixed()[source]
add_choir_swell()[source]
add_choir_little_swell()[source]