Midifile ist eine Bibliothek mit C ++ - Klassen zum Lesen/Schreiben von Standard -MIDI -Dateien. Die Bibliothek besteht aus 6 Klassen:
| Mittelgroß | Die Hauptschnittstelle für den Umgang mit MIDI -Dateien. Die Midifile -Klasse erscheint als zweidimensionales Array von Mitteln: Die erste Dimension ist eine Liste von Tracks, und die zweite Dimension ist eine Liste von Mitteln. |
| MIDEVELTLIST | Eine Datenstruktur, die die Liste der Midevents für eine MIDI -Dateistrecke verwaltet. |
| Midiegrent | Die primäre Speichereinheit für Midimessages in einem mittleren IFILE. Die Klasse besteht aus einem Tick -Zeitstempel (Delta oder Absolute) und einem Vektor von MIDI -Nachrichten -Bytes (oder Standard -MIDI -Datei -Meta -Nachrichten). |
| Midimessage | Die Basisklasse für Midevents. Dies ist ein STL -Vektor von nicht signierten Bytes, die eine MIDI -Nachricht (oder eine Meta-) Nachricht darstellen. |
| Binasc | Eine Helferklasse für Midifile, mit der das Lesen/Schreiben von MIDI -Dateien in einem ASCII -Format das Lesen der Bytes der binären Standard -MIDI -Dateien beschreibt. |
| Optionen | Eine optionale Convenience-Klasse, die für Parsing-Befehlszeilenoptionen in den Beispielprogrammen verwendet wird. Diese Klasse kann aus der Bibliothek entfernt werden, da sie nicht für die Verwendung der Midifile -Klasse benötigt wird. |
Hier ist ein Schema darüber, wie die Klassen zusammen verwendet werden:

Die MidiFile -Klasse enthält einen Vektor von Tracks, die in Objekten MidiEventList gespeichert sind. Die MidiEventList ist selbst ein Vektor von MidiEvent S, das jedes MIDI -Event auf der Strecke speichert. MidiEvent S enthält einen Zeitstempel und eine MidiMessage , die ein Vektor von nicht signierten SHAR-Werten ist und die rohen Bytes einer MIDI-Nachricht (oder Meta-Message) speichert.
Die Dokumentation befindet sich unter http://midifile.sapp.org. Wesentliche Beispiele zum Lesen und Schreiben von MIDI -Dateien finden Sie unten.
Sie können als ZIP -Datei von der GitHub -Seite für die Midifile -Bibliothek herunterladen oder wenn Sie Git verwenden, und dann mit diesem Befehl herunterladen:
git clone https://github.com/craigsapp/midifile Dadurch wird das midifile -Verzeichnis mit dem Quellcode für die Bibliothek erstellt.
Die Bibliothek kann mit dem Befehl zusammengestellt werden:
make library Dadurch wird die Datei lib/libmidifile.a erstellt, mit der sich mit Programmen, die die Bibliothek verwenden, verknüpft werden können. Beispielprogramme können mit dem Befehl zusammengestellt werden:
make programs Dadurch werden alle Beispielprogramme im Tools -Verzeichnis zusammengestellt. Kompilierte Beispielprogramme werden im bin -Verzeichnis gespeichert. Um sowohl die Bibliothek als auch die Beispielprogramme in einem Schritt zu kompilieren, geben Sie ein:
make Um nur ein einzelnes Programm zu kompilieren, wie z createmidifile , Typ:
make createmidifile Sie können auch Ihre eigenen Programme in tools wie myprogram.cpp platzieren und den Typ kompilieren:
make myprogram Das kompilierte Programm wird bin/myprogram sein.
Der einfachste Weg, die Midifile-Bibliothek in Ihrem eigenen Projekt zu verwenden, besteht darin, die Header-Dateien in das Verzeichnis include und die Quellcode-Dateien im src Verzeichnis in Ihr eigenes Projekt zu kopieren. Sie müssen keine Options.h oder Options.cpp kopieren, da die MidiFile -Klasse nicht von ihnen abhängt. Die Projekte von Verovio und Midiroll auf GitHub verwenden diese Methode, um die Midifile -Bibliothek zu verwenden. Alternativ können Sie das Midifile -Repository aufgeben und eine kompilierte Bibliotheksdatei des Quellcodes erstellen, die mit dem include -Verzeichnisgehalt in Ihr Projekt kopiert werden kann.
Das folgende Programm listet alle Midevents in einer MIDI -Datei auf. Das Programm iteriert über jeden Track und druckt eine Liste aller MIDI -Ereignisse in der Strecke. Für jedes Ereignis wird der absolute Tick -Zeitstempel für die Leistungszeit der MIDI -Nachricht angegeben, gefolgt von der Nachricht selbst als Liste von Hex -Bytes.
Sie können die MidiFile::doTimeAnalysis() -Funktion ausführen, um die Absolute Tick-Zeitstempel in Sekunden zu konvertieren, je nach Tempo-Meta-Messages in der Datei (unter Verwendung eines Standardtempos mit 120 Viertelnoten pro Minute, wenn keine Tempo-Meta-Messages vorhanden sind). Die absolute Startzeit des Ereignisses wird in der zweiten Spalte der Ausgabe des Programms angezeigt.
Die MidiFile::linkNotePairs() -Funktion kann verwendet werden, um Notiz-Ons und Notizen abzustimmen. In diesem Fall können Sie mit MidiEvent::getDurationInSeconds() auf die Dauer der Notiz zugreifen, um Nachrichten zu erhalten. Die Notizdauer sind in der dritten Spalte der Ausgabe des Programms angezeigt.
Beachten Sie, dass sich die Klassen der Midifile -Bibliothek im smf -Namespace befinden. using namespace smf; oder smf:: Präfixe werden benötigt, um auf die Klassen zuzugreifen.
# include " MidiFile.h "
# include " Options.h "
# include < iostream >
# include < iomanip >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. process (argc, argv);
MidiFile midifile;
if (options. getArgCount () == 0 ) midifile. read (cin);
else midifile. read (options. getArg ( 1 ));
midifile. doTimeAnalysis ();
midifile. linkNotePairs ();
int tracks = midifile. getTrackCount ();
cout << " TPQ: " << midifile. getTicksPerQuarterNote () << endl;
if (tracks > 1 ) cout << " TRACKS: " << tracks << endl;
for ( int track= 0 ; track<tracks; track++) {
if (tracks > 1 ) cout << " n Track " << track << endl;
cout << " Tick t Seconds t Dur t Message " << endl;
for ( int event= 0 ; event<midifile[track]. size (); event++) {
cout << dec << midifile[track][event]. tick ;
cout << ' t ' << dec << midifile[track][event]. seconds ;
cout << ' t ' ;
if (midifile[track][event]. isNoteOn ())
cout << midifile[track][event]. getDurationInSeconds ();
cout << ' t ' << hex;
for ( int i= 0 ; i<midifile[track][event]. size (); i++)
cout << ( int )midifile[track][event][i] << ' ' ;
cout << endl;
}
}
return 0 ;
} Das obige Beispielprogramm lautet den ersten Dateinamen, den es in der Befehlszeile findet, oder es wird aus Standardeingaben gelesen, wenn keine Argumente gefunden werden. Sowohl binäre Standard -MIDI -Dateien als auch ASCII -Darstellungen von MIDI -Dateien können in das Programm eingegeben werden. Speichern Sie beispielsweise den folgenden Text in einer Datei namens twinkle.txt , um als Eingabedaten zu verwenden. Dieser Inhalt stellt die Hex -Bytes für eine Standard -MIDI -Datei dar, die automatisch von der MidiFile -Klasse analysiert wird.
4d 54 68 64 00 00 00 06 00 01 00 03 00 78 4d 54 72 6b 00 00 00 04 00 ff 2f
00 4d 54 72 6b 00 00 00 76 00 90 48 40 78 80 48 40 00 90 48 40 78 80 48 40
00 90 4f 40 78 80 4f 40 00 90 4f 40 78 80 4f 40 00 90 51 40 78 80 51 40 00
90 51 40 78 80 51 40 00 90 4f 40 81 70 80 4f 40 00 90 4d 40 78 80 4d 40 00
90 4d 40 78 80 4d 40 00 90 4c 40 78 80 4c 40 00 90 4c 40 78 80 4c 40 00 90
4a 40 78 80 4a 40 00 90 4a 40 78 80 4a 40 00 90 48 40 81 70 80 48 40 00 ff
2f 00 4d 54 72 6b 00 00 00 7d 00 90 30 40 78 80 30 40 00 90 3c 40 78 80 3c
40 00 90 40 40 78 80 40 40 00 90 3c 40 78 80 3c 40 00 90 41 40 78 80 41 40
00 90 3c 40 78 80 3c 40 00 90 40 40 78 80 40 40 00 90 3c 40 78 80 3c 40 00
90 3e 40 78 80 3e 40 00 90 3b 40 78 80 3b 40 00 90 3c 40 78 80 3c 40 00 90
39 40 78 80 39 40 00 90 35 40 78 80 35 40 00 90 37 40 78 80 37 40 00 90 30
40 81 70 80 30 40 00 ff 2f 00
Im Folgenden finden Sie die Ausgabe aus dem Beispielprogramm, das die oben genannten Eingabedaten enthält. Der TPQ-Wert ist der Ticks-pro-Quarter-Note-Wert aus dem MIDI-Header. In diesem Beispiel hat jede Quartal -Note eine Dauer von 120 MIDI -Dateien. Die obige MIDI-Datei enthält drei Tracks mit dem ersten Track (der Ausdrucksspur, der keinen anderen Inhalt als die META-Meldung am Ende des Tracks hat. ff 2f 00 in Hex-Bytes. Der zweite Track beginnt mit einer MIDI-Note-On-Nachricht 90 48 40 (in Hex), die MIDI-Note 72 (C-Tonhöhe One Octave Over Middle C) mit einer mittleren Lautstärke (40 Hex = 64 in Decimal).
TPQ: 120 Tracks: 3 Track 0 Ticksekunden -DUR -Nachricht ankreuzen 0 0 ff 2f 0 Spur 1 Ticksekunden -DUR -Nachricht ankreuzen 0 0 0,5 90 48 40 120 0,5 80 48 40 120 0,5 0,5 90 48 40 240 1 80 48 40 240 1 0,5 90 4f 40 360 1,5 80 4f 40 360 1,5 0,5 90 4f 40 480 2 80 4f 40 480 2 0,5 90 51 40 600 2.5 80 51 40 600 2,5 0,5 90 51 40 720 3 80 51 40 720 3 1 90 4f 40 960 4 80 4f 40 960 4 0,5 90 4d 40 1080 4.5 80 4d 40 1080 4,5 0,5 90 4d 40 1200 5 80 4d 40 1200 5 0,5 90 4c 40 1320 5.5 80 4c 40 1320 5,5 0,5 90 4c 40 1440 6 80 4c 40 1440 6 0,5 90 4a 40 1560 6.5 80 4a 40 1560 6,5 0,5 90 4a 40 1680 7 80 4a 40 1680 7 1 90 48 40 1920 8 80 48 40 1920 8 ff 2f 0 Spur 2 Ticksekunden -DUR -Nachricht ankreuzen 0 0 0,5 90 30 40 120 0,5 80 30 40 120 0,5 0,5 90 3c 40 240 1 80 3c 40 240 1 0,5 90 40 40 360 1,5 80 40 40 360 1,5 0,5 90 3c 40 480 2 80 3c 40 480 2 0,5 90 41 40 600 2.5 80 41 40 600 2,5 0,5 90 3c 40 720 3 80 3c 40 720 3 0,5 90 40 40 840 3.5 80 40 40 840 3,5 0,5 90 3c 40 960 4 80 3c 40 960 4 0,5 90 3e 40 1080 4.5 80 3e 40 1080 4,5 0,5 90 3B 40 1200 5 80 3B 40 1200 5 0,5 90 3c 40 1320 5.5 80 3c 40 1320 5,5 0,5 90 39 40 1440 6 80 39 40 1440 6 0,5 90 35 40 1560 6.5 80 35 40 1560 6,5 0,5 90 37 40 1680 7 80 37 40 1680 7 1 90 30 40 1920 8 80 30 40 1920 8 ff 2f 0
Das Standardverhalten der MidiFile -Klasse besteht darin, die absoluten Tick -Zeiten von MIDI -Events zu speichern, die in MidiEvent::tick erhältlich sind. Dies ist die Tick -Zeit vom Beginn der Datei bis zum aktuellen Ereignis. In Standard -MIDI -Dateien wird Tick als Delta -Werte gespeichert, wobei das Tick die Dauer angibt, die seit der vorherigen Nachricht in einem Track wartet. Um auf die Delta Tick -Werte zuzugreifen, können Sie entweder (1) die aktuelle Zeckenzeit aus der vorherigen Zeckenzeit in der Liste unterziehen oder MidiFile::makeDeltaTime() anrufen, um die absoluten Zeckenwerte in Delta Tick -Werte umzuwandeln.
Die MidiFile::joinTracks() -Funktion kann verwendet werden, um Multi-Track-Daten in eine einzelne Zeitsequenz umzuwandeln. Die Operation joinTrack() kann durch Aufrufen der MidiFile::splitTracks() -Funktion umgekehrt werden. Hier ist ein Programmprobe, das sich den MidiEvents in einen einzelnen Track anschließt, damit die Daten in einer einzigen Schleife verarbeitet werden können:
# include " MidiFile.h "
# include " Options.h "
# include < iostream >
# include < iomanip >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. process (argc, argv);
MidiFile midifile;
if (options. getArgCount () > 0 ) midifile. read (options. getArg ( 1 ));
else midifile. read (cin);
cout << " TPQ: " << midifile. getTicksPerQuarterNote () << endl;
cout << " TRACKS: " << midifile. getTrackCount () << endl;
midifile. joinTracks ();
// midifile.getTrackCount() will now return "1", but original
// track assignments can be seen in .track field of MidiEvent.
cout << " TICK DELTA TRACK MIDI MESSAGE n " ;
cout << " ____________________________________ n " ;
MidiEvent* mev;
int deltatick;
for ( int event= 0 ; event < midifile[ 0 ]. size (); event++) {
mev = &midifile[ 0 ][event];
if (event == 0 ) deltatick = mev-> tick ;
else deltatick = mev-> tick - midifile[ 0 ][event- 1 ]. tick ;
cout << dec << mev-> tick ;
cout << ' t ' << deltatick;
cout << ' t ' << mev-> track ;
cout << ' t ' << hex;
for ( int i= 0 ; i < mev-> size (); i++)
cout << ( int )(*mev)[i] << ' ' ;
cout << endl;
}
return 0 ;
}Unten finden Sie die neue Einspurausgabe. Die erste Spalte ist der absolute Tick -Zeitstempel der Nachricht. Die zweite Spalte ist der Delta Tick -Wert; Die dritte Spalte ist der ursprüngliche Trackwert. und die letzte Spalte enthält die MIDI -Nachricht (in Hex -Bytes).
TPQ: 120 Tracks: 3 Tick Delta Track MIDI Meldung ____________________________________ 0 0 1 90 48 40 0 0 2 90 30 40 0 0 0 ff 2f 0 120 120 1 80 48 40 120 0 2 80 30 40 120 0 2 90 3c 40 120 0 1 90 48 40 240 120 2 80 3c 40 240 0 1 80 48 40 240 0 2 90 40 40 240 0 1 90 4f 40 360 120 2 80 40 40 360 0 1 80 4f 40 360 0 1 90 4f 40 360 0 2 90 3c 40 480 120 2 80 3c 40 480 0 1 80 4f 40 480 0 2 90 41 40 480 0 1 90 51 40 600 120 2 80 41 40 600 0 1 80 51 40 600 0 1 90 51 40 600 0 2 90 3c 40 720 120 1 80 51 40 720 0 2 80 3c 40 720 0 2 90 40 40 720 0 1 90 4f 40 840 120 2 80 40 40 840 0 2 90 3c 40 960 120 2 80 3c 40 960 0 1 80 4f 40 960 0 2 90 3e 40 960 0 1 90 4d 40 1080 120 1 80 4d 40 1080 0 2 80 3e 40 1080 0 2 90 3b 40 1080 0 1 90 4d 40 1200 120 1 80 4d 40 1200 0 2 80 3b 40 1200 0 2 90 3c 40 1200 0 1 90 4c 40 1320 120 1 80 4c 40 1320 0 2 80 3c 40 1320 0 1 90 4c 40 1320 0 2 90 39 40 1440 120 1 80 4c 40 1440 0 2 80 39 40 1440 0 1 90 4a 40 1440 0 2 90 35 40 1560 120 1 80 4a 40 1560 0 2 80 35 40 1560 0 2 90 37 40 1560 0 1 90 4a 40 1680 120 1 80 4a 40 1680 0 2 80 37 40 1680 0 2 90 30 40 1680 0 1 90 48 40 1920 240 1 80 48 40 1920 0 2 80 30 40 1920 0 1 ff 2f 0 1920 0 2 ff 2f 0
Im Folgenden finden Sie ein Beispielprogramm zum Erstellen einer MIDI -Datei. Dieses Programm generiert eine zufällige Folge von Notizen und hält sie am Ende der Spur an. Standardmäßig enthält ein MidiFile Objekt einen einzelnen Track und wird als Typ-0-MIDI-Datei geschrieben, es sei denn, weitere Tracks werden hinzugefügt. Nach dem Hinzufügen von Notizen zum Track muss es in die Zeitsequenz sortiert werden, bevor sie in eine Datei geschrieben werden.
# include " MidiFile.h "
# include " Options.h "
# include < random >
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. define ( " n|note-count=i:10 " , " How many notes to randomly play " );
options. define ( " o|output-file=s " , " Output filename (stdout if none) " );
options. define ( " i|instrument=i:0 " , " General MIDI instrument number " );
options. define ( " x|hex=b " , " Hex byte-code output " );
options. process (argc, argv);
random_device rd;
mt19937 mt ( rd ());
uniform_int_distribution< int > starttime ( 0 , 100 );
uniform_int_distribution< int > duration ( 1 , 8 );
uniform_int_distribution< int > pitch ( 36 , 84 );
uniform_int_distribution< int > velocity ( 40 , 100 );
MidiFile midifile;
int track = 0 ;
int channel = 0 ;
int instr = options. getInteger ( " instrument " );
midifile. addTimbre (track, 0 , channel, instr);
int tpq = midifile. getTPQ ();
int count = options. getInteger ( " note-count " );
for ( int i= 0 ; i<count; i++) {
int starttick = int ( starttime (mt) / 4.0 * tpq);
int key = pitch (mt);
int endtick = starttick + int ( duration (mt) / 4.0 * tpq);
midifile. addNoteOn (track, starttick, channel, key, velocity (mt));
midifile. addNoteOff (track, endtick, channel, key);
}
midifile. sortTracks (); // Need to sort tracks since added events are
// appended to track in random tick order.
string filename = options. getString ( " output-file " );
if (filename. empty ()) {
if (options. getBoolean ( " hex " )) midifile. writeHex (cout);
else cout << midifile;
} else
midifile. write (filename);
return 0 ;
}Wenn keine Ausgabedatei angegeben ist, werden die MIDI -Dateiinhalte im BinasC -Format in die Standardausgabe gedruckt, die in ein Midifile -Objekt zurückgelesen und in eine Standard -MIDI -Datei konvertiert werden kann (siehe das Lese-/Schreibbeispiel weiter unten auf der Seite, um dies zu tun):
"MThd" ; MIDI header chunk marker
4'6 ; bytes to follow in header chunk
2'0 ; file format: Type-0 (single track)
2'1 ; number of tracks
2'120 ; ticks per quarter note
;;; TRACK 0 ----------------------------------
"MTrk" ; MIDI track chunk marker
4'89 ; bytes to follow in track chunk
v30 90 '74 '72 ; note-on D5
v150 90 '68 '88 ; note-on G#4
v0 90 '79 '83 ; note-on G5
v60 90 '74 '0 ; note-off D5
v150 90 '79 '0 ; note-off G5
v30 90 '68 '0 ; note-off G#4
v990 90 '60 '100 ; note-on C4
v90 90 '60 '0 ; note-off C4
v630 90 '83 '69 ; note-on B5
v60 90 '83 '0 ; note-off B5
v30 90 '56 '51 ; note-on G#3
v90 90 '56 '0 ; note-off G#3
v390 90 '78 '46 ; note-on F#5
v30 90 '60 '78 ; note-on C4
v90 90 '78 '0 ; note-off F#5
v0 90 '70 '56 ; note-on A#4
v60 90 '76 '100 ; note-on E5
v90 90 '60 '0 ; note-off C4
v30 90 '76 '0 ; note-off E5
v60 90 '70 '0 ; note-off A#4
v0 ff 2f v0 ; end-of-track
Hier sind die MIDI -Daten, die mit dem Beispielprogramm Mid2svg visualisiert wurden:

Die Option -x kann verwendet werden, um die Daten als Hex -Byte -Codes auszugeben, die Option -n -Option steuert die Anzahl der Notizen und -i # Gibt die zu verwendende Instrumentennummer an:
myprogram -n 100 -x -i 24Erstellt die Hex-Byte-Code-MIDI-Datei:
4d 54 68 64 00 00 00 06 00 00 00 01 00 78 4d 54 72 6b 00 00 03 27 00 c0 18
1e 90 4d 2f 1e 90 31 5e 00 90 40 42 1e 90 47 55 1e 90 47 00 00 90 31 00 00
90 32 62 1e 90 43 2d 1e 90 43 00 00 90 3f 5f 1e 90 32 00 1e 90 4d 00 00 90
47 38 1e 90 51 33 1e 90 40 00 00 90 31 31 00 90 35 3a 1e 90 24 41 00 90 4d
4f 00 90 4e 32 1e 90 31 00 00 90 51 00 1e 90 4e 00 00 90 48 51 1e 90 3f 00
00 90 24 00 1e 90 47 00 1e 90 35 00 00 90 2c 61 1e 90 4d 63 3c 90 4d 00 00
90 48 00 00 90 33 30 1e 90 2c 00 00 90 4d 00 00 90 40 5f 00 90 45 5f 00 90
3e 58 00 90 3f 45 00 90 24 4a 1e 90 33 00 00 90 3c 3c 1e 90 32 38 1e 90 39
40 1e 90 53 43 1e 90 40 00 00 90 3f 00 00 90 3e 00 00 90 45 00 00 90 4d 62
1e 90 24 00 00 90 32 00 00 90 30 42 00 90 2d 28 1e 90 3c 00 00 90 4d 00 00
90 53 00 00 90 2a 45 3c 90 36 51 1e 90 39 00 00 90 2a 00 00 90 36 4b 3c 90
36 00 00 90 3e 5c 1e 90 2d 00 1e 90 30 00 00 90 3e 00 3c 90 41 48 00 90 37
3f 00 90 36 3a 00 90 41 51 00 90 46 38 3c 90 36 00 1e 90 36 00 00 90 46 00
00 90 36 58 1e 90 41 00 00 90 32 44 00 90 47 2a 1e 90 37 00 00 90 45 2b 1e
90 41 53 00 90 3e 2d 1e 90 3e 00 00 90 33 28 00 90 29 4b 1e 90 41 00 00 90
41 00 1e 90 29 00 00 90 49 51 1e 90 47 00 00 90 35 49 00 90 49 43 1e 90 35
00 00 90 45 00 00 90 36 00 00 90 27 5c 1e 90 32 00 1e 90 49 00 00 90 28 4d
1e 90 49 00 00 90 33 00 00 90 2e 44 1e 90 29 2b 3c 90 27 00 00 90 24 3e 00
90 28 53 00 90 52 51 1e 90 4d 4f 00 90 26 5c 1e 90 28 00 00 90 29 00 00 90
27 32 1e 90 28 00 00 90 2e 00 00 90 4d 00 1e 90 2f 28 1e 90 4a 5a 00 90 47
43 1e 90 4a 00 00 90 52 00 00 90 24 00 00 90 34 2f 1e 90 2f 00 00 90 3c 5e
00 90 28 4f 00 90 32 2d 1e 90 26 00 00 90 3c 00 00 90 27 00 00 90 53 63 1e
90 47 00 1e 90 32 00 00 90 44 5d 00 90 32 40 1e 90 28 00 00 90 46 46 1e 90
34 00 1e 90 2a 3e 1e 90 53 00 00 90 3a 3f 00 90 53 31 1e 90 28 5f 1e 90 28
00 00 90 46 00 00 90 53 00 00 90 2a 00 1e 90 32 00 00 90 3a 00 00 90 44 00
3c 90 33 4d 1e 90 53 57 00 90 54 30 1e 90 38 45 1e 90 2f 46 1e 90 2f 00 00
90 33 00 1e 90 3a 61 00 90 38 40 1e 90 54 00 00 90 27 37 1e 90 3a 00 00 90
53 00 00 90 32 29 1e 90 38 00 00 90 40 2b 00 90 36 41 1e 90 38 00 00 90 34
46 1e 90 27 00 5a 90 36 00 00 90 32 00 00 90 40 00 00 90 48 4a 5a 90 34 00
00 90 48 00 1e 90 29 62 00 90 3e 4d 1e 90 39 3e 00 90 4a 2d 00 90 40 2d 3c
90 39 00 00 90 4a 00 00 90 25 58 1e 90 29 00 00 90 41 37 00 90 45 4c 00 90
4d 64 1e 90 41 00 00 90 3e 00 1e 90 4d 00 3c 90 40 00 00 90 25 00 00 90 39
4a 3c 90 32 43 1e 90 45 4a 1e 90 45 00 3c 90 45 00 3c 90 32 00 00 90 39 00
00 ff 2f 00
Visualisierung mit bin/mid2svg -s 6 -a 12 -v :

Hier ist ein Beispiel minimales Programm, das die oben genannten HEX-Byte-Codes in eine Standard-MIDI-Datei umwandelt:
# include " MidiFile.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
if (argc != 3 ) return 1 ;
MidiFile midifile;
midifile. read (argv[ 1 ]);
if (midifile. status ()) midifile. write (argv[ 2 ]);
else cerr << " Problem reading MIDI file " << argv[ 1 ] << endl;
} Die MidiFile::read() -Funktion identifiziert automatisch, ob es sich bei der Eingabe um eine binäre Standard-MIDI-Datei, eine Hex-Byte-Code-Darstellung oder eine verallgemeinerte Binasc-Syntaxdatei (die Byte-Codes enthält) handelt. Die MidiFile::status() -Funktion kann nach dem Lesen einer MIDI -Datei überprüft werden, um festzustellen, ob die Datei ohne Probleme gelesen wurde.
In diesem Beispiel wird das MidiFile::getFileDurationInSeconds() verwendet, um die Dauer einer MIDI -Datei zu berechnen. In diesem Beispiel wird auch angezeigt, wie mehrere Eingabedateien verarbeitet werden, wenn die Optionsklasse verwendet wird.
# include " MidiFile.h "
# include " Options.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. process (argc, argv);
MidiFile midifile;
if (options. getArgCount () == 0 ) {
midifile. read (cin);
cout << midifile. getFileDurationInSeconds () << " seconds " << endl;
} else {
int count = options. getArgCount ();
for ( int i= 0 ; i<count; i++) {
string filename = options. getArg (i+ 1 );
if (count > 1 ) cout << filename << " t " ;
midifile. read (filename);
cout << midifile. getFileDurationInSeconds () << " seconds " << endl;
}
}
return 0 ;
} Die Funktion MidiMessage::isText() wird true zurückgegeben, wenn die Nachricht ein Text-Meta-Message ist. Das folgende Programm verschmilzt alle Tracks in eine einzelne Liste und führt eine Schleife auf Textmeta-Messages durch, wodurch sie ausgedruckt werden, wenn sie gefunden werden. Die MidiMessage::getMetaContent() -Funktion extrahiert die Textzeichenfolge der Nachricht aus den RAW MIDI -Datei -Bytes.
# include " MidiFile.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
MidiFile midifile;
if (argc == 1 ) midifile. read (cin);
else midifile. read (argv[ 1 ]);
if (!midifile. status ()) {
cerr << " Problem reading MIDI file " << endl;
return 1 ;
}
midifile. joinTracks ();
for ( int i= 0 ; i<midifile[ 0 ]. getEventCount (); i++) {
if (midifile[ 0 ][i]. isText ()) {
string content = midifile[ 0 ][i]. getMetaContent ();
cout << content << endl;
}
}
return 0 ;
} Das Extrahieren von Texten würde dasselbe funktionieren, wenn .isLyricText() anstelle von .isText() verwendet wird, und ein Track-name-Meta-Message wird von .isTrackName() identifiziert.
Hier finden Sie eine Demonstration, eine Multi-Scrack-MIDI-Datei in eine einzelne MIDI-Datei zu konvertieren:
# include " MidiFile.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
if (argc != 3 ) {
cerr << " Usage: " << argv[ 0 ] << " input output " << endl;
return 1 ;
}
MidiFile midifile;
midifile. read (argv[ 1 ]);
if (!midifile. status ()) {
cerr << " Problem reading MIDI file " << endl;
return 1 ;
}
midifile. joinTracks ();
midifile. write (argv[ 2 ]);
return 0 ;
}
Die Funktion .joinTracks() verbindet alle Tracks in einen einzelnen Track. Und wenn ein MidiFile Objekt nur einen Track hat, wenn es geschrieben wird, wird es als Typ-0-MIDI-Datei (Einzelstrecke) geschrieben.
Im Allgemeinen MIDI -Dateien befindet sich der Drum -Track auf dem 10. Kanal, der durch die Ganzzahl 9 dargestellt wird. Nach dem folgenden Beispiel sucht die MIDI -Ereignisse in jedem Track, bis sie auf Kanal 9 einen Hinweis finden:
# include " MidiFile.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
MidiFile midifile;
if (argc == 1 ) midifile. read (cin);
else midifile. read (argv[ 1 ]);
if (!midifile. status ()) {
cerr << " Problem reading MIDI file " << endl;
return 1 ;
}
bool found = false ;
for ( int i= 0 ; i<midifile. getTrackCount (); i++) {
for ( int j= 0 ; j<midifile[i]. getEventCount (); j++) {
if (midifile[i][j]. isNote ()) {
int channel = midifile[i][j]. getChannelNibble ();
if (channel == 9 ) {
found = true ;
break ;
}
}
}
if (found == true ) break ;
}
if (found) cout << " Has a percussion part. " << endl;
else cout << " Does not have a percussion part. " << endl;
return 0 ;
}Für einige Musikanalyseanwendungen ist es nützlich, Percussion-Notizen aus einer MIDI-Datei zu entfernen. Hier ist ein Beispiel dafür, wie dies mit der Midifile -Bibliothek erfolgen kann.
# include " MidiFile.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
if (argc != 3 ) {
cerr << " Usage: " << argv[ 0 ] << " input output " << endl;
return 1 ;
}
MidiFile midifile;
midifile. read (argv[ 1 ]);
if (!midifile. status ()) {
cerr << " Problem reading MIDI file " << endl;
return 1 ;
}
for ( int i= 0 ; i<midifile. getTrackCount (); i++) {
for ( int j= 0 ; j<midifile[i]. getEventCount (); j++) {
if (midifile[i][j]. isNote ()) {
int channel = midifile[i][j]. getChannelNibble ();
if (channel == 9 ) {
midifile[i][j]. clear ();
}
}
}
}
midifile. removeEmpties (); // optional
midifile. write (argv[ 2 ]);
return 0 ;
} Um eine MIDI -Nachricht zu löschen, löschen Sie die Vektor -Basisklasse. Dadurch wird eine leere MidiEvent im Track hinterlassen, aber die MidiFile::write() -Funktion ignoriert jede leere MidiMessage . Die MidiFile::removeEmpties() -Funktion kann aufgerufen werden, um leere MidiEvents aus der Spur explizit zu entfernen.
Dieses Beispiel zeigt, wie Sie Notizen in einer MIDI -Datei übertragen. Es ist darauf zu achten, dass der Umzug von Channel 10 im Allgemeinen MIDI nicht vorhanden ist, da dies der Drum Track reserviert ist (und die meisten MIDI -Dateien verwenden die allgemeine MIDI -Konvention).
# include " MidiFile.h "
# include " Options.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. define ( " t|transpose=i:0 " , " Semitones to transpose by " );
options. process (argc, argv);
MidiFile midifile;
if (options. getArgCount () == 0 ) midifile. read (cin);
else midifile. read (options. getArg ( 1 ));
if (!midifile. status ()) {
cerr << " Could not read MIDI file " << endl;
return 1 ;
}
int transpose = options. getInteger ( " transpose " );
for ( int i= 0 ; i<midifile. getTrackCount (); i++) {
for ( int j= 0 ; j<midifile[i]. getEventCount (); j++) {
if (!midifile[i][j]. isNote ()) continue ;
if (midifile[i][j]. getChannel () == 9 ) continue ;
int newkey = transpose + midifile[i][j]. getP1 ();
midifile[i][j]. setP1 (newkey);
}
}
if (options. getArgCount () < 2 ) cout << midifile;
else midifile. write (options. getArg ( 2 ));
return 0 ;
}Das folgende Beispiel listet alle in einer MIDI -Datei verwendeten Instrumentennummern auf. Es analysiert die Drum -Spur nicht.
# include " MidiFile.h "
# include " Options.h "
# include < set >
# include < utility >
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. process (argc, argv);
MidiFile midifile;
if (options. getArgCount () == 0 ) midifile. read (cin);
else midifile. read (options. getArg ( 1 ));
if (!midifile. status ()) {
cerr << " Could not read MIDI file " << endl;
return 1 ;
}
pair< int , int > trackinst;
set<pair< int , int >> iset;
for ( int i= 0 ; i<midifile. getTrackCount (); i++) {
for ( int j= 0 ; j<midifile[i]. getEventCount (); j++) {
if (midifile[i][j]. isTimbre ()) {
trackinst. first = i;
trackinst. second = midifile[i][j]. getP1 ();
iset. insert (trackinst);
}
}
}
for ( auto it : iset)
cout << " Track: " << it. first << " t Instrument: " << it. second << endl;
return 0 ;
}Wenn Sie die Temperamente in einer Standard -MIDI -Datei ohne Synthesizer simulieren möchten, die speziell über Temperamente weiß, ist dieses Beispiel nützlich. Jede Pitch-Klasse wird in einen separaten Track und MIDI-Kanal gelegt. Anschließend wird eine Pitch-Bend-Nachricht zu Beginn jeder Spur in jedem Kanal hinzugefügt, um das Temperament zu steuern. Es wird darauf geachtet, Midi Channel 10 zu vermeiden, der den Percussion Timbres im Allgemeinen MIDI vorbehalten ist.
# include " MidiFile.h "
# include < iostream >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
if (argc != 3 ) {
cerr << " Usage: " << argv[ 0 ] << " input output " << endl;
return 1 ;
}
MidiFile midifile;
midifile. read (argv[ 1 ]);
if (!midifile. status ()) {
cerr << " Problem reading MIDI file " << endl;
return 1 ;
}
midifile. joinTracks ();
for ( int i= 0 ; i<midifile[ 0 ]. getEventCount (); i++) {
midifile[ 0 ][i]. seq = 2 ;
if (!midifile[ 0 ][i]. isNote ()) {
midifile[ 0 ][i]. track = 0 ;
continue ;
}
int pc = midifile[ 0 ][i]. getP1 () % 12 ;
int channel = midifile[ 0 ][i]. getChannelNibble ();
if (channel != 9 ) {
midifile[ 0 ][i]. track = pc + 1 ;
if (pc >= 9 ) pc++;
midifile[ 0 ][i]. setChannelNibble (pc);
} else midifile[ 0 ][i]. track = 13 ;
}
midifile. splitTracks ();
double maxbend = 200.0 ; // typical pitch-bend depth in cents on synthesizers
// pythagorean tuning deviations from equal temperament in cents.
vector< double > pythagorean = {- 3.91 , 9.78 , 0.00 , - 9.78 , 3.91 , - 5.87 , 7.82 ,
- 1.96 , - 11.73 , 1.96 , - 7.82 , 5.87 };
for ( int i= 0 ; i< 12 ; i++) {
int maxtrack = midifile. getTrackCount ();
int track = i+ 1 ;
if (track >= maxtrack) break ;
int channel = i;
if (i >= 9 ) channel++;
double bend = pythagorean[i] / maxbend;
MidiEvent* me = midifile. addPitchBend (track, 0 , channel, bend);
me-> seq = 1 ;
}
midifile. sortTracks ();
midifile. write (argv[ 2 ]);
return 0 ;
} Die MidiFile::splitTracks() -Funktion erzeugt 13 oder 14 Tracks. Track 0 enthält alle nicht-benachrichtigen MIDI-Nachrichten aus der Originaldatei, während die Tracks 1 bis 12 Anmerkungen einer bestimmten Tonhöhenklasse auf den MIDI-Kanälen 1-12 enthalten, übersprungen Kanal 10 (allgemeiner MIDI-Percussion-Kanal). Percussionsnotizen werden in Track 13 platziert, bleiben jedoch auf Kanal 10.
Die Verwendung von MidiEvent::seq wird im Programm auf 1 und 2 eingestellt, um die ersten Notizen zur Tick -Zeit 0 zu erzwingen, die nach den Pitch -Bend -Nachrichten platziert werden sollen, wenn MidiFile::sortTracks() aufgerufen wird (Ereignisse mit einer niedrigeren Sequenznummer werden vor denen mit einer höheren Nummer auftreten, wenn sie bei der gleichzeitigen Spur in der Spur in der Spur in der Spur in der Spur in der Spur in der Spur) auftreten). Die Pitch-Bend-Nachrichten würden wahrscheinlich sowieso vor den Notizen sortiert, aber die Verwendung von seq sollte garantieren, dass sie vor den ersten Noten platziert werden.
Probieren Sie dieses Programm zu Bachs gut gelauntem Clavier, Buch I, Fuge Nr. 4 in C-Sharp-Moll:
4d 54 68 64 00 00 00 06 00 01 00 06 00 78 4d 54 72 6b 00 00 00 13 00 ff 51 03 08 8e 6c 00 ff 58 04 02 01 30 08 00 ff 2f
00 4d 54 72 6b 00 00 09 bd b2 50 90 49 40 81 70 80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 81 70 80 4c 40 00 90 4b
40 83 60 80 4b 40 00 90 49 40 82 68 80 49 40 00 90 4b 40 78 80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4b 40 78 80 4b 40 00
90 49 40 81 70 80 49 40 00 90 47 40 81 70 80 47 40 00 90 49 40 81 70 80 49 40 00 90 4b 40 81 70 80 4b 40 82 68 90 4c 40
78 80 4c 40 00 90 4b 40 78 80 4b 40 00 90 49 40 78 80 49 40 00 90 47 40 78 80 47 40 00 90 4b 40 78 80 4b 40 00 90 50 40
82 68 80 50 40 00 90 4e 40 78 80 4e 40 00 90 50 40 78 80 50 40 00 90 51 40 78 80 51 40 00 90 53 40 84 58 80 53 40 00 90
51 40 78 80 51 40 00 90 50 40 78 80 50 40 00 90 4e 40 78 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90
4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 83 60 80 49 40 00 90 47 40 82 68 80 47 40 00 90 49 40 78 80 49 40
00 90 47 40 78 80 47 40 00 90 45 40 78 80 45 40 00 90 44 40 81 70 80 44 40 00 90 46 40 78 80 46 40 00 90 47 40 78 80 47
40 00 90 49 40 81 70 80 49 40 00 90 47 40 83 60 80 47 40 00 90 46 40 81 70 80 46 40 00 90 47 40 84 58 80 47 40 00 90 49
40 78 80 49 40 00 90 4b 40 78 80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4c 40 81 70 80 4c 40 00 90 4b 40 81 70 80 4b 40 00
90 4c 40 78 80 4c 40 00 90 4b 40 78 80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4e 40 78 80 4e 40 00 90 50 40 3c 80 50 40 00
90 4e 40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 51 40 3c 80 51 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00
90 4c 40 3c 80 4c 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4e 40 3c 80 4e 40 00
90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4e 40 3c 80 4e 40 00
90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4c 40 3c 80 4c 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00
90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00
90 4b 40 3c 80 4b 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00
90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40 00
90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 46 40 3c 80 46 40 00 90 49 40 3c 80 49 40 00 90 47 40 82 2c 80 47 40
00 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40 00 90 47 40 3c 80 47 40 00 90 49 40 82 68 80 49 40 00 90 4c 40 78 80 4c
40 00 90 4b 40 82 68 80 4b 40 00 90 4e 40 78 80 4e 40 00 90 4c 40 84 58 80 4c 40 00 90 4b 40 81 70 80 4b 40 00 90 49 40
81 70 80 49 40 00 90 48 40 3c 80 48 40 00 90 46 40 3c 80 46 40 00 90 48 40 78 80 48 40 00 90 4b 40 78 80 4b 40 00 90 50
40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 51 40 3c 80 51 40 00 90 50 40 3c 80 50 40 00 90 4e
40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4e
40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4e
40 3c 80 4e 40 00 90 4d 40 81 70 80 4d 40 00 90 51 40 81 70 80 51 40 00 90 50 40 84 58 80 50 40 00 90 4e 40 3c 80 4e 40
00 90 4c 40 3c 80 4c 40 00 90 4a 40 81 70 80 4a 40 78 90 49 40 78 80 49 40 00 90 4e 40 78 80 4e 40 00 90 4e 40 78 80 4e
40 00 90 4e 40 78 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 4c 40 82 68 80 4c 40 00 90 4a 40 3c 80
4a 40 00 90 49 40 3c 80 49 40 00 90 4a 40 83 60 80 4a 40 00 90 49 40 81 70 80 49 40 00 90 4e 40 81 70 80 4e 40 00 90 4c
40 81 70 80 4c 40 00 90 4c 40 81 34 80 4c 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00
90 49 40 3c 80 49 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 4a 40 3c 80 4a 40 00
90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 4a 40 3c 80 4a 40 00
90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 81 70 80 4c 40 00 90 4b 40 84 58 80 4b 40 00 90 44 40 78
80 44 40 00 90 49 40 78 80 49 40 00 90 49 40 78 80 49 40 00 90 49 40 78 80 49 40 00 90 47 40 3c 80 47 40 00 90 45 40 3c
80 45 40 00 90 47 40 83 60 80 47 40 00 90 45 40 81 70 80 45 40 00 90 44 40 81 70 80 44 40 81 70 90 4b 40 83 60 80 4b 40
00 90 4a 40 81 70 80 4a 40 00 90 4e 40 81 70 80 4e 40 00 90 4d 40 81 70 80 4d 40 00 90 4c 40 81 70 80 4c 40 00 90 4b 40
3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40
3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 49 40
3c 80 49 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40
3c 80 49 40 00 90 48 40 81 70 80 48 40 00 90 47 40 81 70 80 47 40 00 90 46 40 81 70 80 46 40 00 90 45 40 81 70 80 45 40
00 90 44 40 81 70 80 44 40 89 30 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 81 70 80 4c 40 00 90 4b
40 85 50 80 4b 40 00 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 78 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40
00 90 4c 40 78 80 4c 40 00 90 4e 40 78 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 50 40 3c 80 50 40
00 90 51 40 3c 80 51 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 50 40 3c 80 50 40
00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4e 40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40
00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40
00 90 4c 40 3c 80 4c 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40
00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 4a 40 3c 80 4a 40 00 90 4c 40 3c 80 4c 40
00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40
00 90 47 40 3c 80 47 40 00 90 49 40 3c 80 49 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40
00 90 45 40 3c 80 45 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 45 40 3c 80 45 40 00 90 47 40 3c 80 47 40
00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 45 40 3c 80 45 40 00 90 44 40 3c 80 44 40 00 90 47 40 3c 80 47 40
00 90 45 40 81 70 80 45 40 81 70 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 81 70 80 4c 40 00 90 4b
40 84 58 80 4b 40 00 90 49 40 78 80 49 40 00 90 50 40 78 80 50 40 00 90 50 40 78 80 50 40 00 90 50 40 78 80 50 40 00 90
4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4e 40 81 70 80 4e 40 00 90 4c 40 83 60 80 4c 40 00 90 4b 40 81 70 80 4b
40 00 90 4f 40 81 70 80 4f 40 00 90 4e 40 81 70 80 4e 40 00 90 42 40 81 70 80 42 40 00 90 41 40 81 70 80 41 40 00 90 45
40 81 70 80 45 40 00 90 44 40 78 80 44 40 83 60 90 48 40 78 80 48 40 00 90 4e 40 78 80 4e 40 00 90 4e 40 78 80 4e 40 00
90 4e 40 78 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4b 40 3c 80 4b 40 00
90 49 40 3c 80 49 40 00 90 4b 40 78 80 4b 40 00 90 48 40 78 80 48 40 00 90 49 40 85 50 80 49 40 00 90 48 40 81 70 80 48
40 00 90 47 40 81 70 80 47 40 00 90 46 40 81 70 80 46 40 00 90 45 40 81 70 80 45 40 00 90 44 40 83 60 80 44 40 00 90 46
40 81 70 80 46 40 00 90 48 40 81 70 80 48 40 00 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 83 60 80
4c 40 00 90 4b 40 78 80 4b 40 00 90 49 40 78 80 49 40 00 90 48 40 81 70 80 48 40 00 90 49 40 83 60 80 49 40 00 90 48 40
81 70 80 48 40 00 90 49 40 8f 00 80 49 40 77 90 00 00 00 ff 2f 00 4d 54 72 6b 00 00 09 40 ab 10 91 44 40 81 70 81 44 40
00 91 41 40 81 70 81 41 40 00 91 45 40 81 70 81 45 40 00 91 44 40 81 70 81 44 40 00 91 42 40 83 60 81 42 40 00 91 49 40
83 60 81 49 40 00 91 47 40 83 60 81 47 40 00 91 45 40 81 70 81 45 40 00 91 44 40 81 70 81 44 40 00 91 45 40 82 68 81 45
40 00 91 44 40 78 81 44 40 00 91 42 40 78 81 42 40 00 91 40 40 78 81 40 40 00 91 3f 40 81 70 81 3f 40 00 91 44 40 81 70
81 44 40 00 91 44 40 81 70 81 44 40 00 91 43 40 81 70 81 43 40 00 91 44 40 81 70 81 44 40 00 91 3b 40 81 70 81 3b 40 00
91 3d 40 82 68 81 3d 40 00 91 3d 40 78 81 3d 40 00 91 3f 40 78 81 3f 40 00 91 3d 40 78 81 3d 40 00 91 3f 40 78 81 3f 40
00 91 41 40 78 81 41 40 00 91 42 40 81 70 81 42 40 00 91 45 40 81 70 81 45 40 00 91 44 40 81 70 81 44 40 3c 91 47 40 3c
81 47 40 00 91 45 40 3c 81 45 40 00 91 44 40 3c 81 44 40 00 91 42 40 78 81 42 40 00 91 45 40 78 81 45 40 00 91 44 40 78
81 44 40 00 91 42 40 78 81 42 40 00 91 41 40 81 70 81 41 40 00 91 42 40 82 68 81 42 40 00 91 40 40 84 58 81 40 40 00 91
3f 40 81 70 81 3f 40 00 91 40 40 84 58 81 40 40 00 91 3f 40 78 81 3f 40 00 91 40 40 78 81 40 40 00 91 42 40 3c 81 42 40
00 91 44 40 3c 81 44 40 00 91 42 40 81 70 81 42 40 00 91 47 40 82 68 81 47 40 00 91 49 40 78 81 49 40 00 91 47 40 78 81
47 40 00 91 45 40 78 81 45 40 00 91 44 40 81 70 81 44 40 a1 60 91 49 40 81 70 81 49 40 00 91 48 40 81 70 81 48 40 00 91
4c 40 81 70 81 4c 40 00 91 4b 40 85 50 81 4b 40 00 91 49 40 83 60 81 49 40 00 91 48 40 78 81 48 40 00 91 47 40 81 34 81
47 40 00 91 47 40 3c 81 47 40 00 91 49 40 3c 81 49 40 00 91 4a 40 3c 81 4a 40 00 91 49 40 3c 81 49 40 00 91 47 40 3c 81
47 40 00 91 45 40 3c 81 45 40 00 91 49 40 3c 81 49 40 00 91 47 40 3c 81 47 40 00 91 45 40 3c 81 45 40 00 91 47 40 3c 81
47 40 00 91 49 40 3c 81 49 40 00 91 47 40 3c 81 47 40 00 91 45 40 3c 81 45 40 00 91 44 40 3c 81 44 40 00 91 47 40 3c 81
47 40 00 91 45 40 82 2c 81 45 40 00 91 49 40 3c 81 49 40 00 91 47 40 3c 81 47 40 00 91 45 40 3c 81 45 40 00 91 44 40 81
70 81 44 40 87 40 91 45 40 81 70 81 45 40 00 91 44 40 81 70 81 44 40 00 91 49 40 81 70 81 49 40 00 91 47 40 84 58 81 47
40 00 91 40 40 78 81 40 40 00 91 45 40 78 81 45 40 00 91 45 40 78 81 45 40 00 91 45 40 78 81 45 40 00 91 44 40 3c 81 44
40 00 91 42 40 3c 81 42 40 00 91 44 40 82 68 81 44 40 00 91 3d 40 3c 81 3d 40 00 91 3f 40 3c 81 3f 40 00 91 40 40 78 81
40 40 00 91 42 40 78 81 42 40 00 91 44 40 3c 81 44 40 00 91 42 40 3c 81 42 40 00 91 44 40 3c 81 44 40 00 91 45 40 3c 81
45 40 00 91 44 40 3c 81 44 40 00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 44 40 3c 81 44 40 00 91 42 40 3c 81
42 40 00 91 40 40 3c 81 40 40 00 91 42 40 3c 81 42 40 00 91 44 40 3c 81 44 40 00 91 42 40 3c 81 42 40 00 91 40 40 3c 81
40 40 00 91 3f 40 3c 81 3f 40 00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 3f 40 3c 81 3f 40 00 91 40 40 3c 81
40 40 00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 3f 40 3c 81 3f 40 00 91 3d 40 3c 81 3d 40 00 91 40 40 3c 81
40 40 00 91 3f 40 3c 81 3f 40 00 91 3d 40 3c 81 3d 40 00 91 3f 40 3c 81 3f 40 00 91 40 40 3c 81 40 40 00 91 3e 40 3c 81
3e 40 00 91 3d 40 3c 81 3d 40 00 91 3b 40 3c 81 3b 40 00 91 3e 40 3c 81 3e 40 00 91 3d 40 3c 81 3d 40 00 91 3b 40 3c 81
3b 40 00 91 3d 40 3c 81 3d 40 00 91 3e 40 3c 81 3e 40 00 91 3d 40 3c 81 3d 40 00 91 40 40 3c 81 40 40 00 91 3f 40 3c 81
3f 40 00 91 3d 40 3c 81 3d 40 00 91 48 40 81 70 81 48 40 00 91 3d 40 81 70 81 3d 40 00 91 3f 40 78 81 3f 40 00 91 3f 40
78 81 3f 40 00 91 44 40 3c 81 44 40 00 91 46 40 3c 81 46 40 00 91 47 40 81 70 81 47 40 00 91 46 40 78 81 46 40 00 91 4b
40 78 81 4b 40 00 91 4b 40 78 81 4b 40 00 91 4b 40 78 81 4b 40 00 91 49 40 3c 81 49 40 00 91 48 40 3c 81 48 40 00 91 49
40 83 60 81 49 40 00 91 47 40 81 70 81 47 40 00 91 46 40 81 70 81 46 40 00 91 45 40 82 68 81 45 40 00 91 3f 40 78 81 3f
40 00 91 44 40 78 81 44 40 00 91 44 40 81 70 81 44 40 00 91 42 40 3c 81 42 40 00 91 41 40 3c 81 41 40 00 91 42 40 83 60
81 42 40 00 91 40 40 81 70 81 40 40 00 91 3f 40 81 70 81 3f 40 00 91 3d 40 81 70 81 3d 40 00 91 3f 40 83 60 81 3f 40 84
58 91 44 40 78 81 44 40 00 91 49 40 78 81 49 40 00 91 49 40 78 81 49 40 00 91 49 40 78 81 49 40 00 91 48 40 3c 81 48 40
00 91 46 40 3c 81 46 40 00 91 48 40 3c 81 48 40 00 91 49 40 3c 81 49 40 00 91 4b 40 3c 81 4b 40 00 91 48 40 3c 81 48 40
00 91 44 40 3c 81 44 40 00 91 42 40 3c 81 42 40 00 91 44 40 3c 81 44 40 00 91 45 40 3c 81 45 40 00 91 44 40 3c 81 44 40
00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 44 40 3c 81 44 40 00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40
00 91 42 40 3c 81 42 40 00 91 44 40 3c 81 44 40 00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 3f 40 3c 81 3f 40
00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 44 40 3c 81 44 40 00 91 45 40 3c 81 45 40 00 91 47 40 3c 81 47 40
00 91 49 40 3c 81 49 40 00 91 4b 40 3c 81 4b 40 00 91 48 40 3c 81 48 40 00 91 49 40 3c 81 49 40 00 91 4b 40 78 81 4b 40
8b 20 91 42 40 78 81 42 40 00 91 47 40 78 81 47 40 00 91 47 40 78 81 47 40 00 91 47 40 78 81 47 40 00 91 45 40 3c 81 45
40 00 91 44 40 3c 81 44 40 00 91 45 40 81 70 81 45 40 00 91 44 40 84 1c 81 44 40 00 91 44 40 3c 81 44 40 00 91 42 40 3c
81 42 40 00 91 41 40 3c 81 41 40 00 91 42 40 81 70 81 42 40 00 91 44 40 82 2c 81 44 40 00 91 44 40 3c 81 44 40 00 91 42
40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 3f 40 3c 81 3f 40 00 91 45 40 3c 81 45 40 00 91 44 40 3c 81 44 40 00 91 42
40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 44 40 3c 81 44 40 00 91 49 40 3c 81 49 40 00 91 47 40 3c 81 47 40 00 91 45
40 3c 81 45 40 00 91 44 40 3c 81 44 40 00 91 45 40 3c 81 45 40 00 91 42 40 3c 81 42 40 00 91 44 40 82 68 81 44 40 00 91
49 40 3c 81 49 40 00 91 48 40 3c 81 48 40 00 91 49 40 82 68 81 49 40 00 91 46 40 78 81 46 40 00 91 4b 40 78 81 4b 40 00
91 4b 40 78 81 4b 40 00 91 4b 40 78 81 4b 40 00 91 49 40 3c 81 49 40 00 91 47 40 3c 81 47 40 00 91 49 40 81 70 81 49 40
00 91 47 40 81 70 81 47 40 00 91 47 40 81 70 81 47 40 00 91 46 40 81 70 81 46 40 00 91 4a 40 81 70 81 4a 40 00 91 49 40
83 60 81 49 40 78 91 44 40 78 81 44 40 00 91 49 40 78 81 49 40 00 91 49 40 78 81 49 40 00 91 49 40 78 81 49 40 00 91 48
40 3c 81 48 40 00 91 46 40 3c 81 46 40 00 91 48 40 3c 81 48 40 00 91 49 40 3c 81 49 40 00 91 4b 40 81 70 81 4b 40 00 91
49 40 3c 81 49 40 00 91 48 40 3c 81 48 40 00 91 49 40 81 70 81 49 40 00 91 42 40 81 70 81 42 40 00 91 44 40 83 60 81 44
40 00 91 42 40 82 68 81 42 40 82 68 91 44 40 78 81 44 40 00 91 42 40 3c 81 42 40 00 91 40 40 3c 81 40 40 00 91 42 40 78
81 42 40 00 91 42 40 78 81 42 40 00 91 42 40 78 81 42 40 00 91 40 40 3c 81 40 40 00 91 3f 40 3c 81 3f 40 00 91 40 40 82
68 81 40 40 00 91 42 40 3c 81 42 40 00 91 44 40 3c 81 44 40 00 91 45 40 78 81 45 40 00 91 44 40 81 70 81 44 40 00 91 40
40 78 81 40 40 00 91 45 40 78 81 45 40 00 91 45 40 78 81 45 40 00 91 45 40 78 81 45 40 00 91 44 40 3c 81 44 40 00 91 42
40 3c 81 42 40 00 91 44 40 78 81 44 40 00 91 46 40 3c 81 46 40 00 91 48 40 3c 81 48 40 00 91 49 40 81 70 81 49 40 00 91
46 40 81 70 81 46 40 00 91 44 40 81 70 81 44 40 00 91 44 40 85 50 81 44 40 00 91 44 40 81 70 81 44 40 00 91 42 40 81 70
81 42 40 00 91 41 40 81 70 81 41 40 00 91 45 40 81 70 81 45 40 00 91 44 40 87 40 81 44 40 77 90 00 00 00 ff 2f 00 4d 54
72 6b 00 00 08 ba 98 30 92 3d 40 81 70 82 3d 40 00 92 3c 40 81 70 82 3c 40 00 92 40 40 81 70 82 40 40 00 92 3f 40 83 60
82 3f 40 00 92 3d 40 81 70 82 3d 40 00 92 42 40 82 68 82 42 40 00 92 40 40 78 82 40 40 00 92 3f 40 78 82 3f 40 00 92 3d
40 78 82 3d 40 00 92 3d 40 81 70 82 3d 40 00 92 3b 40 81 70 82 3b 40 00 92 3d 40 81 70 82 3d 40 00 92 42 40 82 68 82 42
40 00 92 40 40 78 82 40 40 00 92 3f 40 78 82 3f 40 00 92 3d 40 78 82 3d 40 00 92 3f 40 81 70 82 3f 40 00 92 44 40 81 70
82 44 40 78 92 45 40 78 82 45 40 00 92 44 40 78 82 44 40 00 92 42 40 78 82 42 40 00 92 41 40 78 82 41 40 00 92 3d 40 78
82 3d 40 00 92 42 40 81 70 82 42 40 00 92 40 40 85 50 82 40 40 00 92 44 40 81 70 82 44 40 00 92 46 40 81 70 82 46 40 92
60 92 3d 40 81 70 82 3d 40 00 92 3c 40 81 70 82 3c 40 00 92 40 40 81 70 82 40 40 00 92 3f 40 83 60 82 3f 40 00 92 3d 40
87 40 82 3d 40 00 92 36 40 78 82 36 40 00 92 38 40 78 82 38 40 00 92 3a 40 78 82 3a 40 00 92 3b 40 78 82 3b 40 00 92 3d
40 83 60 82 3d 40 81 70 92 40 40 81 70 82 40 40 00 92 3f 40 81 70 82 3f 40 00 92 44 40 81 70 82 44 40 00 92 42 40 83 60
82 42 40 00 92 40 40 81 70 82 40 40 8b 20 92 44 40 81 70 82 44 40 00 92 43 40 81 70 82 43 40 00 92 47 40 81 70 82 47 40
00 92 46 40 84 58 82 46 40 00 92 3f 40 78 82 3f 40 00 92 44 40 82 68 82 44 40 00 92 42 40 3c 82 42 40 00 92 40 40 3c 82
40 40 00 92 42 40 82 68 82 42 40 00 92 40 40 3c 82 40 40 00 92 42 40 3c 82 42 40 00 92 44 40 89 30 82 44 40 8c 18 92 3d
40 78 82 3d 40 00 92 42 40 78 82 42 40 00 92 42 40 78 82 42 40 00 92 42 40 78 82 42 40 00 92 41 40 3c 82 41 40 00 92 3f
40 3c 82 3f 40 00 92 41 40 81 70 82 41 40 00 92 42 40 78 82 42 40 00 92 36 40 3c 82 36 40 00 92 38 40 3c 82 38 40 00 92
39 40 78 82 39 40 00 92 3b 40 78 82 3b 40 00 92 3d 40 3c 82 3d 40 00 92 3b 40 3c 82 3b 40 00 92 3d 40 3c 82 3d 40 00 92
3e 40 3c 82 3e 40 00 92 3d 40 3c 82 3d 40 00 92 3b 40 3c 82 3b 40 00 92 39 40 3c 82 39 40 00 92 3d 40 3c 82 3d 40 00 92
3b 40 3c 82 3b 40 00 92 39 40 3c 82 39 40 00 92 3b 40 3c 82 3b 40 00 92 3d 40 3c 82 3d 40 00 92 3b 40 3c 82 3b 40 00 92
39 40 3c 82 39 40 00 92 38 40 3c 82 38 40 00 92 3b 40 3c 82 3b 40 00 92 39 40 3c 82 39 40 00 92 38 40 3c 82 38 40 00 92
39 40 3c 82 39 40 00 92 3b 40 3c 82 3b 40 00 92 39 40 3c 82 39 40 00 92 3b 40 3c 82 3b 40 00 92 3d 40 3c 82 3d 40 00 92
3e 40 3c 82 3e 40 00 92 40 40 3c 82 40 40 00 92 3e 40 3c 82 3e 40 00 92 40 40 3c 82 40 40 00 92 42 40 3c 82 42 40 00 92
40 40 3c 82 40 40 00 92 3e 40 3c 82 3e 40 00 92 3d 40 3c 82 3d 40 00 92 40 40 3c 82 40 40 00 92 3e 40 3c 82 3e 40 00 92
3d 40 3c 82 3d 40 00 92 3e 40 3c 82 3e 40 00 92 40 40 3c 82 40 40 00 92 3e 40 3c 82 3e 40 00 92 3d 40 3c 82 3d 40 00 92
3b 40 3c 82 3b 40 00 92 3e 40 3c 82 3e 40 00 92 3d 40 3c 82 3d 40 00 92 3b 40 3c 82 3b 40 00 92 3d 40 3c 82 3d 40 00 92
3e 40 3c 82 3e 40 00 92 3d 40 3c 82 3d 40 00 92 3b 40 3c 82 3b 40 00 92 39 40 3c 82 39 40 00 92 3d 40 3c 82 3d 40 00 92
3b 40 83 60 82 3b 40 00 92 39 40 3c 82 39 40 00 92 38 40 3c 82 38 40 00 92 36 40 3c 82 36 40 00 92 34 40 3c 82 34 40 00
92 33 40 3c 82 33 40 00 92 31 40 3c 82 31 40 00 92 30 40 3c 82 30 40 00 92 31 40 3c 82 31 40 00 92 33 40 81 70 82 33 40
8e 08 92 31 40 78 82 31 40 00 92 36 40 78 82 36 40 00 92 36 40 78 82 36 40 00 92 36 40 78 82 36 40 00 92 34 40 3c 82 34
40 00 92 33 40 3c 82 33 40 00 92 34 40 81 70 82 34 40 00 92 37 40 81 70 82 37 40 00 92 38 40 81 70 82 38 40 00 92 35 40
78 82 35 40 87 40 92 33 40 78 82 33 40 00 92 38 40 78 82 38 40 00 92 38 40 78 82 38 40 00 92 38 40 78 82 38 40 00 92 36
40 3c 82 36 40 00 92 34 40 3c 82 34 40 00 92 36 40 82 2c 82 36 40 00 92 39 40 3c 82 39 40 00 92 38 40 3c 82 38 40 00 92
36 40 3c 82 36 40 00 92 35 40 3c 82 35 40 00 92 33 40 3c 82 33 40 00 92 35 40 3c 82 35 40 00 92 31 40 3c 82 31 40 00 92
36 40 3c 82 36 40 00 92 35 40 3c 82 35 40 00 92 36 40 3c 82 36 40 00 92 38 40 3c 82 38 40 00 92 39 40 3c 82 39 40 00 92
38 40 3c 82 38 40 00 92 39 40 3c 82 39 40 00 92 3b 40 3c 82 3b 40 00 92 3d 40 3c 82 3d 40 00 92 3c 40 3c 82 3c 40 00 92
3d 40 3c 82 3d 40 00 92 3f 40 3c 82 3f 40 00 92 40 40 3c 82 40 40 00 92 3f 40 3c 82 3f 40 00 92 40 40 3c 82 40 40 00 92
42 40 3c 82 42 40 00 92 44 40 3c 82 44 40 00 92 42 40 3c 82 42 40 00 92 44 40 3c 82 44 40 00 92 45 40 3c 82 45 40 00 92
44 40 3c 82 44 40 00 92 42 40 3c 82 42 40 00 92 40 40 3c 82 40 40 00 92 44 40 3c 82 44 40 00 92 42 40 3c 82 42 40 00 92
40 40 3c 82 40 40 00 92 42 40 3c 82 42 40 00 92 44 40 3c 82 44 40 00 92 42 40 3c 82 42 40 00 92 40 40 3c 82 40 40 00 92
3f 40 3c 82 3f 40 00 92 42 40 3c 82 42 40 00 92 40 40 3c 82 40 40 00 92 3f 40 3c 82 3f 40 00 92 40 40 3c 82 40 40 00 92
42 40 3c 82 42 40 00 92 40 40 3c 82 40 40 00 92 3f 40 3c 82 3f 40 00 92 3d 40 3c 82 3d 40 00 92 40 40 3c 82 40 40 00 92
3f 40 81 70 82 3f 40 91 68 92 38 40 78 82 38 40 00 92 3d 40 78 82 3d 40 00 92 3d 40 78 82 3d 40 00 92 3d 40 78 82 3d 40
00 92 3c 40 3c 82 3c 40 00 92 3a 40 3c 82 3a 40 00 92 3c 40 81 70 82 3c 40 00 92 3d 40 83 60 82 3d 40 00 92 3b 40 82 68
82 3b 40 00 92 42 40 78 82 42 40 00 92 41 40 81 70 82 41 40 00 92 42 40 81 70 82 42 40 00 92 3b 40 81 70 82 3b 40 00 92
3d 40 84 1c 82 3d 40 00 92 3d 40 3c 82 3d 40 00 92 3b 40 3c 82 3b 40 00 92 39 40 3c 82 39 40 00 92 38 40 83 60 82 38 40
93 58 92 3b 40 78 82 3b 40 00 92 40 40 78 82 40 40 00 92 40 40 78 82 40 40 00 92 40 40 78 82 40 40 00 92 3e 40 3c 82 3e
40 00 92 3d 40 3c 82 3d 40 00 92 3b 40 81 70 82 3b 40 78 92 3d 40 78 82 3d 40 00 92 42 40 78 82 42 40 00 92 42 40 78 82
42 40 00 92 42 40 78 82 42 40 00 92 40 40 3c 82 40 40 00 92 3f 40 3c 82 3f 40 00 92 40 40 81 70 82 40 40 00 92 42 40 83
24 82 42 40 00 92 44 40 3c 82 44 40 00 92 45 40 78 82 45 40 00 92 44 40 3c 82 44 40 00 92 42 40 3c 82 42 40 00 92 44 40
78 82 44 40 00 92 42 40 3c 82 42 40 00 92 40 40 3c 82 40 40 00 92 3f 40 81 70 82 3f 40 00 92 40 40 83 60 82 40 40 00 92
3f 40 78 82 3f 40 00 92 3d 40 78 82 3d 40 00 92 3f 40 78 82 3f 40 00 92 41 40 3c 82 41 40 00 92 42 40 3c 82 42 40 00 92
44 40 78 82 44 40 00 92 44 40 78 82 44 40 78 92 3d 40 78 82 3d 40 00 92 3f 40 78 82 3f 40 00 92 3d 40 78 82 3d 40 00 92
3c 40 81 70 82 3c 40 00 92 3d 40 83 60 82 3d 40 00 92 3f 40 81 70 82 3f 40 00 92 3d 40 78 82 3d 40 00 92 3d 40 78 82 3d
40 00 92 42 40 78 82 42 40 00 92 42 40 78 82 42 40 00 92 42 40 78 82 42 40 00 92 40 40 3c 82 40 40 00 92 3f 40 3c 82 3f
40 00 92 40 40 78 82 40 40 00 92 42 40 3c 82 42 40 00 92 44 40 3c 82 44 40 00 92 46 40 81 70 82 46 40 00 92 3f 40 83 60
82 3f 40 00 92 40 40 81 70 82 40 40 00 92 3f 40 82 68 82 3f 40 00 92 40 40 3c 82 40 40 00 92 42 40 3c 82 42 40 00 92 41
40 78 82 41 40 00 92 3d 40 83 60 82 3d 40 00 92 3d 40 78 82 3d 40 00 92 42 40 78 82 42 40 00 92 42 40 78 82 42 40 00 92
42 40 81 70 82 42 40 00 92 41 40 78 82 41 40 00 92 3f 40 78 82 3f 40 00 92 41 40 83 60 82 41 40 77 90 00 00 00 ff 2f 00
4d 54 72 6b 00 00 07 ac 8b 20 93 38 40 83 60 83 38 40 00 93 37 40 81 70 83 37 40 00 93 3b 40 81 70 83 3b 40 00 93 3a 40
83 60 83 3a 40 00 93 38 40 81 70 83 38 40 00 93 39 40 82 68 83 39 40 00 93 38 40 3c 83 38 40 00 93 36 40 3c 83 36 40 00
93 38 40 78 83 38 40 00 93 3d 40 78 83 3d 40 00 93 36 40 78 83 36 40 00 93 38 40 3c 83 38 40 00 93 39 40 3c 83 39 40 00
93 3b 40 82 68 83 3b 40 00 93 39 40 78 83 39 40 00 93 38 40 78 83 38 40 00 93 36 40 78 83 36 40 00 93 38 40 81 70 83 38
40 00 93 36 40 78 83 36 40 00 93 34 40 78 83 34 40 00 93 33 40 82 68 83 33 40 00 93 32 40 78 83 32 40 00 93 31 40 87 40
83 31 40 90 70 93 38 40 81 70 83 38 40 00 93 37 40 81 70 83 37 40 00 93 3b 40 81 70 83 3b 40 00 93 3a 40 83 60 83 3a 40
00 93 38 40 78 83 38 40 00 93 39 40 78 83 39 40 00 93 38 40 78 83 38 40 00 93 36 40 78 83 36 40 00 93 35 40 81 70 83 35
40 00 93 39 40 81 70 83 39 40 00 93 38 40 83 60 83 38 40 00 93 36 40 84 58 83 36 40 00 93 38 40 3c 83 38 40 00 93 36 40
3c 83 36 40 00 93 34 40 78 83 34 40 00 93 36 40 3c 83 36 40 00 93 38 40 3c 83 38 40 00 93 39 40 78 83 39 40 00 93 36 40
78 83 36 40 00 93 38 40 81 70 83 38 40 00 93 31 40 89 30 83 31 40 00 93 36 40 81 70 83 36 40 00 93 34 40 78 83 34 40 00
93 33 40 78 83 33 40 00 93 34 40 78 83 34 40 00 93 36 40 78 83 36 40 00 93 38 40 78 83 38 40 00 93 36 40 78 83 36 40 00
93 38 40 78 83 38 40 00 93 39 40 78 83 39 40 00 93 3b 40 89 30 83 3b 40 00 93 3d 40 81 70 83 3d 40 00 93 3c 40 81 70 83
3c 40 00 93 40 40 81 70 83 40 40 00 93 3f 40 83 60 83 3f 40 00 93 3d 40 84 58 83 3d 40 00 93 3b 40 78 83 3b 40 00 93 3a
40 78 83 3a 40 00 93 38 40 81 70 83 38 40 00 93 37 40 3c 83 37 40 00 93 35 40 3c 83 35 40 00 93 37 40 81 70 83 37 40 00
93 38 40 3c 83 38 40 00 93 3a 40 3c 83 3a 40 00 93 38 40 3c 83 38 40 00 93 37 40 3c 83 37 40 00 93 38 40 3c 83 38 40 00
93 3a 40 3c 83 3a 40 00 93 3b 40 3c 83 3b 40 00 93 38 40 3c 83 38 40 00 93 39 40 3c 83 39 40 00 93 3b 40 3c 83 3b 40 00
93 39 40 3c 83 39 40 00 93 38 40 3c 83 38 40 00 93 3a 40 3c 83 3a 40 00 93 3b 40 3c 83 3b 40 00 93 3d 40 3c 83 3d 40 00
93 3a 40 3c 83 3a 40 00 93 3b 40 3c 83 3b 40 00 93 3d 40 3c 83 3d 40 00 93 3b 40 3c 83 3b 40 00 93 3a 40 3c 83 3a 40 00
93 3c 40 3c 83 3c 40 00 93 3d 40 3c 83 3d 40 00 93 3f 40 3c 83 3f 40 00 93 3c 40 3c 83 3c 40 00 93 3d 40 83 60 83 3d 40
98 30 93 36 40 81 70 83 36 40 00 93 35 40 81 70 83 35 40 00 93 39 40 81 70 83 39 40 00 93 38 40 83 60 83 38 40 00 93 36
40 83 60 83 36 40 93 58 93 38 40 78 83 38 40 00 93 3d 40 78 83 3d 40 00 93 3d 40 78 83 3d 40 00 93 3d 40 78 83 3d 40 00
93 3c 40 3c 83 3c 40 00 93 3a 40 3c 83 3a 40 00 93 3c 40 81 70 83 3c 40 00 93 3d 40 81 70 83 3d 40 00 93 39 40 81 70 83
39 40 00 93 36 40 81 70 83 36 40 00 93 38 40 81 70 83 38 40 00 93 35 40 81 70 83 35 40 00 93 36 40 81 70 83 36 40 00 93
38 40 83 60 83 38 40 00 93 33 40 83 60 83 33 40 9b 18 93 2c 40 78 83 2c 40 00 93 31 40 78 83 31 40 00 93 31 40 78 83 31
40 00 93 31 40 78 83 31 40 00 93 30 40 3c 83 30 40 00 93 2e 40 3c 83 2e 40 00 93 30 40 81 70 83 30 40 00 93 31 40 81 70
83 31 40 90 70 93 31 40 83 60 83 31 40 00 93 30 40 81 70 83 30 40 00 93 34 40 81 70 83 34 40 00 93 33 40 83 60 83 33 40
00 93 31 40 78 83 31 40 00 93 34 40 78 83 34 40 00 93 39 40 78 83 39 40 00 93 39 40 78 83 39 40 00 93 39 40 78 83 39 40
00 93 38 40 3c 83 38 40 00 93 36 40 3c 83 36 40 00 93 38 40 83 60 83 38 40 00 93 36 40 81 70 83 36 40 00 93 38 40 83 60
83 38 40 00 93 39 40 81 70 83 39 40 00 93 36 40 82 2c 83 36 40 00 93 36 40 3c 83 36 40 00 93 34 40 3c 83 34 40 00 93 33
40 3c 83 33 40 00 93 34 40 78 83 34 40 00 93 31 40 78 83 31 40 00 93 38 40 83 60 83 38 40 00 93 36 40 81 70 83 36 40 00
93 33 40 81 70 83 33 40 00 93 34 40 3c 83 34 40 00 93 33 40 3c 83 33 40 00 93 34 40 3c 83 34 40 00 93 36 40 3c 83 36 40
00 93 34 40 3c 83 34 40 00 93 33 40 3c 83 33 40 00 93 31 40 3c 83 31 40 00 93 34 40 3c 83 34 40 00 93 33 40 3c 83 33 40
00 93 31 40 3c 83 31 40 00 93 33 40 3c 83 33 40 00 93 34 40 3c 83 34 40 00 93 33 40 3c 83 33 40 00 93 31 40 3c 83 31 40
00 93 30 40 3c 83 30 40 00 93 33 40 3c 83 33 40 00 93 31 40 78 83 31 40 00 93 34 40 78 83 34 40 00 93 39 40 78 83 39 40
00 93 39 40 78 83 39 40 00 93 39 40 78 83 39 40 00 93 37 40 3c 83 37 40 00 93 36 40 3c 83 36 40 00 93 34 40 81 70 83 34
40 78 93 36 40 78 83 36 40 00 93 3b 40 78 83 3b 40 00 93 3b 40 78 83 3b 40 00 93 3b 40 78 83 3b 40 00 93 39 40 3c 83 39
40 00 93 38 40 3c 83 38 40 00 93 39 40 3c 83 39 40 00 93 38 40 3c 83 38 40 00 93 36 40 3c 83 36 40 00 93 34 40 3c 83 34
40 00 93 33 40 81 70 83 33 40 78 93 38 40 78 83 38 40 00 93 3f 40 78 83 3f 40 00 93 3f 40 78 83 3f 40 00 93 3f 40 78 83
3f 40 00 93 3d 40 3c 83 3d 40 00 93 3c 40 3c 83 3c 40 00 93 3d 40 83 60 83 3d 40 00 93 3c 40 81 70 83 3c 40 00 93 40 40
82 68 83 40 40 00 93 31 40 78 83 31 40 00 93 36 40 78 83 36 40 00 93 36 40 78 83 36 40 00 93 36 40 78 83 36 40 00 93 35
40 3c 83 35 40 00 93 33 40 3c 83 33 40 00 93 31 40 83 60 83 31 40 00 93 33 40 82 68 83 33 40 00 93 33 40 78 83 33 40 00
93 38 40 78 83 38 40 00 93 38 40 78 83 38 40 00 93 38 40 78 83 38 40 00 93 36 40 3c 83 36 40 00 93 34 40 3c 83 34 40 00
93 36 40 78 83 36 40 00 93 36 40 78 83 36 40 00 93 36 40 78 83 36 40 00 93 34 40 3c 83 34 40 00 93 33 40 3c 83 33 40 00
93 34 40 78 83 34 40 00 93 33 40 3c 83 33 40 00 93 31 40 3c 83 31 40 00 93 33 40 78 83 33 40 00 93 2c 40 78 83 2c 40 00
93 31 40 78 83 31 40 00 93 31 40 78 83 31 40 00 93 31 40 78 83 31 40 00 93 2f 40 3c 83 2f 40 00 93 2e 40 3c 83 2e 40 00
93 33 40 82 2c 83 33 40 00 93 34 40 3c 83 34 40 00 93 36 40 81 34 83 36 40 00 93 34 40 3c 83 34 40 00 93 33 40 3c 83 33
40 00 93 31 40 3c 83 31 40 00 93 38 40 83 60 83 38 40 00 93 39 40 82 68 83 39 40 00 93 38 40 3c 83 38 40 00 93 39 40 3c
83 39 40 00 93 3b 40 78 83 3b 40 00 93 39 40 78 83 39 40 00 93 38 40 78 83 38 40 00 93 36 40 78 83 36 40 00 93 3d 40 78
83 3d 40 00 93 3b 40 3c 83 3b 40 00 93 39 40 3c 83 39 40 00 93 38 40 78 83 38 40 00 93 36 40 78 83 36 40 00 93 38 40 83
60 83 38 40 77 90 00 00 00 ff 2f 00 4d 54 72 6b 00 00 07 cd 00 90 31 40 83 60 80 31 40 00 90 30 40 81 70 80 30 40 00 90
34 40 81 70 80 34 40 00 90 33 40 83 60 80 33 40 00 90 31 40 78 80 31 40 00 90 33 40 78 80 33 40 00 90 34 40 82 68 80 34
40 00 90 33 40 3c 80 33 40 00 90 31 40 3c 80 31 40 00 90 33 40 78 80 33 40 00 90 38 40 78 80 38 40 00 90 31 40 78 80 31
40 00 90 33 40 3c 80 33 40 00 90 34 40 3c 80 34 40 00 90 36 40 82 68 80 36 40 00 90 34 40 78 80 34 40 00 90 33 40 78 80
33 40 00 90 31 40 78 80 31 40 00 90 33 40 81 70 80 33 40 00 90 31 40 82 68 80 31 40 00 90 2f 40 78 80 2f 40 00 90 2d 40
78 80 2d 40 00 90 2c 40 78 80 2c 40 00 90 2d 40 81 70 80 2d 40 00 90 2e 40 81 70 80 2e 40 00 90 30 40 81 70 80 30 40 00
90 31 40 81 70 80 31 40 00 90 2c 40 78 80 2c 40 00 90 2d 40 78 80 2d 40 00 90 2f 40 82 68 80 2f 40 00 90 2d 40 78 80 2d
40 00 90 2c 40 78 80 2c 40 00 90 2a 40 78 80 2a 40 00 90 31 40 81 70 80 31 40 00 90 2d 40 82 68 80 2d 40 00 90 2c 40 78
80 2c 40 00 90 2a 40 78 80 2a 40 00 90 28 40 78 80 28 40 00 90 2a 40 81 70 80 2a 40 00 90 2c 40 81 70 80 2c 40 00 90 2d
40 78 80 2d 40 00 90 2c 40 78 80 2c 40 00 90 2d 40 78 80 2d 40 00 90 2f 40 78 80 2f 40 00 90 31 40 78 80 31 40 00 90 2f
40 78 80 2f 40 00 90 31 40 78 80 31 40 00 90 33 40 78 80 33 40 00 90 34 40 81 70 80 34 40 00 90 31 40 82 68 80 31 40 00
90 2f 40 78 80 2f 40 00 90 2e 40 78 80 2e 40 00 90 2c 40 78 80 2c 40 00 90 31 40 81 70 80 31 40 00 90 33 40 81 70 80 33
40 00 90 2c 40 81 70 80 2c 40 9a 20 90 2f 40 81 70 80 2f 40 00 90 2e 40 81 70 80 2e 40 00 90 33 40 81 70 80 33 40 00 90
31 40 83 60 80 31 40 00 90 2f 40 84 58 80 2f 40 00 90 38 40 78 80 38 40 00 90 36 40 78 80 36 40 00 90 34 40 78 80 34 40
00 90 3b 40 81 70 80 3b 40 00 90 2f 40 81 70 80 2f 40 00 90 34 40 81 70 80 34 40 00 90 39 40 81 70 80 39 40 00 90 38 40
81 70 80 38 40 00 90 3d 40 83 60 80 3d 40 00 90 3c 40 81 70 80 3c 40 00 90 3d 40 81 70 80 3d 40 95 48 90 31 40 3c 80 31
40 00 90 33 40 3c 80 33 40 00 90 34 40 78 80 34 40 00 90 36 40 78 80 36 40 00 90 38 40 3c 80 38 40 00 90 36 40 3c 80 36
40 00 90 38 40 3c 80 38 40 00 90 39 40 3c 80 39 40 00 90 38 40 3c 80 38 40 00 90 36 40 3c 80 36 40 00 90 34 40 3c 80 34
40 00 90 38 40 3c 80 38 40 00 90 36 40 3c 80 36 40 00 90 34 40 3c 80 34 40 00 90 36 40 3c 80 36 40 00 90 38 40 3c 80 38
40 00 90 36 40 3c 80 36 40 00 90 34 40 3c 80 34 40 00 90 33 40 3c 80 33 40 00 90 36 40 3c 80 36 40 00 90 34 40 3c 80 34
40 00 90 33 40 3c 80 33 40 00 90 34 40 3c 80 34 40 00 90 36 40 3c 80 36 40 00 90 34 40 3c 80 34 40 00 90 39 40 3c 80 39
40 00 90 38 40 3c 80 38 40 00 90 39 40 3c 80 39 40 00 90 33 40 3c 80 33 40 00 90 31 40 3c 80 31 40 00 90 33 40 3c 80 33
40 00 90 34 40 3c 80 34 40 00 90 33 40 3c 80 33 40 00 90 38 40 3c 80 38 40 00 90 36 40 3c 80 36 40 00 90 38 40 3c 80 38
40 00 90 31 40 81 70 80 31 40 95 48 90 34 40 78 80 34 40 00 90 39 40 78 80 39 40 00 90 39 40 78 80 39 40 00 90 39 40 78
80 39 40 00 90 38 40 3c 80 38 40 00 90 36 40 3c 80 36 40 00 90 38 40 81 70 80 38 40 00 90 39 40 81 70 80 39 40 00 90 36
40 81 70 80 36 40 00 90 2f 40 81 70 80 2f 40 00 90 34 40 81 70 80 34 40 00 90 2d 40 83 60 80 2d 40 00 90 2c 40 81 70 80
2c 40 91 68 90 2c 40 78 80 2c 40 00 90 31 40 78 80 31 40 00 90 31 40 78 80 31 40 00 90 31 40 78 80 31 40 00 90 2f 40 3c
80 2f 40 00 90 2e 40 3c 80 2e 40 00 90 2f 40 3c 80 2f 40 00 90 2e 40 3c 80 2e 40 00 90 2c 40 3c 80 2c 40 00 90 2f 40 3c
80 2f 40 00 90 2e 40 3c 80 2e 40 00 90 2c 40 3c 80 2c 40 00 90 2e 40 3c 80 2e 40 00 90 2f 40 3c 80 2f 40 00 90 2e 40 3c
80 2e 40 00 90 2c 40 3c 80 2c 40 00 90 2a 40 3c 80 2a 40 00 90 2e 40 3c 80 2e 40 00 90 2c 40 3c 80 2c 40 00 90 2a 40 3c
80 2a 40 00 90 2c 40 3c 80 2c 40 00 90 2e 40 3c 80 2e 40 00 90 2c 40 3c 80 2c 40 00 90 2f 40 3c 80 2f 40 00 90 2e 40 3c
80 2e 40 00 90 2c 40 3c 80 2c 40 00 90 2b 40 81 70 80 2b 40 00 90 2c 40 81 70 80 2c 40 00 90 2e 40 81 70 80 2e 40 00 90
33 40 81 70 80 33 40 00 90 2c 40 81 70 80 2c 40 85 50 90 25 40 83 60 80 25 40 00 90 30 40 81 70 80 30 40 00 90 28 40 81
70 80 28 40 00 90 27 40 83 60 80 27 40 00 90 25 40 78 80 25 40 00 90 25 40 3c 80 25 40 00 90 27 40 3c 80 27 40 00 90 28
40 78 80 28 40 00 90 2a 40 78 80 2a 40 00 90 2c 40 3c 80 2c 40 00 90 2a 40 3c 80 2a 40 00 90 2c 40 3c 80 2c 40 00 90 2d
40 3c 80 2d 40 00 90 2c 40 3c 80 2c 40 00 90 2a 40 3c 80 2a 40 00 90 28 40 3c 80 28 40 00 90 2c 40 3c 80 2c 40 00 90 2a
40 3c 80 2a 40 00 90 28 40 3c 80 28 40 00 90 2a 40 3c 80 2a 40 00 90 2c 40 3c 80 2c 40 00 90 2a 40 3c 80 2a 40 00 90 28
40 3c 80 28 40 00 90 27 40 3c 80 27 40 00 90 2a 40 3c 80 2a 40 00 90 28 40 78 80 28 40 00 90 34 40 78 80 34 40 00 90 39
40 78 80 39 40 00 90 39 40 78 80 39 40 00 90 39 40 78 80 39 40 00 90 38 40 3c 80 38 40 00 90 36 40 3c 80 36 40 00 90 38
40 78 80 38 40 00 90 2c 40 78 80 2c 40 00 90 31 40 78 80 31 40 00 90 2f 40 78 80 2f 40 00 90 2d 40 81 70 80 2d 40 00 90
2c 40 78 80 2c 40 8f 00 90 31 40 78 80 31 40 00 90 36 40 78 80 36 40 00 90 36 40 78 80 36 40 00 90 36 40 78 80 36 40 00
90 35 40 3c 80 35 40 00 90 33 40 3c 80 33 40 00 90 35 40 81 70 80 35 40 00 90 36 40 81 70 80 36 40 86 48 90 2c 40 78 80
2c 40 00 90 31 40 78 80 31 40 00 90 31 40 78 80 31 40 00 90 31 40 78 80 31 40 00 90 30 40 3c 80 30 40 00 90 2e 40 3c 80
2e 40 00 90 30 40 3c 80 30 40 00 90 31 40 3c 80 31 40 00 90 33 40 3c 80 33 40 00 90 30 40 3c 80 30 40 00 90 28 40 81 70
80 28 40 78 90 2d 40 78 80 2d 40 00 90 27 40 81 70 80 27 40 78 90 2c 40 78 80 2c 40 00 90 25 40 78 80 25 40 8c 18 90 31
40 81 70 80 31 40 00 90 30 40 81 70 80 30 40 00 90 34 40 81 70 80 34 40 00 90 33 40 83 60 80 33 40 00 90 31 40 78 80 31
40 00 90 34 40 78 80 34 40 00 90 39 40 78 80 39 40 00 90 39 40 78 80 39 40 00 90 39 40 78 80 39 40 00 90 38 40 3c 80 38
40 00 90 36 40 3c 80 36 40 00 90 34 40 3c 80 34 40 00 90 33 40 3c 80 33 40 00 90 31 40 3c 80 31 40 00 90 2f 40 3c 80 2f
40 00 90 2e 40 81 70 80 2e 40 00 90 2d 40 82 68 80 2d 40 00 90 2c 40 3c 80 2c 40 00 90 2a 40 3c 80 2a 40 00 90 29 40 81
70 80 29 40 00 90 2a 40 83 60 80 2a 40 00 90 2c 40 8f 00 80 2c 40 00 90 2b 40 83 60 80 2b 40 00 90 2c 40 87 40 80 2c 40
00 90 31 40 8f 00 80 31 40 77 90 00 00 00 ff 2f 00
Das folgende Programm enthält eine Mehrspur-MIDI-Datei mit drei oder mehr Tracks und teilt jeden Track in eine separate MIDI-Datei auf. Der Ausdruckspuren der ursprünglichen MIDI -Datei wird in den 0. Spur der neuen MIDI -Dateien kopiert, und die einzelnen Tracks der ersten MIDI -Datei werden in die erste Spur der Ausgabe -MIDI -Dateien kopiert.
# include " MidiFile.h "
# include < iostream >
# include < vector >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
if (argc != 3 ) {
cerr << " Usage: " << argv[ 0 ] << " input output " << endl;
return 1 ;
}
MidiFile midifile (argv[ 1 ]);
if (!midifile. status ()) {
cerr << " Problem reading input " << endl;
return 1 ;
}
if (midifile. getTrackCount () < 3 ) {
cerr << " Not enough tracks to split " << endl;
return 1 ;
}
string basename = argv[ 2 ];
if (basename. substr (basename. size () - 4 ) == " .mid " )
basename = basename. substr ( 0 , basename. size () - 4 );
int outcount = midifile. getTrackCount () - 1 ;
vector<MidiFile> outputs (outcount);
for ( int i= 0 ; i<outcount; i++) {
outputs[i]. addTrack ();
for ( int j= 0 ; j<midifile[ 0 ]. getEventCount (); j++)
outputs[i]. addEvent (midifile[ 0 ][j]);
for ( int j= 0 ; j<midifile[i+ 1 ]. getEventCount (); j++)
outputs[i]. addEvent ( 1 , midifile[i+ 1 ][j]);
}
for ( int i= 0 ; i<outcount; i++)
outputs[i]. write (basename + " - " + to_string (i+ 1 ) + " .mid " );
return 0 ;
}Hier ist die erste Datei, die aus der MIDI -Dateieingabe für das Temperamentbeispiel extrahiert wurde:
4d 54 68 64 00 00 00 06 00 01 00 02 00 78 4d 54 72 6b 00 00 00 13 00 ff 51
03 08 8e 6c 00 ff 58 04 02 01 30 08 00 ff 2f 00 4d 54 72 6b 00 00 09 bd b2
50 90 49 40 81 70 80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 81 70 80
4c 40 00 90 4b 40 83 60 80 4b 40 00 90 49 40 82 68 80 49 40 00 90 4b 40 78
80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4b 40 78 80 4b 40 00 90 49 40 81 70
80 49 40 00 90 47 40 81 70 80 47 40 00 90 49 40 81 70 80 49 40 00 90 4b 40
81 70 80 4b 40 82 68 90 4c 40 78 80 4c 40 00 90 4b 40 78 80 4b 40 00 90 49
40 78 80 49 40 00 90 47 40 78 80 47 40 00 90 4b 40 78 80 4b 40 00 90 50 40
82 68 80 50 40 00 90 4e 40 78 80 4e 40 00 90 50 40 78 80 50 40 00 90 51 40
78 80 51 40 00 90 53 40 84 58 80 53 40 00 90 51 40 78 80 51 40 00 90 50 40
78 80 50 40 00 90 4e 40 78 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c
80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 83 60
80 49 40 00 90 47 40 82 68 80 47 40 00 90 49 40 78 80 49 40 00 90 47 40 78
80 47 40 00 90 45 40 78 80 45 40 00 90 44 40 81 70 80 44 40 00 90 46 40 78
80 46 40 00 90 47 40 78 80 47 40 00 90 49 40 81 70 80 49 40 00 90 47 40 83
60 80 47 40 00 90 46 40 81 70 80 46 40 00 90 47 40 84 58 80 47 40 00 90 49
40 78 80 49 40 00 90 4b 40 78 80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4c 40
81 70 80 4c 40 00 90 4b 40 81 70 80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4b
40 78 80 4b 40 00 90 4c 40 78 80 4c 40 00 90 4e 40 78 80 4e 40 00 90 50 40
3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 51 40 3c
80 51 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80
4c 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c
40 00 90 4e 40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40
00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4e 40 3c 80 4e 40 00
90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4c 40 3c 80 4c 40 00 90
4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49
40 3c 80 49 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40
3c 80 49 40 00 90 4b 40 3c 80 4b 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c
80 4b 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 4b 40 3c 80
4b 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 49 40 3c 80 49
40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40
00 90 46 40 3c 80 46 40 00 90 49 40 3c 80 49 40 00 90 47 40 82 2c 80 47 40
00 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40 00 90 47 40 3c 80 47 40 00
90 49 40 82 68 80 49 40 00 90 4c 40 78 80 4c 40 00 90 4b 40 82 68 80 4b 40
00 90 4e 40 78 80 4e 40 00 90 4c 40 84 58 80 4c 40 00 90 4b 40 81 70 80 4b
40 00 90 49 40 81 70 80 49 40 00 90 48 40 3c 80 48 40 00 90 46 40 3c 80 46
40 00 90 48 40 78 80 48 40 00 90 4b 40 78 80 4b 40 00 90 50 40 3c 80 50 40
00 90 4e 40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 51 40 3c 80 51 40 00
90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90
50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4e
40 3c 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40
3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4e 40 3c 80 4e 40 00 90 4d 40 81
70 80 4d 40 00 90 51 40 81 70 80 51 40 00 90 50 40 84 58 80 50 40 00 90 4e
40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 81 70 80 4a 40 78 90 49
40 78 80 49 40 00 90 4e 40 78 80 4e 40 00 90 4e 40 78 80 4e 40 00 90 4e 40
78 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 4c 40 82
68 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 4a 40 83
60 80 4a 40 00 90 49 40 81 70 80 49 40 00 90 4e 40 81 70 80 4e 40 00 90 4c
40 81 70 80 4c 40 00 90 4c 40 81 34 80 4c 40 00 90 4e 40 3c 80 4e 40 00 90
4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 4c
40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 4a 40
3c 80 4a 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c
80 49 40 00 90 47 40 3c 80 47 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 83 60
80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 81 70 80 4c 40 00 90 4b 40
84 58 80 4b 40 00 90 44 40 78 80 44 40 00 90 49 40 78 80 49 40 00 90 49 40
78 80 49 40 00 90 49 40 78 80 49 40 00 90 47 40 3c 80 47 40 00 90 45 40 3c
80 45 40 00 90 47 40 83 60 80 47 40 00 90 45 40 81 70 80 45 40 00 90 44 40
81 70 80 44 40 81 70 90 4b 40 83 60 80 4b 40 00 90 4a 40 81 70 80 4a 40 00
90 4e 40 81 70 80 4e 40 00 90 4d 40 81 70 80 4d 40 00 90 4c 40 81 70 80 4c
40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40
00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00
90 47 40 3c 80 47 40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90
47 40 3c 80 47 40 00 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40 00 90 49
40 3c 80 49 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 49 40
3c 80 49 40 00 90 48 40 81 70 80 48 40 00 90 47 40 81 70 80 47 40 00 90 46
40 81 70 80 46 40 00 90 45 40 81 70 80 45 40 00 90 44 40 81 70 80 44 40 89
30 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 00 90 4c 40 81 70 80
4c 40 00 90 4b 40 85 50 80 4b 40 00 90 49 40 83 60 80 49 40 00 90 48 40 81
70 80 48 40 78 90 49 40 3c 80 49 40 00 90 4b 40 3c 80 4b 40 00 90 4c 40 78
80 4c 40 00 90 4e 40 78 80 4e 40 00 90 50 40 3c 80 50 40 00 90 4e 40 3c 80
4e 40 00 90 50 40 3c 80 50 40 00 90 51 40 3c 80 51 40 00 90 50 40 3c 80 50
40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 50 40 3c 80 50 40
00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4e 40 3c 80 4e 40 00
90 50 40 3c 80 50 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90
4b 40 3c 80 4b 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b
40 3c 80 4b 40 00 90 4c 40 3c 80 4c 40 00 90 4e 40 3c 80 4e 40 00 90 4c 40
3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 4c 40 3c
80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40 00 90 4a 40 3c 80
4a 40 00 90 4c 40 3c 80 4c 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49
40 00 90 47 40 3c 80 47 40 00 90 4a 40 3c 80 4a 40 00 90 49 40 3c 80 49 40
00 90 47 40 3c 80 47 40 00 90 49 40 3c 80 49 40 00 90 4a 40 3c 80 4a 40 00
90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 45 40 3c 80 45 40 00 90
49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 45 40 3c 80 45 40 00 90 47
40 3c 80 47 40 00 90 49 40 3c 80 49 40 00 90 47 40 3c 80 47 40 00 90 45 40
3c 80 45 40 00 90 44 40 3c 80 44 40 00 90 47 40 3c 80 47 40 00 90 45 40 81
70 80 45 40 81 70 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 00 90
4c 40 81 70 80 4c 40 00 90 4b 40 84 58 80 4b 40 00 90 49 40 78 80 49 40 00
90 50 40 78 80 50 40 00 90 50 40 78 80 50 40 00 90 50 40 78 80 50 40 00 90
4e 40 3c 80 4e 40 00 90 4c 40 3c 80 4c 40 00 90 4e 40 81 70 80 4e 40 00 90
4c 40 83 60 80 4c 40 00 90 4b 40 81 70 80 4b 40 00 90 4f 40 81 70 80 4f 40
00 90 4e 40 81 70 80 4e 40 00 90 42 40 81 70 80 42 40 00 90 41 40 81 70 80
41 40 00 90 45 40 81 70 80 45 40 00 90 44 40 78 80 44 40 83 60 90 48 40 78
80 48 40 00 90 4e 40 78 80 4e 40 00 90 4e 40 78 80 4e 40 00 90 4e 40 78 80
4e 40 00 90 4c 40 3c 80 4c 40 00 90 4b 40 3c 80 4b 40 00 90 4c 40 78 80 4c
40 00 90 4b 40 3c 80 4b 40 00 90 49 40 3c 80 49 40 00 90 4b 40 78 80 4b 40
00 90 48 40 78 80 48 40 00 90 49 40 85 50 80 49 40 00 90 48 40 81 70 80 48
40 00 90 47 40 81 70 80 47 40 00 90 46 40 81 70 80 46 40 00 90 45 40 81 70
80 45 40 00 90 44 40 83 60 80 44 40 00 90 46 40 81 70 80 46 40 00 90 48 40
81 70 80 48 40 00 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40 00 90
4c 40 83 60 80 4c 40 00 90 4b 40 78 80 4b 40 00 90 49 40 78 80 49 40 00 90
48 40 81 70 80 48 40 00 90 49 40 83 60 80 49 40 00 90 48 40 81 70 80 48 40
00 90 49 40 8f 00 80 49 40 77 90 00 00 00 ff 2f 00
Dieses Beispiel zeigt die Erzeugung eines konstanten Vibrato für Notizen in einer MIDI -Datei (auf einem bestimmten Kanal). Das Programm fügt am Ende der Datei eine zusätzliche Strecke hinzu, um die Tonhöhenbücken zu speichern. Die Vibrato -Rate ist unabhängig von der Tempoeinstellung für die MIDI -Datei konstant, da das Vibrato eher in physischer Zeit als in der Tickzeit berechnet wird. Die MidiFile::getAbsoluteTickTime() -Funktion berechnet die Konvertierung zwischen physischer Zeit in Sekunden und Tickzeit in der MIDI -Datei.
# include " MidiFile.h "
# include " Options.h "
# include < iostream >
# include < utility >
# include < cmath >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. define ( " f|frequency=d:4.0 " , " vibrato frequency " );
options. define ( " d|depth=d:20.0 " , " vibrato depth in cents " );
options. define ( " b|bend-max=d:200.0 " , " pitch bend depth " );
options. define ( " s|sample-rate=d:100.0 " , " sample rate " );
options. define ( " o|output-file=s " , " output filename " );
options. define ( " c|channel=i:0 " , " output channel " );
options. process (argc, argv);
MidiFile midifile;
if (options. getArgCount () == 0 ) midifile. read (cin);
else midifile. read (options. getArg ( 1 ));
if (!midifile. status ()) {
cerr << " Problem reading file " << endl;
return 1 ;
}
string filename = options. getString ( " output-file " );
int channel = options. getInteger ( " channel " );
double freq = options. getDouble ( " frequency " );
double depth = options. getDouble ( " depth " );
double bend = options. getDouble ( " bend-max " );
double srate = options. getDouble ( " sample-rate " );
double phase = 0.0 ;
double twopi = 2.0 * M_PI;
double increment = twopi * freq / srate;
double maxtime = midifile. getFileDurationInSeconds ();
midifile. addTrack (); // store vibrato in separate track
pair< int , double > tickbend;
vector<pair< double , double >> storage;
int count = maxtime * srate;
storage. reserve (maxtime * srate + 1000 );
for ( int i= 0 ; i<count; i++) {
tickbend. first = int (midifile. getAbsoluteTickTime (i/srate) + 0.5 );
tickbend. second = depth/bend * sin (phase);
if ((storage. size () > 0 ) && (tickbend. first == 0 )) break ;
storage. push_back (tickbend);
phase += increment;
if (phase > twopi) phase -= twopi;
}
int track = midifile. getTrackCount () - 1 ;
for ( int i= 0 ; i<( int )storage. size (); i++)
midifile. addPitchBend (track, storage[i]. first , channel, storage[i]. second );
if (filename. empty ()) cout << midifile;
else midifile. write (filename);
return 0 ;
}Hier ist ein Programm, das Polyrhythmusmuster erzeugt. Befehlszeilenoptionen sind:
| Option | Standardwert | Bedeutung |
|---|---|---|
-a | 2 | Aufteilung des ersten Instruments des Zyklus |
-b | 3 | Aufteilung des ersten Instruments des Zyklus |
-c | 10 | Anzahl der Zyklen |
-d | 2.0 | Dauer jedes Zyklus |
--key1 | 76 | Percussion -Schlüsselnummer für das erste Instrument |
--key2 | 77 | Percussion -Schlüsselnummer für das erste Instrument |
-o | Ausgabe Dateiname |
# include " MidiFile.h "
# include " Options.h "
# include < iostream >
# include < utility >
# include < cmath >
using namespace std ;
using namespace smf ;
int main ( int argc, char ** argv) {
Options options;
options. define ( " a=i:2 " , " cycle division 1 " );
options. define ( " b=i:3 " , " cycle division 2 " );
options. define ( " c|cycle=i:10 " , " cycle count " );
options. define ( " d|dur=d:2.0 " , " duration of cycle in seconds " );
options. define ( " key1=i:76 " , " first percussion key number " );
options. define ( " key2=i:77 " , " second percussion key number " );
options. define ( " o|output-file=s " , " output filename " );
options. process (argc, argv);
int a = options. getInteger ( " a " );
int b = options. getInteger ( " b " );
int c = options. getInteger ( " cycle " );
int key1 = options. getInteger ( " key1 " );
int key2 = options. getInteger ( " key2 " );
double dur = options. getDouble ( " dur " );
double tempo = 60.0 / dur;
MidiFile midifile;
midifile. setTPQ (a*b);
midifile. addTempo ( 0 , 0 , tempo);
midifile. addTracks ( 2 );
for ( int i= 0 ; i<b*c + 1 ; i++) {
midifile. addNoteOn ( 1 , i*a, 9 , key1, 64 );
midifile. addNoteOff ( 1 , (i+ 1 )*a, 9 , key1);
}
for ( int i= 0 ; i<a*c + 1 ; i++) {
midifile. addNoteOn ( 2 , i*b, 9 , key2, 64 );
midifile. addNoteOff ( 2 , (i+ 1 )*b, 9 , key2);
}
string filename = options. getString ( " output-file " );
if (filename. empty ()) cout << midifile;
else midifile. write (filename);
return 0 ;
} Dieses Programm zeigt, wie der Wert der Zecken pro Quartal im MIDI-Header festgelegt wird. In diesem Fall ist es auf den Faktor von a*b eingestellt, der die Dauer eines Zyklus ist (so hat jeder Zyklus die Dauer eines Viertelnotizs). Ein Tempo-Meta-Message wird auch basierend auf der gewünschten Dauer eines Zyklus berechnet.
Probieren Sie beispielsweise die Optionen -a 3 -b 4 -c 200 -d 1 -o 3x4.mid aus, die für 200 Zyklen ein 3 -Against -4 -Muster mit jedem Zyklus 1 Sekunde dauern. Oder hier ist 11 -AGAINST -13 für 100 Zyklen: -a 11 -b 13 -c 100 -d 5 -o 11x13.mid .