2 // my-midi-parser.hh -- declare My_midi_parser
4 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
6 #ifndef MY_MIDI_PARSER_HH
7 #define MY_MIDI_PARSER_HH
10 // #include "string.hh"
15 class My_midi_parser
{
17 My_midi_parser( String filename_str
);
20 void add_score( Midi_score
* midi_score_p
);
21 void error( char const* sz_l
);
23 void forward( int i
);
25 void note_begin( int channel_i
, int pitch_i
, int dyn_i
);
26 Midi_event
* note_end_midi_event_p( int channel_i
, int pitch_i
, int dyn_i
);
27 int output_mudela( String filename_str
);
29 void set_division_4( int division_4_i
);
30 void set_key( int accidentals_i
, int minor_i
);
31 void set_tempo( int useconds_i
);
32 void set_time( int num_i
, int den_i
, int clocks_i
, int count_32_i
);
36 String copyright_str_
;
37 String instrument_str_
;
38 String track_name_str_
;
40 Midi_key
* midi_key_p_
;
41 Midi_tempo
* midi_tempo_p_
;
42 Midi_time
* midi_time_p_
;
45 Int64 now_i64_
; // 31 bits yields tipically about 1000 bars
47 static int const CHANNELS_i
= 16;
48 static int const PITCHES_i
= 128;
49 Int64 running_i64_i64_a_
[ CHANNELS_i
][ PITCHES_i
];
51 Midi_score
* midi_score_p_
;
54 char const* defined_ch_c_l_
;
56 My_midi_lexer
* midi_lexer_p_
;
59 extern My_midi_parser
* midi_parser_l_g
;
61 #endif // MY_MIDI_PARSER_HH