1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-19 01:20:04 +02:00
Leland Lucius 15b9bb96cd Update nyquist to SVN r331 (r3.16+)
------------------------------------------------------------------------
   r331 | rbd | 2020-10-13 12:40:12 -0500 (Tue, 13 Oct 2020) | 2 lines

   Also forgot to install NyquistWords.txt

   ------------------------------------------------------------------------
   r330 | rbd | 2020-10-13 12:34:06 -0500 (Tue, 13 Oct 2020) | 2 lines

   Forgot to move nyquistman.pdf from docsrc/s2h to release

   ------------------------------------------------------------------------
   r329 | rbd | 2020-10-13 11:32:33 -0500 (Tue, 13 Oct 2020) | 2 lines

   Updated some version numbers for 3.16.

   ------------------------------------------------------------------------
   r328 | rbd | 2020-10-13 11:20:52 -0500 (Tue, 13 Oct 2020) | 2 lines

   Fixed NyquistIDE antialiasing for plot text, fix format of message.

   ------------------------------------------------------------------------
   r327 | rbd | 2020-10-12 21:01:53 -0500 (Mon, 12 Oct 2020) | 2 lines

   Fixed a couple of format problems in manual. This version of Nyquist has been tested wtih macOS, Linux, 32&64-bit Windows.

   ------------------------------------------------------------------------
   r326 | rbd | 2020-10-12 20:21:38 -0500 (Mon, 12 Oct 2020) | 1 line

   Modified WIN32 32-bit XLisp to use 64-bit FIXNUMs. This allows XLisp and Nyquist to handle big sounds even on 32-bit machines. Probably at some cost, but inner loops are mostly float and int32, and the Nyquist release is 64-bit anyway. Maybe we'll have to run some benchmarks on Audacity, which is still 32-bit on Windows.
   ------------------------------------------------------------------------
   r325 | rbd | 2020-10-12 13:16:57 -0500 (Mon, 12 Oct 2020) | 1 line

   Win64 passes bigfiletest.lsp now. This version should work on all 64-bit systems now. These changes untested on Linux and macOS.
   ------------------------------------------------------------------------
   r324 | rbd | 2020-10-11 21:31:53 -0500 (Sun, 11 Oct 2020) | 2 lines

   I couldn't free enough space on my linux box, so I adjusted the bigfiletest to write 8-bit ulaw. It's still >4GB and >4G samples. Works on Linux.

   ------------------------------------------------------------------------
   r323 | rbd | 2020-10-11 19:41:25 -0500 (Sun, 11 Oct 2020) | 2 lines

   Missing file from last commit.

   ------------------------------------------------------------------------
   r322 | rbd | 2020-10-11 19:36:08 -0500 (Sun, 11 Oct 2020) | 1 line

   Found another case where WIN64 needs int64_t instead of long for sample count.
   ------------------------------------------------------------------------
   r321 | rbd | 2020-10-11 19:33:25 -0500 (Sun, 11 Oct 2020) | 3 lines

   Fixed s-save to	handle optional	and keyword parameters (which should never have	been mixed in the first	place).	Documentation cleanup - should be final for this version.

   ------------------------------------------------------------------------
   r320 | rbd | 2020-10-11 14:44:37 -0500 (Sun, 11 Oct 2020) | 2 lines

   Fixes to handle IRCAM sound format and tests for big file io working on macOS.

   ------------------------------------------------------------------------
   r319 | rbd | 2020-10-10 21:31:58 -0500 (Sat, 10 Oct 2020) | 2 lines

   Changes for linux and to avoid compiler warnings on linux.

   ------------------------------------------------------------------------
   r318 | rbd | 2020-10-10 20:50:23 -0500 (Sat, 10 Oct 2020) | 1 line

   This is the test used for Win64 version.
   ------------------------------------------------------------------------
   r317 | rbd | 2020-10-10 20:34:34 -0500 (Sat, 10 Oct 2020) | 1 line

   This version works on Win64. Need to test changes on macOS and linux.
   ------------------------------------------------------------------------
   r316 | rbd | 2020-10-10 19:59:15 -0500 (Sat, 10 Oct 2020) | 2 lines

   PWL changes to avoid compiler warning.

   ------------------------------------------------------------------------
   r315 | rbd | 2020-10-10 19:34:04 -0500 (Sat, 10 Oct 2020) | 2 lines

   A few more changes for 64-bit sample counts on Win64

   ------------------------------------------------------------------------
   r314 | rbd | 2020-10-10 13:19:42 -0500 (Sat, 10 Oct 2020) | 2 lines

   Fixed int64_t declaration in gate.alg

   ------------------------------------------------------------------------
   r313 | rbd | 2020-10-10 12:07:40 -0500 (Sat, 10 Oct 2020) | 2 lines

   Fixes to gate for long sounds

   ------------------------------------------------------------------------
   r312 | rbd | 2020-10-10 11:47:29 -0500 (Sat, 10 Oct 2020) | 2 lines

   Fixed sound_save types for intgen

   ------------------------------------------------------------------------
   r311 | rbd | 2020-10-10 11:09:01 -0500 (Sat, 10 Oct 2020) | 2 lines

   Fixed a 64-bit sample count problem in siosc.alg

   ------------------------------------------------------------------------
   r310 | rbd | 2020-10-10 11:03:12 -0500 (Sat, 10 Oct 2020) | 2 lines

   Fixed sndmax to handle 64-bit sample counts.

   ------------------------------------------------------------------------
   r309 | rbd | 2020-10-10 10:57:04 -0500 (Sat, 10 Oct 2020) | 2 lines

   Forgot to re-translate all tran/*.alg files with fix for int64 cast to int32. This version compiles on macOS and ready for test on Win64.

   ------------------------------------------------------------------------
   r308 | rbd | 2020-10-10 10:16:05 -0500 (Sat, 10 Oct 2020) | 2 lines

   Everything seems to compile and run on macOS now. Moving changes to Windows for test.

   ------------------------------------------------------------------------
   r307 | rbd | 2020-10-10 09:23:45 -0500 (Sat, 10 Oct 2020) | 1 line

   Added casts to avoid compiler warnings and to review changes to support 64-bit sample counts on Windows. Still not complete, and waiting to regenerate and compile tran directory code after updates to translation code that will insert more casts.
   ------------------------------------------------------------------------
   r306 | rbd | 2020-10-09 21:55:15 -0500 (Fri, 09 Oct 2020) | 2 lines

   Rebuilt seqfnint.c from header files.

   ------------------------------------------------------------------------
   r305 | rbd | 2020-10-09 21:53:33 -0500 (Fri, 09 Oct 2020) | 1 line

   Changed some FIXNUMS to LONG to avoid compiler warnings in seqfnint.c
   ------------------------------------------------------------------------
   r304 | rbd | 2020-10-09 21:44:03 -0500 (Fri, 09 Oct 2020) | 2 lines

   I discovered forgotten regression-test.lsp and added test that requires 64-bit sample counts to pass. Fixed a few bugs revealed by running the type-checking regression tests.

   ------------------------------------------------------------------------
   r303 | rbd | 2020-10-09 12:28:58 -0500 (Fri, 09 Oct 2020) | 2 lines

   Changes for 64-bit sample counts broke mult-channel s-save. Fixed in the commit for macOS.

   ------------------------------------------------------------------------
   r302 | rbd | 2020-10-09 10:03:39 -0500 (Fri, 09 Oct 2020) | 2 lines

   Changed snd-play to return samples computed and used that to make a test for computing long sounds that would overflow 32-bit length counts.

   ------------------------------------------------------------------------
   r301 | rbd | 2020-10-09 09:11:26 -0500 (Fri, 09 Oct 2020) | 2 lines

   corrected mistake in delaycv.alg and re-translated

   ------------------------------------------------------------------------
   r300 | rbd | 2020-10-09 09:09:06 -0500 (Fri, 09 Oct 2020) | 2 lines

   Fix to delaycv.alg -- "s" changed to "input" to avoid matching "s" in "sample_type".

   ------------------------------------------------------------------------
   r299 | rbd | 2020-10-09 09:03:33 -0500 (Fri, 09 Oct 2020) | 4 lines

   To avoid compiler warnings, XLisp interfaces to C int and long are now
   specified as LONG rather than FIXNUM, and the stubs that call the C
   functions cast FIXNUMs from XLisp into longs before calling C functions.

   ------------------------------------------------------------------------
   r298 | rbd | 2020-10-08 22:20:26 -0500 (Thu, 08 Oct 2020) | 2 lines

   This commit has many more fixes to handle long (64-bit) sounds, including a lot of fixes for warnings by Visual Studio assigning int64_t to long (works on macOS, doesn't work on VS). This was compiled and tested on macOS, and even computed a 27.1-hour sound using OSC, LP, SUM and MULT (haven't tested I/O yet).

   ------------------------------------------------------------------------
   r297 | rbd | 2020-10-07 13:04:02 -0500 (Wed, 07 Oct 2020) | 2 lines

   This is a major cleanup. It started with the goal of changing long to int64_t for sample counts so that on 64-bit windows, where long is only 32-bits, the sample counts would nevertheless be 64-bit allowing long sounds, which was a limitation for long recordings in Audacity. Since I was using compiler warnings to track possible loss-of-precision conversions from 64-bit sample counts, and there were *many* warnings, I started cleaning up *all* the warnings and ended up with a very large set of changes, including "modernizing" C declarations that date back to XLisp and CMU MIDI Toolkit code and were never changed. This version runs all the examples.sal code on macOS, but will surely have problems on Windows and Linux given the number of changes.

   ------------------------------------------------------------------------
   r296 | rbd | 2020-10-06 13:34:20 -0500 (Tue, 06 Oct 2020) | 2 lines

   More changes from long to int64_t for sample counts.

   ------------------------------------------------------------------------
   r295 | rbd | 2020-10-06 11:53:49 -0500 (Tue, 06 Oct 2020) | 2 lines

   More work on using 64-bit sample counts. Changed MAX_STOP from 32-bit to 64-bit limit.

   ------------------------------------------------------------------------
   r294 | rbd | 2020-10-06 11:48:05 -0500 (Tue, 06 Oct 2020) | 2 lines

   Made some changes so that sample counts are int64_t (for windows) instead of long to support sample counts above 31 bits.

   ------------------------------------------------------------------------
   r293 | rbd | 2020-10-04 21:30:55 -0500 (Sun, 04 Oct 2020) | 2 lines

   Fixed a few minor things for Linux and tested on Linux.

   ------------------------------------------------------------------------
   r292 | rbd | 2020-10-04 21:00:28 -0500 (Sun, 04 Oct 2020) | 2 lines

   Update extensions: all are minor changes.

   ------------------------------------------------------------------------
   r291 | rbd | 2020-09-24 13:59:31 -0500 (Thu, 24 Sep 2020) | 2 lines

   New implementation of seq and seqrep, added get-real-time, documented get-real-time, fixed examples.sal and examples.lsp which are now in lib rather than extensions (so they are now back in the basic installation), other cleanup.

   ------------------------------------------------------------------------
   r290 | rbd | 2020-08-16 16:24:52 -0500 (Sun, 16 Aug 2020) | 2 lines

   Fixed bug in snd-gate, revised GATE and NOISE-GATE to handle multi-channel sound. RMS now handles multi-channel input. S-AVG added to take multichannel input (but not used, because RMS could not be written without making SND-SRATE convert multichannel sound to vector of floats. That seems to be going toward a fully vectorized model. Not going there for now.

   ------------------------------------------------------------------------
   r289 | rbd | 2020-07-09 16:27:45 -0500 (Thu, 09 Jul 2020) | 2 lines

   Added GET-REAL-TIME function to XLISP. May not work yet on Windows. Various fixes for compiler warnings. I noticed FLAC doesn't work (I guess it never did) and I cannot figure out how this even links because flac_min seems to be undefined. Something to look at later.
2021-01-27 23:45:25 -06:00

445 lines
14 KiB
C

/*
* seqmread.c
*
* Convert a MIDI file to a seq.
*/
/* Copyright 1989 Carnegie Mellon University */
/*****************************************************************************
* Change Log
* Date | who : Change
*-----------+-----------------------------------------------------------------
* 17-Feb-92 | GWL : only one stdio.h
* : fix to satisfy compiler:
void returns, time_type giotime(), int filegetc()
*****************************************************************************/
#include "switches.h"
#include "stdio.h"
#include "cext.h"
#include "cmdline.h"
#include "midifns.h" /* to get time_type */
#include "timebase.h"
#include "moxc.h" /* to get debug declared */
#include "seq.h"
#include "seqread.h" /* to get scale */
#include "seqmread.h"
#include "userio.h"
#include "ctype.h"
#include "midifile.h"
#include "tempomap.h"
int filegetc(void);
void initfuncs(void);
void prtime(void);
void snding_free(void);
typedef struct snding_struct {
struct snding_struct *next;
event_type event_ptr;
int pitch;
int channel;
} snding_node, *snding_type;
#define snding_alloc() (snding_type) memget(sizeof(snding_node))
#define snding_free(s) memfree(s, sizeof(snding_node))
snding_type snding_list = NULL;
tempomap_type the_tempomap;
event_type initial_clock; /* remember the first clock event */
long prev_ticksize; /* remember the previous ticksize */
int sysex_id = 0;
void smf_noteoff(int, int, int);
void smf_error(char *);
void smf_header(int, int, int);
void smf_trackstart(void);
void smf_trackend(void);
void smf_noteon(int, int, int);
void smf_pressure(int, int, int);
void smf_parameter(int, int, int);
void smf_pitchbend(int, int, int);
void smf_program(int, int);
void smf_chanpressure(int, int);
void smf_sysex(int, char *);
void smf_metamisc(int, int, char *);
void smf_metaseq(int);
void smf_metaeot(void);
void smf_timesig(int, int, int, int);
void smf_smpte(int, int, int, int, int);
void smf_tempo(int);
void smf_keysig(int, int);
void smf_metaspecial(int, int, char *);
void smf_metatext(int, int, char *);
void smf_arbitrary(int, char *);
private seq_type the_score;
static FILE *F;
int filegetc(void)
{
/* int temp = getc(F);
printf(" %x ", temp);*/
return(int)(getc(F));
}
void seq_read_smf(seq_type seq, FILE *fp)
{
F = fp;
initfuncs();
sysex_id = 0; /* sysex in seq has to correspond to a symbol */
the_score = seq; /* current sequence is a global within this module */
if (!seq) return;
the_tempomap = tempomap_create();
/* insert an initial clock to correspond to the default midifile tempo
(tempomap_create creates a corresponding initial entry in the tempomap)
(see smf_tempo for explanation of the scale() call)
*/
initial_clock = insert_clock(the_score, 0L, 0, 500L << 16);
/* scale(24 * 500000, 1 << 16, 24000) */
if (!the_tempomap) return;
Mf_getc = filegetc;
midifile();
/* fmac_close(F); -- do not close the file because the caller might try to
* close it (in fact XLISP insists on closing it as a side effect of
* garbage collection.
*/
gprintf(TRANS, "\nLoaded Midi file with %ld note(s), %ld ctrl(s).\n\n",
seq_notecount(seq), seq_ctrlcount(seq));
seq_reset(seq);
while (snding_list) {
snding_type snding = snding_list;
snding_list = snding_list->next;
gprintf(TRANS, "Note-on (key %d, chan %d) has no matching noteoff\n",
snding->pitch, snding->channel + 1);
snding_free(snding);
}
tempomap_free(the_tempomap);
}
/* gio_time -- get the time in millisec for Adagio */
/*
* Since Adagio times are (in their precise form) 1/256 ms, we want
* a similar time for midifiles, whose natural unit would be microseconds.
* We'll shift the microsecond time by 2 to get 1/250 ms = 4 us units
* and convert using the scale function when necessary.
* Real time is the time of the last tempo change (last_tempo_time)
* which is in 4us units + elapsed time.
* Elapsed time is the elapsed beats times the beat duration.
* Elapsed beats is Mf_currtime - last_tempo_beat.
* Beat duration is the specified tempo / division, where specified tempo
* is in microseconds, and division is parts per quarternote.
*/
unsigned long divisions = 24L;
time_type gio_time(void)
{
return (tempomap_lookup(the_tempomap, Mf_currtime) + 125L) / 250L;
}
void smf_header(int format, int ntrks, int division)
{
/* gprintf(TRANS, "Header format=%d ntrks=%d division=%d\n",
format,ntrks,division); */
if (format > 1) gprintf(TRANS,
"Warning: format %d midi file may not work.\n",
format);
divisions = division;
/* adjust the initial tempochange */
the_tempomap->entries->tempo = 500000L / division;
}
void smf_trackstart(void)
{
/* gprintf(TRANS, "Track start\n"); */
}
void smf_trackend(void)
{
/* gprintf(TRANS, "Track end\n"); */
}
void smf_noteon(int chan, int pitch, int vol)
{
snding_type snding;
if (vol == 0) { /* convert to a noteoff */
smf_noteoff(chan, pitch, 0);
return;
}
/* prtime();
gprintf(TRANS, "Note on, chan=%d pitch=%d vol=%d\n",chan+1,pitch,vol);
*/
/* get ready to remember the sounding note */
snding = snding_alloc();
snding->next = snding_list;
snding_list = snding;
/* enter an event into score and remember it */
snding->event_ptr = insert_note(the_score, gio_time(), 0,
chan + 1, pitch, 0L, vol);
snding->pitch = pitch;
snding->channel = chan;
}
void smf_noteoff(int chan, int pitch, int vol)
{
snding_type *snding_ptr;
register snding_type snding;
/* prtime();
gprintf(TRANS, "Note off, chan=%d pitch=%d vol=%d\n",chan+1,pitch,vol);
*/ /* search for the snding record */
for (snding_ptr = &snding_list;
(snding = *snding_ptr) &&
((snding->pitch != pitch) || (snding->channel != chan));
snding_ptr = &(snding->next)) /* printf("* search *\n") */;
if (!snding) {
gprintf(TRANS, "Note off %d, channel %d ignored: no note on\n",
pitch, chan + 1);
} else {
event_type event = snding->event_ptr;
event->u.note.ndur += (gio_time() - event->ntime) << 8;
/* free the snding record */
*snding_ptr = snding->next;
snding_free(snding);
}
}
void smf_pressure(int chan, int pitch, int press)
{
prtime();
gprintf(TRANS, "Pressure, chan=%d pitch=%d press=%d (IGNORED)\n",
chan + 1, pitch, press);
}
void smf_parameter(int chan, int control, int value)
{
int ctrl = 0;
/* prtime();
gprintf(TRANS, "Parameter, chan=%d c1=%d c2=%d\n",chan+1,control,value);
*/ /* see if the control is one of the standard Adagio controls that
can be encoded in a special way. If not, ctrl remains at zero.
*/
switch (control) {
case PORTASWITCH: ctrl = PSWITCH_CTRL; break;
case MODWHEEL: ctrl = MODWHEEL_CTRL; break;
case VOLUME: ctrl = VOLUME_CTRL; break;
}
if (ctrl) /* then do special ctrl insert and save storage */
insert_ctrl(the_score, gio_time(), 0, ctrl, chan + 1, value);
else insert_macctrl(the_score, gio_time(), 0, control, chan + 1, value);
}
/* smf_pitchbend -- handle a pitch bend event */
/*
* NOTE: the midifile code from Tim Thompson has the msb and lsb bytes swapped.
* Thus the parameter msb is really the low order byte and lsb is high order.
*/
void smf_pitchbend(int chan, int msb, int lsb)
{
/* prtime();
gprintf(TRANS, "Pitchbend, chan=%d msb=%d lsb=%d\n",chan+1,msb,lsb); */
insert_ctrl(the_score, gio_time(), 0, BEND_CTRL, chan + 1,
((lsb << 7) + msb) >> 6);
}
void smf_program(int chan, int program)
{
/* prtime();
gprintf(TRANS, "Program, chan=%d program=%d\n",chan+1,program); */
insert_ctrl(the_score, gio_time(), 0, PROGRAM_CTRL, chan + 1, program);
}
void smf_chanpressure(int chan, int press)
{
/* prtime();
gprintf(TRANS, "Channel pressure, chan=%d pressure=%d\n",chan+1,press);
*/
insert_ctrl(the_score, gio_time(), 0, TOUCH_CTRL, chan + 1, press);
}
void smf_sysex(int leng, char* mess)
{
char symb[10];
def_type defn;
int i;
sprintf(symb, "X%d", sysex_id++);
if (leng > 255) {
gprintf(TRANS, "sysex too long (%d bytes), ignored\n", leng - 2);
return;
}
/* need to end up with a prefix of [0][length], so add 2 to length;
note that this will copy past the end of the message -- this is
slightly dangerous and definitely crufty:
*/
defn = insert_def(the_score, symb, (unsigned char *) mess, leng + 2);
/* now fix up the definition by inserting the prefix bytes: */
for (i = leng + 1; i > 1; i--)
defn->definition[i] = defn->definition[i - 2];
defn->definition[0] = 0;
defn->definition[1] = leng;
insert_macro(the_score, gio_time(), 0, defn, 1, 0, NULL);
/* prtime();
gprintf(TRANS, "Sysex, leng=%d (IGNORED)\n",leng); */
}
void smf_metamisc(int type, int leng, char *mess)
{
prtime();
gprintf(TRANS,
"Meta event, unrecognized, type=0x%02x leng=%d (IGNORED)\n",
type, leng);
}
void smf_metaspecial(int type, int leng, char *mess)
{
prtime();
gprintf(TRANS,
"Meta event, sequencer-specific, type=0x%02x leng=%d (IGNORED)\n",
type, leng);
}
void smf_metatext(int type, int leng, char *mess)
{
static char *ttype[] = {
NULL,
"Text Event", /* type=0x01 */
"Copyright Notice", /* type=0x02 */
"Sequence/Track Name",
"Instrument Name", /* ... */
"Lyric",
"Marker",
"Cue Point", /* type=0x07 */
"Unrecognized"
};
int unrecognized = (sizeof(ttype)/sizeof(char *)) - 1;
if ( type < 1 || type > unrecognized )
type = unrecognized;
}
void smf_metaseq(int num)
{
prtime();
gprintf(TRANS, "Meta event, sequence number = %d (IGNORED)\n", num);
}
void smf_metaeot(void)
{
/* prtime();
gprintf(TRANS, "Meta event, end of track\n"); */
}
void smf_keysig(int sf, int mi)
{
/* prtime();
gprintf(TRANS, "Key signature, sharp/flats=%d minor=%d\n", sf, mi); */
}
void smf_sqspecific(int id, char *msg)
{
prtime();
gprintf(TRANS, "Sequencer-specific event ID = %d (IGNORED)\n", id);
}
/* smf_tempo -- handle a midifile tempo change */
/*
* NOTE: if divisions is positive, it gives time units per quarter, and
* tempo is microsec per division. The product is microsec per quarter.
* To convert to ticksize (parameter to insert_clock), we divide by 24*1000
* to get units of millisec and 24ths of quarter notes. insert_clock
* expects this to have a 16 bit fractional part.
*/
void smf_tempo(int tempo)
{
time_type ctime = gio_time();
long ticksize = scale(tempo, 1024L, 375L);
/* (tempo / 24000) << 16; microsec/clock converted to ms/quarter, shifted 16*/
/* prtime();
gprintf(TRANS, "Tempo, microseconds-per-MIDI-quarter-note = %ld\n",tempo);
*/
tempomap_insert(the_tempomap, Mf_currtime, tempo / divisions);
if (ctime == 0) {
/* we already have a clock event at t=0 -> fix it */
initial_clock->u.clock.ticksize = ticksize;
} else { /* we need a new one */
/* NOTE: after the first clock, insert clock events 1/2 tick early
to make sure ticksize is set before clock_tick() wakes up and
reads it.
*/
insert_clock(the_score, ctime - (prev_ticksize >> 17), 0, ticksize);
prev_ticksize = ticksize;
}
}
void smf_timesig(int nn, int dd, int cc, int bb)
{
/* int denom = 1;
while ( dd-- > 0 )
denom *= 2;
prtime();
gprintf(TRANS,
"Time signature=%d/%d MIDI-clocks/click=%d 32nd-notes/24-MIDI-clocks=%d\n",
nn,denom,cc,bb); */
}
void smf_smpte(int hr, int mn, int se, int fr, int ff)
{
prtime();
gprintf(TRANS,
"SMPTE, hour=%d minute=%d second=%d frame=%d fract-frame=%d (IGNORED)\n",
hr, mn, se, fr, ff);
}
void smf_arbitrary(int leng, char *mess)
{
prtime();
gprintf(TRANS, "Arbitrary bytes, leng=%d (IGNORED)\n",leng);
}
void smf_error(char *msg)
{
gprintf(ERROR, msg);
}
void prtime(void)
{
gprintf(TRANS, "Time=%ld/%ld ",Mf_currtime, gio_time());
}
void initfuncs(void)
{
Mf_error = smf_error;
Mf_header = smf_header;
Mf_starttrack = smf_trackstart;
Mf_endtrack = smf_trackend;
Mf_on = smf_noteon;
Mf_off = smf_noteoff;
Mf_pressure = smf_pressure;
Mf_controller = smf_parameter;
Mf_pitchbend = smf_pitchbend;
Mf_program = smf_program;
Mf_chanpressure = smf_chanpressure;
Mf_sysex = smf_sysex;
Mf_metamisc = smf_metamisc;
Mf_seqnum = smf_metaseq;
Mf_eot = smf_metaeot;
Mf_timesig = smf_timesig;
Mf_smpte = smf_smpte;
Mf_tempo = smf_tempo;
Mf_keysig = smf_keysig;
Mf_sqspecific = smf_sqspecific;
Mf_text = smf_metatext;
Mf_arbitrary = smf_arbitrary;
}