source file of the GNU LilyPond music typesetter
- (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "midi-item.hh"
#include "string-convert.hh"
#include "midi-stream.hh"
#include "duration.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
+
#include "killing-cons.tcc"
#define PITCH_WHEEL_TOP 0x3FFF
String length_string = String_convert::int2hex (dat.length ()
+ footer_string_.length (), 8, '0');
length_string = String_convert::hex2bin (length_string);
+
str += length_string;
str += dat;
str += footer_string_;
+
return str;
}
Midi_event::to_string () const
{
Rational rat_dt = (delta_mom_.main_part_ * Rational (384)
- + delta_mom_.grace_part_ * Rational (100))*Rational (4);
- int delta_i = int (rat_dt);
+ + delta_mom_.grace_part_ * Rational (100)) * Rational (4);
+ int delta_i = rat_dt.to_int ();
String delta_string = Midi_item::i2varint_string (delta_i);
String midi_string = midi_->to_string ();
String format_string = String_convert::int2hex (format_i, 4, '0');
str += String_convert::hex2bin (format_string);
-
+
String tracks_string = String_convert::int2hex (tracks_i, 4, '0');
str += String_convert::hex2bin (tracks_string);
else
warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
- String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME: Should be track. -rz
+ String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz
str += ::to_string ((char)program_byte);
return str;
}
return String_convert::hex2bin (str);
}
-Midi_time_signature::Midi_time_signature (Audio_time_signature* a)
+Midi_time_signature::Midi_time_signature (Audio_time_signature *a)
{
audio_ = a;
clocks_per_1_ = 18;
String str = "ff5804";
str += String_convert::int2hex (num, 2, '0');
- str += String_convert::int2hex (intlog2 (den) , 2, '0');
+ str += String_convert::int2hex (intlog2 (den), 2, '0');
str += String_convert::int2hex (clocks_per_1_, 2, '0');
str += String_convert::int2hex (8, 2, '0');
return String_convert::hex2bin (str);
}
-Midi_note::Midi_note (Audio_note* a)
+Midi_note::Midi_note (Audio_note *a)
{
audio_ = a;
dynamic_byte_ = 0x7f;
// print warning if fine tuning was needed, HJJ
if (get_fine_tuning () != 0)
{
- warning (_f ("Experimental: temporarily fine tuning (of %d cents) a channel.",
+ warning (_f ("experimental: temporarily fine tuning (of %d cents) a channel.",
get_fine_tuning ()));
finetune = PITCH_WHEEL_CENTER;
*/
static Real const full_scale = 127;
- int volume = (int) (audio_->volume_*full_scale);
+ int volume = (int) (audio_->volume_ * full_scale);
if (volume <= 0)
volume = 1;
if (volume > full_scale)
return String_convert::hex2bin (str);
}
-Midi_text::Midi_text (Audio_text* a)
+Midi_text::Midi_text (Audio_text *a)
{
audio_ = a;
}
Midi_track::data_string () const
{
String str = Midi_chunk::data_string ();
- if (midi_debug_global_b)
+ if (do_midi_debugging_global)
str += "\n";
for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_)
{
str += i->car_->to_string ();
- if (midi_debug_global_b)
+ if (do_midi_debugging_global)
str += "\n";
}
return str;
}
+
+
+char const *
+Midi_item::name () const
+{
+ return this->class_name ();
+}