Thanks Dave ![:slight_smile: :slight_smile:](https://community.vcvrack.com/images/emoji/twitter/slight_smile.png?v=12)
Yeah I have a feeling it is not something easily done, especially not for a project like this, with multiple envelopes, oscillators, lfos, random and more and everything in separate structs.
I’ve made the envelopes that I use in this project as separate modules, I think I might try to make one of the to start with.
Do you think I can make a float_4 struct member?
Something like this:
struct Envelope{
float_4 Env( bool trigger, float_4 pitch, float_4 Fm){
// Envelope code here......
}
}
And then call it from main:
Envelope[c/4].Env( gatein[c], parampitch[c/4], FmInput[c/4]);
I can see there might be an issue with the gatein, since it’s not float_4, but bool, so it would still use just [c]. Maybe I could just make that gatein float_4 too?
Envelope[c/4].Env( gatein[c/4], parampitch[c/4], FmInput[c/4]);
Yeah I need to look into that. That’s something I have been postponing for a while, since I feel it’s a bit of c++ voodoo. I also think it makes the code a bit harder to read, but should learn it so I can implement it from the start, so I don’t have to deal with doing it to everything at once in a huge project like this, cause it seems a bit daunting to do it now on everything.
I just add the fm like this:
frequency = (dsp::FREQ_C4 * std::pow(2.f, ParamFrequency + VoltInput )) + FmInput;
Not sure what it is, I just played around until I had something working. It seems like it might be phase modulation?
And the feedback like this:
sine = sinf(2.f * M_PI * phase + feedback );
Sounds really cool. Will check your modules, just installed them ![:wink: :wink:](https://community.vcvrack.com/images/emoji/twitter/wink.png?v=12)
Once I get it optimised, I think I’ll add a 4th operator too. And nore goodies.
And also I’d like to add more osc options. Right now it’s just a sine, but would be nice to add some harmonics based versions of different oscillator shapes. Something like these shapes:
![Screenshot 2024-06-28 at 21.34.23](https://community.vcvrack.com/uploads/default/original/3X/2/7/2722430f0e0f516cce086a69a2de81b8c267e79a.png)
![Screenshot 2024-06-28 at 21.34.31](https://community.vcvrack.com/uploads/default/original/3X/5/2/528b801c5be79d901cff7b2b91f17b5a463fcb82.png)
![Screenshot 2024-06-28 at 21.34.37](https://community.vcvrack.com/uploads/default/original/3X/f/2/f294e582d4f4b513092dfda61722e312c9d837ac.png)
Etc…
… Which are the shapes of the Elektron Digitones oscillators. I have all of them emulated in Pure Data, so I “just” need to figure out how to implement them in VCV, with decent interpolation. But yeah, it’s a lot of work to “just” do that.