back to list

MOS software challenge

🔗Carl Lumma <clumma@xxx.xxxx>

3/9/1999 8:23:25 PM

To identify an MOS, you need...

1. Generator
2. Interval of equivalence
3. Number of elements in chain

...can you imagine a little program that takes any two as input and turns
out a range for the third?

Carl

🔗manuel.op.de.coul@xxx.xx

4/2/1999 5:00:21 AM

Carl Lumma wrote 10-03-99:
> To identify an MOS, you need...
>
> 1. Generator
> 2. Interval of equivalence
> 3. Number of elements in chain

> ...can you imagine a little program that takes any two as input and turns
> out a range for the third?

You didn't specify what property or constraint on the MOS you want to
accomplish.
I once wrote a routine that takes 2. and 3. and gives a range for the
generator for the scale to be monotonic, preserving Myhill's property.
It also needs to know the pitch class of the generator. Obviously if the
generator is degree 1 in a chain of twelve, there is a different range than
when it's degree 7. Here's the code, I don't now if this is what you had in
mind. I suppose it might be modified to take 1. and 3. and produce 2.
although I haven't thought about this.

procedure Pythagorean_Fifth_Limits (Scale_Size : in Positive;
Octave : in Long_Float;
Fifth_Degree : in Positive;
Lower_Limit : out Long_Float;
Upper_Limit : out Long_Float) is
Mlt : Positive := 1;
Log_Oct : constant Long_Float := Log2(Octave);
Eqf : constant Long_Float :=
Log_Oct * Long_Float(Fifth_Degree) / Long_Float(Scale_Size);
begin
if Fifth_Degree >= Scale_Size or else
Octave <= 0.0 or else
Scale_Size = 1 or else
Greatest_Common_Divisor(Fifth_Degree, Scale_Size) /= 1 then
raise Argument_Error;
end if;
while (Mlt * Fifth_Degree) mod Scale_Size /= 1 loop
Mlt := Mlt + 1;
end loop;
Lower_Limit := Eqf - (Log_Oct / Long_Float(Scale_Size * Mlt));
Upper_Limit := Eqf + (Log_Oct / Long_Float(Scale_Size *
(Scale_Size - Mlt)));
end Pythagorean_Fifth_Limits;

Manuel Op de Coul coul@ezh.nl