input code

classic Classic list List threaded Threaded
21 messages Options
Reply | Threaded
Open this post in threaded view

Re: input code

Hans Åberg-2

> On 13 Dec 2019, at 19:51, Freeman Gilmore <[hidden email]> wrote:
>> LilyPond lack a way to indicate intervals,
> I am aware of this part:
>> and accidentals are merely intervals of relative scale degree zero. A 5th has a relative scale degres 4, changes the position on the staff 4 steps, and similar for other intervals. The accidentals do not change the position on the staff.
>> In addition to ly:make-pitch, you might have ly:make-interval. Then one should be able to add and subtract intervals, add then to pitches, and the difference two pitches is an interval.
> I would have to write the function, ly:make-interval.   That would work for the common intervals, 2:3 and 4:5, in ET: but when you get up it the higher harmonic ratio intervals, different people define the intervals differently.   It can be referenced to ET or Pythagorean and the number or what notes used in your system.    For a simple example 4:7, (969¢) meantone is an Aug 6th in ET it is min 7th.   The ratio 8:11, (551¢) can go either way based on you reference.

I wrote C++ code that can do that:

But currently the limitation retuning the MIDI into ET by using the file

It might be easier to just focus the accidentals first, which are represented by a rational number where the flat is 1/2. Say a function ly:make-accidental, with the same properties as intervals, only that it just changes this rational number.

It looks as though note names are just symbols names, and can be a sequence of ASCII letters, - or _, or a Unicode non-ASCII letter.

So one can have note names such as e♭. One possibility is to process symbols into two parts, note and accidental, either by processing the name, or changing the syntax so that they become syntactically separate. The latter has the drawback that one cannot write merely e♭ anymore.