Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - lokki

Pages: 1 2 [3] 4 5 ... 14
PreenFM2 / Re: midi offset
« on: December 29, 2017, 10:33:43 AM »
On microcontroller, const are not moved to RAM, they stay on the flash memory, so they're slower. That's fine for your tuneFactor, but not for value used in the real time audio engine.

i see. i often use const on arduino, because i though it would speed up things :-) but arduino may be different...will do some benchmarks :-)

PreenFM2 / Re: midi offset
« on: December 28, 2017, 10:52:57 PM »
xavier, thanks for this indepth answer.

i implemented it as per your suggestion:

Code: [Select]
float  tuneFactor[] = {435.0,435.5,436.0,436.5,437.0,437.5,438.0,438.5,439.0,439.5,440.0,440.5,441.0,441.5,442.0,442.5,443.0,443.5,444.0} ;
float frecAdjust = tuneFactor[this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE]] / 440.0f;
 for (int k=0; k<127; k++) {
midiNoteTunedFrequency[k]= frequency[k] * frecAdjust;
        // Set frequencyToUse  to frequency (no Scala scale defined)
        frequencyToUse = midiNoteTunedFrequency;

but the problem persists, no change in tuning even after a reboot.

i did not yet do the part in SynthState.cpp, but that would only be to have immediate change when i adjust the value, right? or is this the crucial step i'm missing and the reason why the tuning does not change  ??? EDIT: calling Osc Init from there?
(i do not fully get that part, would i have to do the same calculation in the brackets there as well? or do i leave just empty brackets? or have a propagateNewParamValue in there?)

also on a related note: is there any reason why the frequency array in waves2.c is not declared as a const? if a scala file is used that array is not manipulated i think. would that not be more efficient? (my tuneFactor should also be const :-))

PreenFM2 / modsource idea (SOLVED)
« on: December 27, 2017, 11:40:12 PM »
hi all,

what about a random modsource that gets updated only when a new note is played?


-add a very small amount to o*Fq to get slightly detuned notes for a more natural feeling
-filter cutoff variation on noteon
-pan randomly each note

or is this already possible and i'm missing how to do this?
EDIT: is lfo1 random set to frequency 0.00 the solution?
EDIT2: YES, that works, wohoo, nice!


PreenFM2 / Re: midi offset
« on: December 27, 2017, 09:50:24 PM »
ok,  i tried this in osc.cpp just before frequencyToUse = frequency:

Code: [Select]
float currentA = frequency[81];
 for (int k=0; k<127; k++) {
frequency[k] = frequency[k] * ((870.0 + this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE])/currentA);

everything still works but changing the global_tune value has no effect :-(

even a reboot of the preenfm does not change the tuning.

as i said i don't know any further than this...sorry for all the questions.

PreenFM2 / Re: midi offset
« on: December 27, 2017, 04:53:41 PM »
thanks xavier,

yeah i see now, why it does not work :-) i was tired yesterday...
you make good points of course and most of them i though about as well, but:

unfortunately i don't know enough about the preenfm source to make this happen only at boot time or when the settings are changed...
also i remember trying to change the frequency array in osc.cpp in an earlier attempt but i will try again. i don't know enough about floats and their precision, but wouldn't manipulating the array back and forth (changing tuning from 438 to 442 repeatedly for example)  introduce errors over time?  would the value also be updated before i save the config? i ask because it is much easier to tune when you can play a note and immediately hear the change.

PreenFM2 / Re: midi offset
« on: December 26, 2017, 10:29:14 PM »
ok, globaltune is next :-)

i thought i could do it in the same place in osc.h where the matrix stuff is done and tried this:

(line 57)
Code: [Select]
oscState->mainFrequencyPlusMatrix +=  (oscState->mainFrequency  * (matrix->getDestination(destFreq) + matrix->getDestination(ALL_OSC_FREQ)) * .1f) * ((435.0 + (this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE] / 2.0)) / 440.0);

this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE] is a value i added in the global menu ranging from 435 to 444 in 0.5 steps. so this makes 19 possible values with 440.0 represented by value 10.

this is the code in menu.cpp

Code: [Select]
const char* tuneSteps[] = {"435.0", "435.5", "436.0", "436.5", "437.0", "437.5", "438.0", "438.5", "439.0", "439.5", "440.0", "440.5", "441.0", "441.5", "442.0","442.5", "443.0", "443.5", "444.0", };

the code compiles fine, modulating the pitch with the matrix still works as expected but adjusting the value in the global menu has no effect. do you see any obvious errors? why does  "this->synthState->fullState.midiConfigValue[MIDICONFIG_GLOBAL_TUNE] "  not get updated?

PreenFM2 / Re: midi offset
« on: December 23, 2017, 04:55:11 PM »
ok, i couldn't resist and had a spare two minutes :-)

it works very well with a value of 10.0. this gives me three octaves higher at 7.0 and at -8.0 :-) so yes negative values just get mirrored after -1.0... and one or two octaves lower are still possible with -0.5 and -0.75. three octaves lower is not precise anymore but that is ok for me. (i don't need it)

nice and thanks for your idea and support, really appreciated.

PreenFM2 / Re: midi offset
« on: December 23, 2017, 04:39:42 PM »
thanks for that. will try it after christmas :-)

i think 1 2 4 8 makes no sense, since you add 1 in the formula for the freq calc.
so better to just use 10.0 for example. gives a big range and some undocumented behaviour below -1.0 :) let's see what happens.

PreenFM2 / Re: midi offset
« on: December 23, 2017, 12:08:15 AM »
hi xavier,

ok almost there. i added a cnst menu entry and it is showed in the matrix source menu. can you tell me where and how i should declare the constant value? i cannot set it in the enum directly it seems.

PreenFM2 / Re: midi offset
« on: December 22, 2017, 08:39:21 PM »
thanks xavier, that works!

i'm losing lfo1 of course but it should be easy enough to code in a constant as matrix source, will give this a go. might even be useful for other things.
thanks for the idea, obvious now that i think about it :-)

PreenFM2 / midi offset and EDIT: globaltune...
« on: December 22, 2017, 12:54:31 PM »
hi xavier, i know i brought this up before in different contexts. do you see any chance of including a midi offset to a specific timbre?

it would be super useful for live playing, since one can then centre the patches in the right octave instantly on program change, without the need to fiddle with the octave switch on a keyboard or similar. it would also allow to play multiple timbres with one controller by simply changing midi channel without touching the octave button.

the ideal way would be an offset that is adjustable by +-48 semitones, but even just the possibility to change octaves (say +-3) would be great.

i don't see a way to add this without changing the preset files. if it would be added to the combo files, that would be perfect, but adding another page in the instrument menu seems out of the question for you.

thanks for considering,

have a great christmas time

well the way it arrived the part (voltage regulator) was broken, it got hot and did output 2.05v instead of 5v. see this site, if you are interested: (search for regulator).

well it could be that the part was broken from the beginning or that there was a wall wart with bad polarity inserted at one point, that made it break. i don't know. if it was like this from the beginning it would be a little strange since they should test this before sending the synth to you...

just as a follow up:

the voltage regulator (7805) was bogus, it only outputted 2.05 v and got very hot... replaced that and the preenfm is alive with wall wart! since this was a revC board i also did the oled modifications and added a shield to reduce the high frequency noise...

so now i have two preen fm's , nice!

merry christmas to everybody else as well :-)

hi, i'm interested.

would this be the metal case from here?

also, what would shipping to switzerland cost? does not have to be quick...


PreenFM2 / Re: (compatibility?) questions
« on: December 01, 2017, 02:10:01 PM »
simply get a powerpack that you normally use to charge smartphones etc. connect via usb to the preenfm and you should be portable. i have no idea how long the battery will last though :-)

Pages: 1 2 [3] 4 5 ... 14