4 Copyright 1999 by Daisuke Nagano <breeze.nagano@nifty.ne.jp>
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32 #define SMF_MTHD_HEADER_SIZE 14
34 #define SMF_HEADER_STRING "MThd"
35 #define SMF_TRACK_STRING "MTrk"
37 #define SMF_TERM -1 /* terminator */
40 These definitions are introduced from midiplay/midi.h
45 #define MIDI_NOTEOFF 0x80 /* Note off */
46 #define MIDI_NOTEON 0x90 /* Note on */
47 #define MIDI_PRESSURE 0xa0 /* Polyphonic key pressure */
48 #define MIDI_CONTROL 0xb0 /* Control change */
49 #define MIDI_PROGRAM 0xc0 /* Program change */
50 #define MIDI_CHANPRES 0xd0 /* Channel pressure */
51 #define MIDI_PITCHB 0xe0 /* Pitch wheel change */
52 #define MIDI_SYSEX 0xf0 /* System exclusive data */
53 #define MIDI_META 0xff /* Meta event header */
55 /* META-EVENT MESSAGE TYPES */
56 #define META_SEQNUM 0x00 /* Sequence number */
57 #define META_TEXT 0x01 /* Text event */
58 #define META_COPYRIGHT 0x02 /* Copyright notice */
59 #define META_SEQNAME 0x03 /* Sequence/track name */
60 #define META_INSTNAME 0x04 /* Instrument name */
61 #define META_LYRIC 0x05 /* Lyric */
62 #define META_MARKER 0x06 /* Marker */
63 #define META_CUEPT 0x07 /* Cue point */
64 #define META_EOT 0x2f /* End of track */
65 #define META_TEMPO 0x51 /* Set tempo */
66 #define META_SMPTE 0x54 /* SMPTE offset */
67 #define META_TIMESIG 0x58 /* Time signature */
68 #define META_KEYSIG 0x59 /* Key signature */
69 #define META_SEQSPEC 0x7f /* Sequencer-specific event */
71 #define META_PORT 0x21 /* Port change (unautherized) */
73 /* CONTROL CHANGE FUNCTIONS */
74 #define SMF_CTRL_BANK_SELECT_M 0x00
75 #define SMF_CTRL_MODULATION_DEPTH 0x01
76 #define SMF_CTRL_BLESS_TYPE 0x02
77 #define SMF_CTRL_FOOT_TYPE 0x04
78 #define SMF_CTRL_PORTAMENT_TIME 0x05
79 #define SMF_CTRL_DATA_ENTRY_M 0x06
80 #define SMF_CTRL_MAIN_VOLUME 0x07
81 #define SMF_CTRL_BALLANCE_CTRL 0x08
82 #define SMF_CTRL_PANPOT 0x0a
83 #define SMF_CTRL_EXPRESSION 0x0b
85 #define SMF_CTRL_BANK_SELECT_L 0x20
86 #define SMF_CTRL_DATA_ENTRY_L 0x26
88 #define SMF_CTRL_HOLD1 0x40
89 #define SMF_CTRL_PORTAMENT 0x41
90 #define SMF_CTRL_SUSTENUTE 0x42
91 #define SMF_CTRL_SOFT_PEDAL 0x43
92 #define SMF_CTRL_HOLD2 0x45
94 #define SMF_CTRL_REVERB 0x5b
95 #define SMF_CTRL_TREMOLO 0x5c
96 #define SMF_CTRL_CHORUS 0x5d
97 #define SMF_CTRL_DELAY 0x5e
98 #define SMF_CTRL_PHASER 0x5f
100 #define SMF_CTRL_DATA_INCLEMENT 0x60
101 #define SMF_CTRL_DATA_DECLIMENT 0x61
102 #define SMF_CTRL_NRPM_L 0x62
103 #define SMF_CTRL_NRPN_M 0x63
104 #define SMF_CTRL_RPN_L 0x64
105 #define SMF_CTRL_RPN_M 0x65
107 #define SMF_CTRL_ALL_SOUND_OFF 0x78
108 #define SMF_CTRL_RESET_ALL_CTRL 0x79
109 #define SMF_CTRL_LOCAL_CONTROL 0x7a
110 #define SMF_CTRL_ALL_NOTE_OFF 0x7b
111 #define SMF_CTRL_OMNI_MODE_OFF 0x7c
112 #define SMF_CTRL_OMNI_MODE_ON 0x7d
113 #define SMF_CTRL_MONO_MODE_ON 0x7e
114 #define SMF_CTRL_POLI_MODE_ON 0x7f
118 int *smf_number_conversion( long num );