lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIDI tick resolution


From: karl
Subject: Re: MIDI tick resolution
Date: Mon, 19 Mar 2018 14:47:27 +0100 (CET)

Giberto:
> Does anyone know if it possible to change the tick resolution of LilyPond's
> MIDI output to a value other than the default 384? One reason for wanting
> this change is due to the fact that 384 cannot be divided by 5 and so
> quintuplets on a crotchet are not precise. For instance, the default
> settings in my DAW of choice is 960.

It seems pretty hardcoded:
===============
In lily/audio-item.cc:

int
moment_to_ticks (Moment m)
{
  return int (moment_to_real (m) * 384 * 4);
}
===============
In lily/midi-walker.cc:

void
Midi_walker::do_start_note (Midi_note *note)
{
  Audio_item *ptr = items_[index_];
  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;
===============

You could try the attached rudimentary patch and recompile your
lilypond source, see if that solves your problem, and report back.

BTW,
 384 = 128 * 3
 960 =  64 * 3 * 5

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57

Attachment: tick.patch
Description: tick.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]