Skip to contents

Create a new MidiFile object using mido

Usage

new_midi_file(type = 1, ticks_per_beat = 480)

Arguments

type

integer, MIDI file type, default is 1

ticks_per_beat

integer, default is 480

Value

an empty MidiFile object

Details

The "empty" MidiFile object from mido defaults to a type 1 MIDI file with ticks_per_beat set to 480. From (Mido Project 2023) , section 3.10.4, "File Types":

"There are three types of MIDI files:

  • type 0 (single track): all messages are saved in one track

  • type 1 (synchronous): all tracks start at the same time

  • type 2 (asynchronous): each track is independent of the others."

See section 3.10.8, "Tempo and Beat Resolution", for details about how time is handled in MIDI files.

References

Mido Project (2023). “Mido - MIDI Objects for Python; Mido 1.2.10 documentation --- mido.readthedocs.io.” https://mido.readthedocs.io/en/latest/index.html. [Accessed 15-Apr-2023].

Examples

if (FALSE) {
  print(midi_file_object <- mydough::new_midi_file())
}