Author Topic: Sequencer to Op-Frequency Mapping?  (Read 2786 times)

SMF

  • Team member
  • *
  • Posts: 43
    • View Profile
Sequencer to Op-Frequency Mapping?
« on: December 17, 2020, 02:04:30 PM »
Hi,

I tried to figure out the mapping in between Seq1/2-values and Operator-Frequencies as such I can do the following:

Set up two operators at frequency at frequency "f". Alter the frequency-multiplyer of one of the operators to "n times f", with "n" being the value seen in the according sequencer (Seq1/2).

I tried to set this up in the mod-matrix (Seq1 --> [Multiplier-Value] --> OP1-freq) but whatever I set for the multiplier-value I seem unable to achieve the desired result.

Why do I want to achieve this? For some sounds I would like to create it is essentatial, that I can modulate the frequency of an operator to be an exact integer-multiple-step of the frequency of another one. If there is another way to achieve this (scaled LFO output quantized and used as OP-frequency-multiplyer, maybe?), this would be fine, too...

TIA,
Stefan

(Edith says: typo fixed)
« Last Edit: December 17, 2020, 02:17:40 PM by SMF »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2251
    • View Profile
Re: Sequencer to Op-Frequency Mapping?
« Reply #1 on: December 17, 2020, 07:05:12 PM »

Here is the formula applied to OSC frequency :

Code: [Select]
       mainFrequencyPlusMatrix =  mainFrequency + mainFrequency  * matrix destination * 0.1f;

So i think it should work if you set a multipler 10 in the matrix.

Then  your frequency will be multiplied by (step value  + 1).
0 : Oscr freq
1 : Osc Freq * 2
2 : Osc Freq * 3
etc....


SMF

  • Team member
  • *
  • Posts: 43
    • View Profile
Re: Sequencer to Op-Frequency Mapping?
« Reply #2 on: December 18, 2020, 08:38:42 AM »
Xavier, If i set it up like you suggested, I end up having halftone-steps...?

BTW: Could this be a bug? Halftone-steps are all fractional multiplexers and should all sound at least quite rough when used as modulating operator because it will always break the usual relationship of overtones. So, while this would make sense for "all op frequencies" it clearly doesn't for a single one...

Stefan

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2251
    • View Profile
Re: Sequencer to Op-Frequency Mapping?
« Reply #3 on: December 18, 2020, 08:56:57 AM »
Xavier, If i set it up like you suggested, I end up having halftone-steps...?

No should work as described above :
"Then  your frequency will be multiplied by (step value  + 1)."

Give more details about what you want to achieve and how you do it with a simple example. ALGO 1.

BTW: Could this be a bug? Halftone-steps are all fractional multiplexers and should all sound at least quite rough when used as modulating operator because it will always break the usual relationship of overtones. So, while this would make sense for "all op frequencies" it clearly doesn't for a single one...

Agree, which is why half tone step can only be achieved with "O*Fh"  where the matrix multipler is exactly the number of shifted tone UP and DOWN..

SMF

  • Team member
  • *
  • Posts: 43
    • View Profile
Re: Sequencer to Op-Frequency Mapping?
« Reply #4 on: December 18, 2020, 09:39:33 AM »
will try to (a) reproduce and document what I have done, how it behaves and (b) what I want to get...

best,
Stefan

SMF

  • Team member
  • *
  • Posts: 43
    • View Profile
Re: Sequencer to Op-Frequency Mapping?
« Reply #5 on: December 18, 2020, 07:21:38 PM »
Hello Xavier,

I tried to do the most simplistic test-setup for this scenario I could think of. See the first three images for the settings (basically just a single oscillator being modulated by step-seq1). Image nr. 4 shows the resulting output. A step of 12 halftones upwards.

What I expected was the same "upstairs"-pattern but counted up in "harmonics" from the base-note (262Hz). So, the lowest frequency should have beed (approximately, just omitting the fractions) 262Hz. The next at double that frequency 524Hz. Next at the third harmonic 768Hz.. and so on and so on...

More mathematically: What the setup delivers is (2^(n/12)*f_base) and what I wanted to get was (n*f_base)

best,
Stefan

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2251
    • View Profile
Re: Sequencer to Op-Frequency Mapping?
« Reply #6 on: December 18, 2020, 08:48:34 PM »
OK sorry for my first reply.
I wrote this code in 2013 and it took me some time to remember.

It works like you describe and it works as designed.
LFO have a [-1:1] range, modulator env [0: 1].
And steps has [0 : 1.37841423] range.
Values were chosen do do exactly what you describe :
https://github.com/Ixox/preenfm2/blob/master/src/synth/LfoStepSeq.cpp#L22
So that you can program easily some melody.
As Frequency divide by 10 the matrix value you have to multiply by 10 in the matrix to have the semitone mapping.

What you want requires to modify and recompile the firmware. Change the value in the code above.
With {10, 20, 30, 40... etc }
It's an easy modification, and you would have the firmware that fits  your need.


SMF

  • Team member
  • *
  • Posts: 43
    • View Profile
Re: Sequencer to Op-Frequency Mapping?
« Reply #7 on: December 19, 2020, 04:57:14 PM »
OK, while I could change the firmware it would mean that the patch-set I am currently creating would be incompatible with all the other Preens out there... So, I will just not do this type of sounds... ;)