diff --git a/lily/audio-item.cc b/lily/audio-item.cc index a8a78199c7..57c1fa025c 100644 --- a/lily/audio-item.cc +++ b/lily/audio-item.cc @@ -129,7 +129,7 @@ moment_to_real (Moment m) int moment_to_ticks (Moment m) { - return int (moment_to_real (m) * 384 * 4); + return int (moment_to_real (m) * Midi_ticks * 4); } void Audio_span_dynamic::set_end_moment (Moment mom) diff --git a/lily/include/midi-item.hh b/lily/include/midi-item.hh index 57bb2d4da2..22de679cda 100644 --- a/lily/include/midi-item.hh +++ b/lily/include/midi-item.hh @@ -23,6 +23,8 @@ #include "audio-item.hh" #include "std-vector.hh" +int16_t Midi_ticks; + string int2midi_varint_string (int i); /** diff --git a/lily/midi-item.cc b/lily/midi-item.cc index ba29ba0ba5..4af3f16d6c 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -34,6 +34,8 @@ #define PITCH_WHEEL_CENTER 0x2000 #define PITCH_WHEEL_SEMITONE 0X1000 +int16_t Midi_ticks = 960; /* negative value is SMPTE time format */ + Midi_item * Midi_item::get_midi (Audio_item *a) { diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index d9765c6814..4411206c2d 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -86,7 +86,7 @@ Midi_walker::do_start_note (Midi_note *note) assert (note->audio_ == ptr); int now_ticks = ptr->audio_column_->ticks (); int stop_ticks = int (moment_to_real (note->audio_->length_mom_) * - Real (384 * 4)) + now_ticks; + Real (Midi_ticks * 4)) + now_ticks; for (vsize i = 0; i < stop_note_queue.size (); i++) { /* if this pitch already in queue, and is not already ignored */ diff --git a/lily/performance.cc b/lily/performance.cc index 9f840efd25..bd6a91d9cb 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -72,7 +72,7 @@ Performance::output (Midi_stream &midi_stream, { int tracks_ = audio_staffs_.size (); - midi_stream.write (Midi_header (1, tracks_, 384)); + midi_stream.write (Midi_header (1, tracks_, Midi_ticks)); debug_output (_ ("Track...") + " ", false); //Find the first Audio_item in the performance, so all staves start