value handling in methode with faults
Posted: Mon Aug 05, 2019 7:28 pm
Hi,
i've been searching for a fault in my code for hours. Now I'd like to get any help from this forum.
Long time ago I programmed with Turbo Pascal quite well. Now I just started with Java and get many problems, then - OOP is rather hard to get in.
In VMD I wrote this small method:
With Log() I can see that it works fine.
That method is called in another method:
tone1 and octave1 are declared in [User variables & Functions] as byte.
The calling method always gets zero values given back. And I can't find out why.
I already renamed the variables in order to prevent from "hidden" variable name collisions.
I also tryed to use int type instead of byte.
Has anybody an idea what is going on?
i've been searching for a fault in my code for hours. Now I'd like to get any help from this forum.
Long time ago I programmed with Turbo Pascal quite well. Now I just started with Java and get many problems, then - OOP is rather hard to get in.
In VMD I wrote this small method:
Code: Select all
public void voltageToToneAndOctave (double cvValue, byte toneNr, byte octaveNr)
{
toneNr = (byte)((cvValue % 1) * 12.); // isolate tone value 0..0.999
octaveNr = (byte)cvValue;
Log("voltageToToneAndOctave 843 value="+cvValue+" toneNr="+toneNr+" octaveNr="+octaveNr);
}
That method is called in another method:
Code: Select all
voltageToToneAndOctave(newSignalValue1, tone1, octave1);
Log("DVM1 437 value="+newSignalValue1+" tone1="+tone1+" octave1="+octave1);
The calling method always gets zero values given back. And I can't find out why.
I already renamed the variables in order to prevent from "hidden" variable name collisions.
I also tryed to use int type instead of byte.
Has anybody an idea what is going on?