Recent Posts

Pages: [1] 2 3 ... 10
1
PreenFM2 / Re: Thoughts about operator tuning
« Last post by lokki on Today at 12:04:27 AM »
actually that makes sense, it is more trivial then the change i tried to do with midi-offset.

but then again, i will first try and then say how easy it was :-)
2
PreenFM2 / Re: global tune, midi-offset for presets and more...
« Last post by lokki on August 15, 2017, 08:20:36 PM »
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. :-(
3
PreenFM2 / Re: global tune, midi-offset for presets and more...
« Last post by Xavier on August 15, 2017, 03:21:43 PM »

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
4
PreenFM2 / Re: Thoughts about operator tuning
« Last post by Xavier on August 15, 2017, 03:03:51 PM »
I'm away from home for a couple of weeks still so i cannot try anything.

The suggestion from SirPrimalform in the first message of this thread sounds good to me.
Here are some clues.

I don't think you need new variables.
Add a new Constant here :
https://github.com/Ixox/preenfm2/blob/master/src/synth/SynthState.h#L250

Modify SynthState.cpp
https://github.com/Ixox/preenfm2/blob/master/src/synth/SynthState.cpp#L198
To add your UI string for this new "Frequency type" value.
Line 204 replace OSC_FT_FIXE by the new constat you added in SynthState.h.

At this point the value should show up in the UI.

Modify Osc.cpp and add a "case" in the switch to calculate your frequecy when the new Ftype is selected.
Use the variable detune for your Hertz detune calculation.

I don't think you need to modify FMDIsplay.cpp but you can search for "OSC_FT_" and see there are some hack there to have the display show/hide ftune depending on FType.

Make sense ?
5
PreenFM2 / Re: Thoughts about operator tuning
« Last post by lokki on August 15, 2017, 12:58:18 AM »
the actual mod to Osc.cpp is very trivial indeed. the hard part (for me) is the UI, i don't understand how variables are named or even if they are created when i add a new parameterRow...

well i'm a noob, sorry...
6
PreenFM2 / Re: global tune, midi-offset for presets and more...
« Last post by lokki on August 15, 2017, 12:54:16 AM »
thanks for the heads up. i think i did global tune! have to check tomorrow with the unit. while i was at it, i also tried the midi-offset thing i described. i added another parameterrowengine for the midi offset and it compiles fine. so the ui part should work. i'm not sure how to get a variable from my new entry though. where is for example oscillator->detune (used in Osc.cpp) defined? i don't see how the detune menu affects this variable (or where). 

sorry for the maybe silly questions.
7
PreenFM2 / Re: Thoughts about operator tuning
« Last post by Xavier on August 14, 2017, 03:56:28 PM »
this is an old topic, but i would like to see this implemented as well!

I don't have any plan to implement this.
But Lokki, now you know where the change would be  ;)
https://github.com/Ixox/preenfm2/blob/master/src/synth/Osc.cpp#L178

Ftype menu is defined here :
https://github.com/Ixox/preenfm2/blob/master/src/synth/SynthState.cpp#L204

Xavier
8
PreenFM2 / Re: Envelope for amplitude ?
« Last post by Xavier on August 14, 2017, 03:43:24 PM »
Hi,

Every operator has its own enveloppe that can be set. See part 2 here :
http://ixox.fr/preenfm2/manual/synth-edit-mode/


Xavier
9
PreenFM2 / Re: simply great
« Last post by Xavier on August 14, 2017, 03:39:07 PM »

Thanks for the feedback :)
So glad to read this....
10
PreenFM2 / Re: global tune, midi-offset for presets and more...
« Last post by Xavier on August 14, 2017, 03:37:29 PM »
.... would need some ideas as to where the midi to frequency is happening in the code, global-tune would just be a constant fractional value added to the midi note.

Here is the newNote function where the frequency array is used.
https://github.com/Ixox/preenfm2/blob/master/src/synth/Osc.cpp#L180
(+ glideToNote function just bellow).

In the Osc.cpp init function, it should be easy to modify frequencies. Multiply all 128 values by 442/440 and you'll get a 442 hertz reference.

The array is one of the pre-generated array in :
https://github.com/Ixox/preenfm2/blob/master/waveforms/waves.c

Xavier
Pages: [1] 2 3 ... 10