Author Topic: Newbie questions  (Read 16406 times)

SirPrimalform

  • Team member
  • *
  • Posts: 47
    • View Profile
Newbie questions
« on: July 15, 2015, 05:06:01 PM »
Hi,

Not been using my PreenFM2 (or indeed FM/PM in general) for long and I'm still marvelling at the possibilities. There are a few things I'm wondering about though:

The LFO waveform 'saw' sounds a lot like a triangle and there's a noticeable absence of a triangle waveform in the list for the LFO. It seems like maybe it's just a triangle wave misnamed? It wouldn't make sense to have actual separate ramp and saw waveforms when we have positive or negative amounts in the matrix.

On the topic of operator feedback, I understand from other posts that feedback is very difficult to implement with genuine FM like the PreenFM2 uses as opposed to Yamaha's PM version. Assuming the sine waves use a phase accumulator and a look up table, would it not be possible to use PM to calculate the feedback even if the rest of the engine is FM? Forgive me if that's a very stupid question, I'm not a real programmer.

Also, is the S^2 waveform literally just an octave up sine wave? If so, I'm not sure what the point is (other than effectively increasing the range of the ratio to 32). Is there any other special use I'm missing? If not, I'm wondering if I might make a custom firmware build to replace it with a band limited triangle wave? The triangle with its quickly diminishing harmonics seems like an ideal compromise between the pure sine and the rich saw and square.

One last topic - how many harmonics are the saw and square waves bandlimited to? When played further down, the hard bandlimiting almost sounds like they're being tracked by a resonant filter. I assume it's because the ear finds the top harmonic conspicuous because there's nothing above it. I was experimenting with additively generating a saw with just the first 32 harmonics last night and found that it was more pleasing and less resonant sounding if the last few harmonics rolled off in volume so that the top one didn't stick out. If it's possible to change the S^2 wave to a triangle, I might change the saw and square in this way too.
« Last Edit: July 17, 2015, 04:05:09 AM by SirPrimalform »

kuzma_p

  • Team Member
  • ***
  • Posts: 130
    • View Profile
Re: Newbie questions
« Reply #1 on: July 17, 2015, 10:10:25 AM »
Yeah, i can confirm that Saw isn't Saw but Triangle.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: Newbie questions
« Reply #2 on: July 17, 2015, 03:24:53 PM »
I confirm it too. Sorry for the confusion.
The Saw is a triangle.
And the "ramp" LFO is a saw  :)

s^2 is a sin*sin so it's one octave above sin and should have a different spectrum too.

Feedback is not that hard to implement. It requires a low pass filter to prevent pitch shifting. But preenfm2 already do that in algo with more than 2 Operator in cascade.
Problems is that it adds some CPU overhead that i cannot afford.
And where to add feedback in each algo ? Idealy on every operator... :)
Also feedback is less usefull when you can chose a waveform for each oscilator.

I made several tests with a mix of PM and FM but nothing was really worth it.
I decided to go without feedback.. I'll stick with that ;)

How many harmonics ?
The waveform are generated by this small java  program :
https://github.com/Ixox/preenFM2/blob/master/waveforms/waveforms.java
The answer is 20 harmonics for square and "triangle". The others are not bandwidth limited.
The problem is that i don't remember if i used the default value for the waveform currently in the firmware  ::)
Check with a spectrum analyser.
You can also use this code to rebuild you waveform with more or less harmonics and recompile your firmware ;)

Xavier




« Last Edit: July 17, 2015, 03:31:39 PM by Xavier »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: Newbie questions
« Reply #3 on: July 17, 2015, 03:31:07 PM »
The answer is in the code, the order is written there :
https://github.com/Ixox/preenFM2/blob/master/waveforms/waves.c

So order : 20.
Reminder : square only uses every other harmonic so you'll find only 10 harmonics.

Xavier

SirPrimalform

  • Team member
  • *
  • Posts: 47
    • View Profile
Re: Newbie questions
« Reply #4 on: July 17, 2015, 06:13:44 PM »
Well it's true we can select saw and noise for the operators, but feedback gives some nice intermediate states. The possibility of feedback on every oscillator would be amazing. Maybe for the PreenFM3 eh?

By sin*sin, do you mean they are effectively ring modulated? Either way, I'll have to experiment with it some more if it has some harmonics that I missed. I'd still like to try swapping in a triangle wave at some point if that's possible? What is the format the wave is required to be in?

SirPrimalform

  • Team member
  • *
  • Posts: 47
    • View Profile
Re: Newbie questions
« Reply #5 on: July 22, 2015, 05:55:32 AM »
New newbie question!

I've been running into aliasing problems on high notes when creating patches that are relatively bright at the low end. This makes sense obviously, but from what I've read a lot of FM synths have some kind of key scaling? I've been trying to emulate this by mapping 'note' to IM* in the mod matrix. It sort of works, but it feels like the linearity isn't helping. I've tried various amounts of this modulation but if I get the aliasing under control then it tends to either sound good in the middle and too bright at the bottom end or good at the bottom end and mushy in the middle.

Is there a clever routing trick I could use to get a different curve?

Alternatively, is the any chance of key scaling being added to the engine pages? It seems like the DX7 had options for exponential as well as linear scaling and a definable breakpoint, which sounds useful for attacking the aliasing without killing the tone of lower notes.

I have no idea how reasonable a suggestion that is, so no offence intended if it's a stupid request.

kuzma_p

  • Team Member
  • ***
  • Posts: 130
    • View Profile
Re: Newbie questions
« Reply #6 on: July 22, 2015, 09:44:18 AM »
I know with blofeld you can do exponential to linear trick with envelopes. Iirc their Decay and Release stages are exponential, and you can make 'em linear by modulating them with the same Env via mod matrix.

Maybe in PFM2 something like this is possible? There are first 4 mod slots multiplier destination in mod matrix. Maybe you can assign mx1 = Key -> IM, mx2= Key -> mx1. Something like this.

SirPrimalform

  • Team member
  • *
  • Posts: 47
    • View Profile
Re: Newbie questions
« Reply #7 on: July 22, 2015, 06:40:57 PM »
I think I understand, so those multiplier destinations multiply that slot? So I guess yeah, I could get a ^2 curve, which is probably close enough. It'd be great if key scaling with breakpoints was possible, but there might not be enough cycles left to do that...

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: Newbie questions
« Reply #8 on: July 25, 2015, 11:32:52 PM »
Adding a more flexible 'Note' matrix source would be great to increase control on aliasing... i agree.
But that wouldn't fit the UI.
I was  thinking about simply adding 'not1', 'not2', 'not3' source matrix that would return 0 the x first midi notes than starts increasing at x+1.
note1 : x = 32
note2 : x = 64
note3 : x = 96

Let me know if you think that would help,

Xavier

kuzma_p

  • Team Member
  • ***
  • Posts: 130
    • View Profile
Re: Newbie questions
« Reply #9 on: July 27, 2015, 09:38:17 AM »
Maybe it is better to do one more entry in LFO section with mod matix 'Note' source params? I find it more logical.

Something like this, after Seq 2 for example:

I1 Instrument
Note Level Scaling
BrPnt    Curve   
G#2      Exp

Everything else (+/- and level) is manageable via mod matrix i guess.

From DX7 manual:
KEYBOARD LEVEL SCALING


Permits raising or lowering the EG levels for keys to the left and right of any key specified as the "Break Point".  This is basically a highly advanced version of the keyboard follower function found on some conventional synthesizers, permitting much finer scaling control.



BREAK POINT:
The BREAK POINT key--the reference for the scaling function--can be specified anywhere between A1 and C8.
CURVE:
Permits variation of the scaling curve to the left and right of the BREAK POINT key.  Pressing the CURVE key alternates between R KEY SCALING and L KEY SCALING displays.  Four different curves are available, as shown in the figure.
DEPTH:
Varies the depth of each curve over a 0 to 99 range.  A 0 setting results in a flat (no variation) curve, and a 99 setting produces maximum scaling depth.


SirPrimalform

  • Team member
  • *
  • Posts: 47
    • View Profile
Re: Newbie questions
« Reply #10 on: July 28, 2015, 12:42:20 AM »
Adding a more flexible 'Note' matrix source would be great to increase control on aliasing... i agree.
But that wouldn't fit the UI.
I was  thinking about simply adding 'not1', 'not2', 'not3' source matrix that would return 0 the x first midi notes than starts increasing at x+1.
note1 : x = 32
note2 : x = 64
note3 : x = 96

Let me know if you think that would help,

Xavier

I wasn't suggesting a new source in the matrix, but rather a new page in the engine section. Something along the lines of what Kuzma posted with a breakpoint and amount and an option for an exponential curve. But if it's too much to be adding extra pages to the UI I understand.

If I follow your suggestion correctly, you mean that note2 (for example) would return a 0 for every note below 64 and then 65 = 1, 66 = 2 etc.? That's quite clever, and combined with a multiplier one could probably get a nice curve. I would say that an extra page with a breakpoint that can be set is more desirable for precision, but your suggestion is a very elegant way of adding this functionality without changing the UI.

SirPrimalform

  • Team member
  • *
  • Posts: 47
    • View Profile
Re: Newbie questions
« Reply #11 on: March 21, 2016, 11:29:46 AM »
s^2 is a sin*sin so it's one octave above sin and should have a different spectrum too.

Sorry to necro the thread (even if it is my own), but it didn't seem worth making a new one.

I've been thinking about this, and sine^2 shouldn't have a different spectrum other than being an octave up (and having a DC offset, but you have highpass filters between the operators to filter that out).

When you ring modulate (i.e. multiply) two waveforms together, you get the sum and the difference of the frequencies present in the two waveforms. So for two sines you just get two frequencies in the output, the sum and difference of the inputs.

Example:

Two sines, 100Hz and 150Hz. If you ring modulate them together then your output will consist of a tone at 250Hz and a tone at 50Hz.

Another example:

Feed the same 100Hz sine into both inputs. The sum is 200Hz and the difference is 0Hz (which manifests as a DC offset).

So unless there is something else going on that would actually alter the spectrum, the S^2 waveform is just a sine an octave up. S^3 might be more interesting, that definitely has a different spectrum.

thhmas

  • Team member
  • *
  • Posts: 8
    • View Profile
Re: Newbie questions
« Reply #12 on: March 21, 2016, 03:38:20 PM »
@SirPrimalform But sin and sin squared do not have exactly the same spectrum, even apart from the doubled octave. In the following link I have plotted sin(x) vs (sin(x))^2: https://www.wolframalpha.com/input/?i=plot+sin+x+and+(sin+x)%5E2

As you can see their shapes differ subtly, meaning their spectra should differ (I guess you get a bunch of subtle overtones when you square the sin).

EDIT: Or wait, I actually thought of the difference between sin and its absolute value. Never mind me...
« Last Edit: March 21, 2016, 03:48:21 PM by thhmas »

SirPrimalform

  • Team member
  • *
  • Posts: 47
    • View Profile
Re: Newbie questions
« Reply #13 on: March 21, 2016, 04:00:03 PM »
@SirPrimalform But sin and sin squared do not have exactly the same spectrum, even apart from the doubled octave. In the following link I have plotted sin(x) vs (sin(x))^2: https://www.wolframalpha.com/input/?i=plot+sin+x+and+(sin+x)%5E2

As you can see their shapes differ subtly, meaning their spectra should differ (I guess you get a bunch of subtle overtones when you square the sin).
The difference is that Sin^2 is an octave higher, half the amplitude and with an offset of +0.5.
But there's no fundamental difference in shape. Look: https://www.wolframalpha.com/input/?i=plot+sin+x+and+((sin+(x%2F2%2Bpi%2F4))%5E2)*2-1


plot sin x and ((sin (x/2+pi/4))^2)*2-1

x is divided by 2 to drop it an octave, +pi/4 is to correct the phase, *2 is to correct the amplitude and -1 is to centre it around 0.
I did test this before posting, the maths and the theory work out. :)

EDIT: Just saw your edit.

p.s. This is a really nice online graphing calculator: https://www.desmos.com/calculator/fnynlawfti
« Last Edit: March 21, 2016, 04:02:33 PM by SirPrimalform »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2259
    • View Profile
Re: Newbie questions
« Reply #14 on: March 22, 2016, 09:28:33 AM »

Yes sin^2 seems to be useless.
All the sin variant are not great and take some memory. I only keep them for preset compatibility since the first versions of the preenfm1.
But now you have user waveforms....   ;)