floating point array
bob800
Posts: 2
I'd like to create a floating-point array, mapping various MIDI note values to their respective frequencies. I found the following C code which should accomplish this:
I know how to convert most this to SPIN language, using one of the available floating-point libraries, but where I am lost is how to create a floating point array for midi[]. E.g., the F32 float library contains floating-point arithmetic functions, but how do I store the results in a variable? When I try to define anything as "float" in the VAR block, I get the following error: "Expected BYTE, WORD, or LONG".
Any suggestions would be greatly appreciated!
[COLOR=#000000]float midi[127];[/COLOR] int a = 440; for (int x = 0; x < 127; ++x) { midi[x] = (a / 32) * (2 ^ ((x - 9) / 12)); [COLOR=#000000]}[/COLOR]
I know how to convert most this to SPIN language, using one of the available floating-point libraries, but where I am lost is how to create a floating point array for midi[]. E.g., the F32 float library contains floating-point arithmetic functions, but how do I store the results in a variable? When I try to define anything as "float" in the VAR block, I get the following error: "Expected BYTE, WORD, or LONG".
Any suggestions would be greatly appreciated!
Comments
-Phil