I have a fork of QSynth on GitHub, in which I'm trying to add a menu for
retuning notes.
https://github.com/LiamM32/qsynth
I am not experienced in programming or good at C/C++, so bear with me.
First I'm trying to make it display the current values of each note, but
I can't get the function "|fluid_synth_tuning_dump|" to work. In the
image I attached, you can see the strange numbers in the "detune"
column, which are supposed to be set to the pitch of each note in
cents. Through a debugger, I have found that these are the default
values from when the array was initialized (don't know why). The
function isn't actually modifying the values in this array as it's
supposed to.
Maybe I'm not properly passing the array into the function. I used to
simply pass the array into the function like this, back when I had a
worse understanding of C++. (I shelved this project a while ago, but
returned to it recently.)
|double tuningcents[128];|
|::fluid_synth_tuning_dump(m_pSynth, tuningBank, tuningProg, NULL,
0, tuningcents);|
This didn't work. But looking at it now, I notice that the last
parameter is supposed to be a pointer to a double. So I changed it to this:
|double tuningcents[128];
double* pTuningcents = tuningcents;
||::fluid_synth_tuning_dump(m_pSynth, tuningBank, tuningProg, NULL,
0, pTuningcents);|
But it's still not changing the values in the "|tuningcents|" array.
You can see the exact lines I wrote in /qSynthTuningsForm.cpp
<https://github.com/LiamM32/qsynth/blob/master/src/qsynthTuningsForm.cpp>
/in function "|qsynthTuningsForm::updateAllKeyTunings()|".
"|tuningcents|" & "|pTuningcents|" are member variables of the
"|qsynthTuningsForm|" class. Should they be public, private, or
protected? Should "|fluid_synth_tuning_dump|" be a friend function to
this class?
||||||||
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev