So I've been thinking about non-Western scales and microtunings and
stuff. Big subject, not one I know a great deal about, but certainly
an interesting one and it's come up a few times on various lists
recently.
Let me ramble on for a bit about storing and representing notes in
different tunings. I'm not thinking about how to actually play
notes with precise tunings yet (there are various ways to do that).
Rosegarden currently stores the pitch of a note using MIDI values,
that is, as an integer in the range 0-127 where consecutive pitches
are a semitone apart and there are 12 equal semitones in the octave.
This pitch information is usually present in the context of a key,
defining which of those semitones are in a particular scale; and
each note stores an optional accidental, used only to determine how
to draw the note on the staff (i.e. the pitch value alone determines
its performed pitch at the moment).
Tunings that do not fit into this system appear to me to fall into
three categories:
a. Scales that fit within this system except that they add one or
more notes that need to be represented differently on screen as
well as played differently. For example, an Arabic scale might
fit entirely within this system except for one or more quarter-
tones that need to be represented with a quarter-tone accidental.
b. Re-tunings of this system, such as just intonations and Lucy
tuning. In many cases these can be represented using the same
staff, notes and accidentals as we use, but the performed pitch
(i.e. in Hz) of a note depends on the key, and a sharp almost
always differs from the flat of the next note up.
c. Other scales that have entirely different numbers of notes per
octave scale, etc.
One problem is that the most natural ways to handle these categories,
given our current scheme, differ. (Note: I am probably seriously
oversimplifying these things. That's why I'm posting this, so
people can laugh in my face and rubbish me.)
Scales in group a contain notes that fall between MIDI pitches, and
compositions in these scales might legitimately use both MIDI pitch
N and N+1 as well as the quarter-tone in between. So the quarter-
tone notes can't be assigned their own MIDI pitches. Either the
pitch could be deduced from the accidental (e.g. quarter tone below
62 stored as 62-with-quarter-tone-down-accidental, in contrast to
the semitone below 62 which is now stored as 61-with-flat, not 62-
with-flat) or the note could have a finer tuning value stored as
well (e.g. quarter tone below 62 stored as 61 with fine tuning
value of e.g. 50 cents, and a quarter-tone-below accidental).
Of course one could represent quarter tones easily by doubling the
pitch range from 0-255 and halving on playback, but in general that
won't help for the other categories.
Scales in group b (as described) are entirely representable with
MIDI pitch plus accidental and key in the way we do now. The
performed pitch of note 61 would depend on whether it was 60-sharp
or 62-flat and which key it was in, and this calculation could get
pretty hairy. That could be simplified if the stored pitch range
was changed so as to permit a different number of pitch classes
per octave (so 61 might be 60-sharp, 62 might be 63-flat, and 72
would not be an octave above 60) but that would complicate the
matter of basic compatibility with MIDI, which is also undesirable.
The first option (plain MIDI pitch plus accidental and key) also
has the potential disadvantage that not all the pitches defined
in an octave for a given tuning would be accessible at once, as
the selection accessible would depend on the current key.
Scales in group c really _do_ beg for the pitch range to be
changed to fit, so that there are no longer even nominally 12
semitones per octave.
There are surely big dependencies here on how people actually want
to write and manipulate these scales, too. Since my understanding
is very limited, I'd ideally like to be able to come up with some
magic solution that was very simple and general so that I didn't
suddenly find I'd missed something very important later -- but I'm
not sure that's entirely possible.
I took a look at Scala, which is a tool for calculating and setting
tunings. The problem with it (from our perspective) is that it's
_too_ simple and flexible: it represents a scale as simply a set
of tunings per octave, without any information about which notes
are which (for example, as far as it's concerned the default MIDI
tuning consists of 12 equal semitones and nothing more, whereas to
represent and edit that we still need to know that certain notes
are "in scale" and others have accidentals, etc).
Thoughts, anyone?
Chris
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Rosegarden-devel mailing list
[EMAIL PROTECTED] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel