fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fluid-dev] Help with tuning dump function


From: Liam McGillivray
Subject: [fluid-dev] Help with tuning dump function
Date: Thu, 21 Sep 2017 20:16:44 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

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 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?

Attachment: Screenshot_20170920_153260.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]