用于音乐笔记,时间,和表达的可人写作的文字格式.
MTXT is a human-editable, text-based format for representing musical performance data. It stores events with precise timing, pitch, and expression values in a simple line-based structure that's easy to edit without requiring specialized tools.
The format is designed for cases where exact performance details matter - arbitrary timings, micro-tuning, dynamic changes, and other expressive parameters. MTXT avoids binary encoding, making it suitable for manual and AI-assisted editing.
kick or Cmaj7). Hand-crafted files are practical and expressive.C4+50, D4-25) and global tuning commands for alternate tuning systems and just intonation. …This repository includes a reference implementation in Rust that provides:
mtxt): Rust crate for parsing and writing MTXT files, with MIDI conversion features.mtxt input.mid output.mtxt # MIDI to MTXT
mtxt input.mtxt output.mid # MTXT to MIDI
mtxt input.mtxt output.mtxt --sort # transform MTXT file and sort events by timeThe CLI supports various transforms that can be applied during conversion:
Musical Transforms:
--transpose - Transpose all notes by semitones (e.g., --transpose +2 or --transpose -12)-q, --quantize - Quantize timing to a grid (e.g., 4 for quarter notes, 16 for 16th notes)--offset - Offset all events by beats (e.g., --offset 1.5, --offset -0.5). Events shifted to negative times are removed.--swing - Apply swing feel (0.0 to 1.0)--humanize - Add timing randomization for humanization (0.0 to 1.0)Channel Filtering:
--include-channels - Include only specific channels (comma-separated, e.g., 1,2,10)--exclude-channels - Exclude specific channels (comma-separated, e.g., 1,2,10)File Organization:
--apply-directives - Apply global directives to events (inline parameters)--extract-directives - Extract common inline parameters into global directives--merge-notes - Merge note on / off pairs into note shorthand events with durations--group-channels - Group events by channel--sort - Sort events by time--indent - Enable timestamp paddingmtxt 1.0mtxt mtxt 1.0).// global meta (applies to the entire file and all channels)
meta global
// channel meta (applies to a single channel), starting from the specified time
[] meta [ch=] title, author, copyright, trackname, custom types).ch command. | Type | Description | Example |
|---|---|---|
title |
Song title | meta global title My Song |
author |
Composer/author | meta global author John Doe |
copyright |
Copyright notice | meta global copyright © 2024 Music Corp |
composer |
Composer name | meta global composer John Doe |
name |
Channel name | meta ch=1 name Lead Guitar |
instrument |
Instrument name | meta ch=2 instrument Steinway Grand |
smpte |
SMPTE offset | meta global smpte 00:00:00:00 |
keysignature |
Key signature | 4.0 meta ch=3 keysignature C major |
text |
General text | meta text Verse 1 |
lyric |
Lyrics | 5.0 meta lyric Hello world |
marker |
Marker/cue point | 6.0 meta marker Chorus |
cue |
Cue point | 7.0 meta cue Solo begins |
program |
Program name | meta global program Piano Ballad |
device |
Device name | meta global device OpenPiano 1000 |
key |
Key signature | meta global key C major |
date |
Creation date | meta global date 2024-01-01 |
genre |
Musical genre | meta global genre Rock |
album |
Album name | meta global album Greatest Hits |
url |
Related URL | meta global url https://example.com |
artist |
Performer name | meta global artist The Band |
license |
Usage license | meta global license CC-BY-4.0 |
generator |
Software tool | meta global generator MySequencer v1.0 |
ch=ch= on events overrides the default for that event only.ch.alias snare, Cmaj7).alias snare C2
alias Cmaj7 C4,E4,G4,B4 // chord alias
0.0 note snare
1.0 note Cmaj7 // plays all 4 notesvel=vel= on note/on overrides for that event.offvel=offvel= on note/off overrides for that event.1.0 if not set.dur=dur= on note overrides for that event.1.0 if not set.transition_curve=
transition_interval=cc and tempo.transition_time must be specified per event (default 0.0).curve=0.0, interval=1.0. note [dur=] [vel=] [offvel=] [ch=]and note-off at.dur, vel, offvel, and ch unless overridden.BEAT.SUB (0-based). Example: 3.5.alias.C..B with #/b, octave required (e.g., C4).C, C#, Db, D, D#, Eb, E, F, F#, Gb, G, G#, Ab, A, A#, Bb, BC4, c4, Bb2, bb2, F#3, f#3)+N/-N cents (range -99..+99), applied via pitch bend. Examples: C4+50 (50 cents sharp), D4-25 (25 cents flat), bb2+10.5 (10.5 cents sharp). Positive values require +. on [vel=] [ch=]vel and ch unless overridden. off [offvel=] [ch=]offvel and ch unless overridden. cc [note] [ch=] [transition_curve=] [transition_time=] [transition_interval=][0.0..1.0]. Uses default ch unless overridden.note to apply CC to a specific note. If a note is specified, it applies to that note only.cc my_param 0.5).| Name | Range | Description |
|---|---|---|
pitch |
-12.0..12.0 |
Pitch bend in semitones. 0=none, 1 = one semitone up, -0.005 = half cent down |
aftertouch |
0.0..1.0 |
Channel or Polyphonic Aftertouch |
vibrato |
0.0..1.0 |
Vibrato depth (Modulation Wheel) |
vibrato_rate |
0.0..1024.0 |
Vibrato rate in Hz |
breath |
0.0..1.0 |
Breath controller pressure |
foot |
0.0..1.0 |
Foot controller pedal position |
portamento |
0.0..1.0 |
Portamento glide time |
volume |
0.0..1.0 |
Channel volume level |
balance |
-1.0..1.0 |
Stereo balance (left 0) |
pan |
-1.0..1.0 |
Stereo panning position (left 0) |
expression |
0.0..1.0 |
Expression (secondary volume, relative to main) |
sustain |
0.0..1.0 |
Sustain pedal (damper) on/off (> 0.5 is on) |
portamento_switch |
0.0..1.0 |
Portamento on/off switch (> 0.5 is on) |
sostenuto |
暂无开放 Issues,或尚未同步最近议题。