fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Help with tuning dump function


From: Marcus Weseloh
Subject: Re: [fluid-dev] Help with tuning dump function
Date: Fri, 22 Sep 2017 08:46:29 +0200

Hi Liam,

Check the return value of fluid_synth_tuning_dump. If it failed (i.e it did not return 0), then the tuning you were requesting isn't found. In which case FS would use equal temperament tuning on that bank and program.

Cheers,

Marcus

Am 22.09.2017 08:31 schrieb "Liam McGillivray" <address@hidden>:

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?


_______________________________________________
fluid-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fluid-dev


reply via email to

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