expr pow(2.,($f1/12.)) Octave calculation issues
johno
10月 17 2024 | 8:17 午後
Hi Folks,
I'm trying to calculate semitone values in a scale from a specific frequency value using
[expr pow(2.,($f1/12.))]
and add them to a [coll].
It generally works fine, but
when it calculates octaves it seems to truncate the numbers after the decimal point. I have checked the output of the expr object and it is multiplying by 2. (rather than 2) and it is being given a float in the first place.
Has anyone got any ideas on why this is and how to fix it. Otherwise my octaves will be slightly flat each time.
thanks in advance,
John
Roman Thilenius
10月 17 2024 | 11:01 午後
the patch doesnt work for me, but could swear i see a [t b i b] at the top.
Roman Thilenius
10月 18 2024 | 2:51 午前
yeah it is superspecial, it can transform 261.626 into 261 even if you did not want this.
johno
10月 18 2024 | 9:38 午前
@Roman Thilenius
Doh!! I didn't spot that one. I had been scratching my head about this for quite a few hours. I think that is the only place I didn't fully investigate! It all works now. Thanks.
@Wil
Thanks for the alternative patch. I dig into that one and check your approach. Thanks!!