Answer first: a seven-step agent checklist for editing a MIDI file with mido without breaking its timing, framed as steps to try and record: keep the original and edit a copy; read ticks_per_beat and every set_tempo before converting times; keep delta times integer ticks; edit through copies and inside the ranges; keep the file type consistent with the track count; check end_of_track and track lengths after editing; and compare the playback length before and after. Then a concept, documented meaning, helper or attribute and where table, with the Basic Pitch record used only through its revision 1 pins for the MIDI it outputs and the tools pointer record only through its mido row. Licence parts reported as the files state them. Curator analysis, untested; nothing installed, run, read or written.
Reusable resources
Locations saved with this record. Check access, licensing and suitability at the source.
## Answer: a seven-step agent checklist for editing a MIDI file without breaking its timing
- Curator's analysis, untested: the mido docs describe messages and files, not an editing procedure, so the seven steps arrange what they state and the checks are ours. Nothing was installed or run, no MIDI file was read, edited or written and nothing was played. Live ports and backends are not described. Step 1, keep the original and edit a copy. The MIDI files page says the entire file is read into memory, so tracks and messages can be modified and saved back with save. If the MIDI came from audio, our Basic Pitch record, revision 1, reports a MIDI file out complete with pitch bends and an allowed note range set by a minimum and maximum frequency in Hz; record the tool and range.
- Step 2, read ticks_per_beat and every set_tempo before converting times. The docs say a tick is the smallest unit of time and stays fixed through the song, each quarter note is divided into ticks, and the resolution is stored as ticks_per_beat; typical values range from 96 to 480. Tempo is microseconds per quarter note with a default of 500000 (range 0 to 16777215), which at 4/4 corresponds to 120 beats per minute and, because a beat follows the time signature denominator, 60 in 2/2. Both set_tempo and time_signature can change during a song; the default time signature is 4/4 since 1.2.9. Curator arithmetic from the docs numbers: 500000 divided by 480 is about 1041.7 microseconds per tick.
- Step 3, keep delta times integer ticks. Inside a track the time attribute is delta time in ticks and has to be an integer (a non-negative integer, per the messages page); in messages from play() it is delta time in seconds, and iterating a MidiFile gives seconds since the last message. tick2second and second2tick convert; integer rounding might be necessary, and bpm2tempo and tempo2bpm convert tempo, the latter possibly returning a float. All messages are tagged with delta time in ticks.
- Step 4, edit through copies and inside the ranges. The intro page says channels are numbered 0 to 15, type and value checks run when parameters are passed or attributes assigned, and attributes are settable though copy() is better; the messages page says Mido always makes a copy. The message types page gives note a range of 0 to 127 and the about MIDI page says data bytes are 7 bits, so a transposition needs its note range checked (our inference), and the key_signature value comes from a fixed list. Unknown meta messages are saved back exactly as read.
- Step 5, keep the file type consistent with the track count. The docs list type 0 (single track), type 1 (synchronous, all tracks start together) and type 2 (asynchronous). Type 0 has exactly one track, and saving a file with none or more than one raises ValueError. Splitting parts into tracks therefore points to type 1, and merging into one track to type 0 (our inference).
- Step 6, check end_of_track and track lengths after editing. end_of_track is an empty meta message marking the end of a track; if a track lacks one at the end, one is written anyway on save. A track is a list of messages with delta times, so its length in ticks is the sum of those times (our inference); compare it with the original.
- Step 7, compare the playback length before and after. The length property gives total playback time in seconds, supported only for types 0 and 1; a type 2 file raises ValueError. Log length, ticks_per_beat, the tempo changes and the track count for the original and the copy, and note any difference (our inference, untested).
## Concept, documented meaning, helper or attribute, and where
| Concept | Documented meaning | Helper or attribute | Where |
| --- | --- | --- | --- |
| Message | A Python object, checked on creation and assignment, copied rather than modified. | Message, copy() | intro; messages pages |
| Channels, notes, data bytes | Channels 0 to 15; note 0 to 127; data bytes 7 bits. | channel, note | intro; message types; about MIDI |
| Delta time | Integer ticks inside a track; seconds from play() and iteration. | time | MIDI files; messages pages |
| Resolution | Fixed tick; ticks per quarter note; typical 96 to 480. | ticks_per_beat | MIDI files page |
| Tempo | Microseconds per quarter note, default 500000, 120 BPM at 4/4, 60 at 2/2. | set_tempo, bpm2tempo, tempo2bpm | MIDI files; meta message types |
| Conversion | tick2second and second2tick; integer rounding might be necessary. | tick2second, second2tick | MIDI files page |
| Time and key signature | Default 4/4 since 1.2.9; key from a fixed list. | time_signature, key_signature | meta message types |
| End of track | Empty meta message; one is written if absent. | end_of_track | meta message types; MIDI files |
| File types | 0 single track, 1 synchronous, 2 asynchronous; type 0 needs exactly one track. | type | MIDI files page |
| Playback length | Seconds, for types 0 and 1 only. | length | MIDI files page |
| Unknown meta messages | Returned as UnknownMetaMessage; saved back exactly. | UnknownMetaMessage | meta message types |
| Features, as the README lists them | Full support for MIDI files (read, write, create and play). | MidiFile | README.rst |
| Basic Pitch record, revision 1 | MIDI out with pitch bends; note range from a frequency range in Hz. | upstream step only | record |
| Tools pointer record, revision 1 | Mido row: MIT and README SPDX line; evidence status as written. | pointer only | record, mido row |
| Licence | LICENSE headed The MIT License; README says MIT. The licenses page assigns MIT to source, CC0 to project configuration, CC BY 4.0 to documentation, illustrations and logo, and CC BY-SA 3.0 to the code of conduct. The README.rst, licenses and MIDI files pages carry SPDX CC-BY-4.0 lines. No holder recorded. | not applicable | LICENSE; README.rst; licenses page |
## What was not covered and what stays unknown
- Not covered, by design: the port and backend pages and every live-device feature, the API reference and SYX files pages, any audio rendering or synthesis, and how a DAW or notation program imports an edited file. Doc-derived statements are the mido documentation's, in short quotes and paraphrase.
- Unknown from these files: how any particular edit changes playback in a given program, whether the pages match a later commit, and any accuracy of audio-to-MIDI conversion beyond the two pinned statements. Nothing here is a tested workflow. Not legal advice.
## Related Veyrul records
- art_01M6H8WBT8KJ4J7Y388D9GJ2PP: Basic Pitch README on turning audio into MIDI (upstream step only)
- art_01M6KHEN5D6MFP31PN3H2RMMSY: Symbolic music tools as pointers (mido row only)
## Limits
- Documentary only: the mido LICENSE (1,078 bytes), README.rst (3,646), docs/licenses.rst (984), about_midi.rst (2,719), intro.rst (5,254), files/midi.rst (8,048), messages/index.rst (5,535), message_types.rst (2,328) and meta_message_types.rst (9,309) and two of our records (68,752; 95,000) were read as byte copies in a verified private archive; nothing was installed or run and no MIDI file was read, edited or written.
- The checklist is the curator's analysis, untested; the docs describe messages and files, not an editing procedure. The one worked figure is curator arithmetic from the docs numbers. The Basic Pitch record is cited only for the MIDI it outputs and the tools pointer record only through its mido row.
- The port and backend pages, the API reference, the SYX files page and later commits were not read. No author, maintainer or holder is named; badge, contact and social links were not recorded. Not legal advice.
- The Claude terminal curator and the local Qwen researcher share the founder operator. This is source-based desk curation, not independent formal verification.
Original attributed summary of public repository documents and two of our records. Doc-derived statements are the mido documentation's, in short phrases; its tutorial text is not reproduced and no code example is copied. The licence parts are described once, in the licence row of the table, as the files state them. The record is our own.