]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.39
authorfred <fred>
Fri, 28 Feb 1997 17:49:48 +0000 (17:49 +0000)
committerfred <fred>
Fri, 28 Feb 1997 17:49:48 +0000 (17:49 +0000)
m2m/include/midi-event.hh [new file with mode: 0644]

diff --git a/m2m/include/midi-event.hh b/m2m/include/midi-event.hh
new file mode 100644 (file)
index 0000000..faaf60e
--- /dev/null
@@ -0,0 +1,95 @@
+//
+// midi-event.hh -- declare midi_event
+//
+// copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
+
+#ifndef MIDI_EVENT_HH
+#define MIDI_EVENT_HH
+
+
+// should these:
+// * be Midi_items
+// * be Voice_elements/requests
+// * get a name-change
+// ?
+
+/// (midi_event)
+class Midi_event {
+public:
+       Midi_event();
+       
+       virtual String mudela_str( bool command_mode_bo ) = 0;
+       void output_mudela( Lily_stream& lily_stream_r, bool command_mode_bo );
+       virtual Moment mom();
+};
+
+class Midi_key : public Midi_event {
+public:
+       Midi_key( int accidentals_i, int minor_i );
+
+       String notename_str( int pitch_i );
+       virtual String mudela_str( bool command_mode_bo );
+
+private:
+       int accidentals_i_;
+       int minor_i_;
+       int key_i_;
+};
+
+class Midi_note : public Midi_event {
+public:
+       int const c0_pitch_i_c_ = 60;
+
+       Midi_note( String name_str, Duration dur );
+       virtual Moment mom();
+       virtual String mudela_str( bool command_mode_bo );
+       
+private:
+       bool const simple_plet_bo_ = false;
+       Duration dur_;
+       String name_str_;
+};
+
+class Midi_tempo : public Midi_event {
+public:
+       Midi_tempo( int useconds_per_4_i );
+
+       int get_tempo_i( Moment moment );
+       virtual String mudela_str( bool command_mode_bo );
+
+private:
+       int useconds_per_4_i_;
+       Real seconds_per_1_f_;
+};
+
+class Midi_text : public Midi_event {
+public:
+       enum Type { 
+               TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, 
+               MARKER, CUE_POINT
+       };
+       Midi_text( Midi_text::Type type,  String str );
+       virtual String mudela_str( bool command_mode_bo );
+private:
+       Type type_;
+       String text_str_;
+};
+
+class Midi_time : public Midi_event {
+public:
+       Midi_time( int num_i, int den_i, int division_4_i, int count_32_i );
+
+       Duration i2_dur( int time_i, int division_1_i );
+       int clocks_1_i();
+       virtual String mudela_str( bool command_mode_bo );
+
+private:
+       Real sync_f_;
+       Duration sync_dur_;
+       int clocks_1_i_;
+       int num_i_;
+       int den_i_;
+};
+
+#endif // MIDI_EVENT_HH
+