Rational numbers in D

Stewart Gordon smjg_1998 at yahoo.com
Sun Jun 10 17:35:13 PDT 2012


On 10/06/2012 02:17, Joseph Rushton Wakeling wrote:
> On 10/06/12 00:52, Stewart Gordon wrote:
>> By using an integer type to store pitches in such a way that the semitone is the
>> basic unit.
>>
>> Do you compose music that makes use of demisemitones, thirds of tones, and so on?
>
> Yes, I use quarter-tones.  Other people use other intervals (e.g. in Turkish music there
> are intervals of 1/9, 4/9, 5/9 and 8/9 of a tone; and let's not even get into what Harry
> Partch and his compositional descendants have used).
<snip>

Are you not getting into that because his system uses irrational multiples of tones?

Supporting just intonation as well as equal temperament would be a good long-term plan. 
One way to achieve this would be to give the user the choice of rational numbers 
representing multiples of tones (or semitones or octaves) and rational numbers 
representing frequency ratios.  But you might be only worrying about supporting the former 
at the moment.

Stewart.


More information about the Digitalmars-d mailing list