lilypond-0.1.27
[lilypond.git] / hdr / midi-event.hh
blob06b17221aa06de547769baa2f5baee0b982f451b
1 //
2 // midi-event.hh -- declare midi_event
3 //
4 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
6 #ifndef MIDI_EVENT_HH
7 #define MIDI_EVENT_HH
10 // should these:
11 // * be Midi_items
12 // * be Voice_elements/requests
13 // * get a name-change
14 // ?
16 /// (midi_event)
17 class Midi_event {
18 public:
19 Midi_event();
20 virtual ~Midi_event();
22 virtual String mudela_str(); // = 0;
23 virtual void output_mudela( Lily_stream& lily_stream_r );
24 virtual Moment mom();
26 protected:
27 String mudela_str_;
30 class Midi_key : public Midi_event {
31 public:
32 Midi_key( int accidentals_i, int minor );
33 virtual ~Midi_key();
35 String notename_str( int pitch_i );
37 private:
38 int accidentals_i_;
39 int minor_i_;
40 int key_i_;
43 class Midi_note : public Midi_event {
44 public:
45 int const c0_pitch_i_c_ = 60;
47 Midi_note( Midi_key* midi_key_l, Midi_time* midi_time_l, int division_1_i, int pitch_i, int time_i );
48 virtual ~Midi_note();
50 virtual Moment mom();
52 private:
53 Duration dur_;
56 class Midi_tempo : public Midi_event {
57 public:
58 Midi_tempo( int useconds_per_4_i );
59 virtual ~Midi_tempo();
61 int get_tempo_i( Moment moment );
63 private:
64 int useconds_per_4_i_;
65 Real seconds_per_1_f_;
68 class Midi_time : public Midi_event {
69 public:
70 Midi_time( int num_i, int den_i, int division_4_i, int count_32_i );
71 virtual ~Midi_time();
73 Duration i2_dur( int time_i, int division_1_i );
74 int clocks_1_i();
76 private:
77 Real sync_f_;
78 Duration sync_dur_;
79 int clocks_1_i_;
80 int num_i_;
81 int den_i_;
84 #endif // MIDI_EVENT_HH