ibancg / lingot

Musical instrument tuner
http://savannah.nongnu.org/projects/lingot/
GNU General Public License v2.0
85 stars 12 forks source link

Scala files larger than one octave not working #59

Open fanglingsu opened 4 years ago

fanglingsu commented 4 years ago

I wanted to use the "stopper.scl" out of the http://huygens-fokker.org/docs/scales.zip which is based on duodecimes instead of octaves. If I import it the error "Error: There are invalid values in the scale: all the notes should be in the same octave" appears.

Is there a way to change the scala file in a way to be used by lingot?

ibancg commented 4 years ago

Hi,

I am afraid this is not supported in LINGOT at the moment: you have to specify the notes within one octave. I just did not think of non "octave-periodic" scales when I wrote this, but now that you mention it, I find it very interesting. I will definitely look for a way to support it properly.

In the meantime, the only workaround I can think of, and quite an unpractical one, is that you specify the first 12 notes of the scale with the equal temperament ratio 3^(1/19) from the Stopper scale, below in .scl format:

! stopper.scl
!
Bernard Stopper, piano tuning with 19th root of 3 (1988). Only the 12 first notes
 12
!
 100.10289  C#
 200.20579  D
 300.30868  D#
 400.41158  E
 500.51447  F
 600.61737  F#
 700.72026  G
 800.82316  G#
 900.92605  A
 1001.02895 A#
 1101.13184 B
 2/1        C

and hard-code the base frequency for each of the scales you are gonna use. The extrapolated C0 - C8 frequencies according to that temperament would be:

C0: 16.2963 Hz 
C1: 32.6158 Hz 
C2: 65.2782 Hz 
C3: 130.6496 Hz 
C4: 261.4857 Hz 
C5: 523.3444 Hz 
C6: 1047.4357 Hz 
C7: 2096.3659 Hz 
C8: 4195.7232 Hz

which you can introduce in the following widget in the UI, here shown for the notes C1 - B1:

image

The problem is that, once you press Apply or OK, you can only use tune notes in that scale C1 - B1. You will need to change it every time you move to another scale, or have several instances of LINGOT running, one per scale. You can also save one config file per octave, no need to remember all the frequencies.

As I said, I'll look for a better option.

Thanks for the feedback!

fanglingsu commented 4 years ago

@ibancg Thank you for your fast reply. I'll try your approach out. I want to tune my piano so I think it's enough to tune a single duodecime somewhere in the center of the piano and transfer the remaining keys by clean duodecimes.