surge-synthesizer / tuning-library

Micro-tuning format parsing and frequency finding as a header-only C+ library
https://surge-synth-team.org/tuning-library/
MIT License
84 stars 15 forks source link

Export precision #61

Closed baconpaul closed 2 years ago

baconpaul commented 2 years ago

<@609578720419905575> , <@256888540917399553> reported:

Checked the scala export. Floating point values near zero are being truncated to integers And Scala interprets integers as harmonics We're using the SST Tuning lib - is this expected behaviour?

SingABrightSong commented 2 years ago

Hi, I'm the person who found this when testing Entonal Studio. The issue is specifically that the Tuning Library strips the decimal point from cent values when rounding. A tuning such as 12tet, which has perfectly round cent values by definition, will be exported without the decimal point. As the decimal point is what the Scala format uses to distinguish cents from rational intervals, the 100 cent integers of 12edo are thus parsed as fractions over 1, i.e. integer harmonics. image

baconpaul commented 2 years ago

OK so we found out that this doesn't happen for scales which are generated by the tuning library or scales that are imported from files. This is happening for scales generated by entonal. So now we need to figure out how entonal is generating the SCL files. (And add that as a test case or feature set to tuning lib)

baconpaul commented 2 years ago

Turns out this is an entonal bug