jdxi_editor.midi.soundfont ========================== .. py:module:: jdxi_editor.midi.soundfont Attributes ---------- .. autoapisummary:: jdxi_editor.midi.soundfont.HW_PORT_HINT jdxi_editor.midi.soundfont.SF2_PATH jdxi_editor.midi.soundfont.MIDI_FILE_PATH Functions --------- .. autoapisummary:: jdxi_editor.midi.soundfont.find_hw_output_name jdxi_editor.midi.soundfont.open_hw_output jdxi_editor.midi.soundfont.setup_fluidsynth jdxi_editor.midi.soundfont.midi_to_events jdxi_editor.midi.soundfont.ticks_to_seconds jdxi_editor.midi.soundfont.get_total_duration_in_seconds jdxi_editor.midi.soundfont.play_midi_with_tempo_handling jdxi_editor.midi.soundfont.main Module Contents --------------- .. py:data:: HW_PORT_HINT :value: 'Roland JDXi' .. py:data:: SF2_PATH .. py:data:: MIDI_FILE_PATH :value: 'tests/sheep.mid' .. py:function:: find_hw_output_name(prefer_hw=True) .. py:function:: open_hw_output() .. py:function:: setup_fluidsynth(sf2_path) .. py:function:: midi_to_events(in_port, sink_send, use_sw, fs=None) .. py:function:: ticks_to_seconds(ticks: int, tempo: int, ticks_per_beat: int) -> float Convert MIDI ticks to seconds using the same formula as the main player. :param ticks: int :param tempo: int (μs per quarter note) :param ticks_per_beat: int :return: float .. py:function:: get_total_duration_in_seconds(midi_file) Calculate the correct duration accounting for tempo changes. Uses the same approach as the main player. .. py:function:: play_midi_with_tempo_handling(mid, fs, use_sw) Play MIDI file with proper tempo change handling using the main player approach .. py:function:: main()