PreenFM > preenfm2 and preenfm3

global tune, midi-offset for presets and more...

<< < (2/2)

Xavier:

Cool for the global tune !  :)

oscillator structure is definied here :
https://github.com/Ixox/preenfm2/blob/master/src/synth/Common.h#L324
This structure is used in the global Synth param structure :
https://github.com/Ixox/preenfm2/blob/master/src/synth/Common.h#L398
Then this global structure variable is defined at the instrument level here :
https://github.com/Ixox/preenfm2/blob/master/src/synth/Timbre.h#L159
(I need to get rid of the space/tab problem, indentation is not nice in github ;) )

Adding a new parameterrowengine is not easy, it will make your memory mapping incompatible with the current presets saved on your USB.
I have this problem for a very long time so that's why convertMemoryToParam and convertParamToMemory functions are for :)
https://github.com/Ixox/preenfm2/blob/master/src/filesystem/PreenFMFileType.cpp#L252

Xavier

lokki:
haha, this seems to be all way over my head... globaltune does not work on the preenfm when i test it now. if i set it to a constant offest value it works. i took a different approach and added a globalTune float variable in osc.cpp and changed the line (and all others that should be affected):

oscState->mainFrequency = frequencyToUse[note]  * oscillator->frequencyMul * (1.0f + oscillator->detune * .05f);

to

oscState->mainFrequency = frequencyToUse[note] *  globalTune * oscillator->frequencyMul * (1.0f + oscillator->detune * .05f);

if i set globalTune = 4.0f in the osc init function it works as expected, everything is tuned higher.

however i tried (naively i think) to access the global_tune menu entry (that i defined in menu.h and menu.cpp) like this:

this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE]  and i did something like this:

globalTune = (4400.0f + (this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE]  - 50)) / 4400.f  (globaltune is defined from 0 to 126 with 50 as 440hz. this should give me 0.1 resolution on the frequency from 435 to 447.6.

this does just not do anything.

even setting

globalTune = this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE]

does not do anything, and that should yield extreme results.

so it seems that my variable access to globaltune is somehow wrong, or the value is not set at all.

menu.cpp entry looks like this:

 {
                "Glb Tune: ",
                "globaltune",
                127,
                0
        },



in other words, i have no idea what i am doing and i am sorry to waste so much of your time. :-(

Navigation

[0] Message Index

[*] Previous page

Go to full version