Author Topic: User waveforms - could we have more?  (Read 2669 times)

randomdan

  • Team member
  • *
  • Posts: 2
    • View Profile
User waveforms - could we have more?
« on: October 22, 2022, 08:54:20 PM »
This is a fantastic project, I've enjoyed building and using both preenFM2 and now the newer preenFM3 - nice UI and very powerful little synth!

I've Wondered if there might be any scope for increasing the number of user waveforms beyond the current 6 ?

I have made some interesting sounds using Toltekradiation's waveforms, but I'd like to experiment with more without affecting my existing saved patches that use these waveforms.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: User waveforms - could we have more?
« Reply #1 on: October 25, 2022, 08:43:18 PM »
Hi,

There are some RAM available on the preenfm3.
I'm quite busy for the moment but if you want a guide, the User waveform main file is here :
https://github.com/Ixox/preenfm3/blob/master/firmware/Src/filesystem/UserWaveform.cpp

The waveforms are the most used objects so, not to slow down CPU and buses it's better to have them in a quick access RAM ("instruction_ram").
https://github.com/Ixox/preenfm3/blob/master/firmware/Src/synth/Osc.cpp#L38
Eclipse tells me there's 29Kb available but it's also used for the stack memory so you should leave a few Kb available.
Each waveoforms is 1024 floats => 4Kb.

By modifying the code you could easily add 6 additional (24Kb) user waveforms and get 12.

It's possible that it works fine with other RAM segments to get more user waveforms but that requires some tests.

Xavier

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: User waveforms - could we have more?
« Reply #2 on: October 26, 2022, 11:33:20 AM »
Wouldn't it be possible to place the waveforms in a slower area of the ram and load the used one dynamically into the faster ram? That way you loose the ability for waveform change while playing a note but it is done like this in many synths I guess. Maybe you could even load waveforms from SD card directly this way

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2256
    • View Profile
Re: User waveforms - could we have more?
« Reply #3 on: October 27, 2022, 02:23:04 PM »

I'm not sure we can do that.
You say "THE" used one, but there's no reason there's only one among the 6 operators of the 6 instruments.
Each Operator of each instrument can use a different waveform, and they can play all together.

lokki

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
Re: User waveforms - could we have more?
« Reply #4 on: October 28, 2022, 02:03:21 PM »
Ok should read the used ones... Sorry. I haven't looked at the code to see how you did it, it just seems obvious to have a dynamic array for each OP and voice in which you load the desired waveform into...

randomdan

  • Team member
  • *
  • Posts: 2
    • View Profile
Re: User waveforms - could we have more?
« Reply #5 on: October 29, 2022, 11:43:10 PM »
Many tanks Xavier for the comprehensive reply! I've had a quick look at your code, unfortunately I am not brilliant at C++ , but I see they are memory resident now, and understand the limitations. I'll see if I can work out the tools and workflow to recompile and test and maybe hack around and try to to test out

The combination of single cycle waveforms and being able to phase modulate them is quite an interesting prospect..  I don't know of any other hardware synth where this is made possible!