Adapting Mutable Plaits source code to genexpr
Mutable recently released the source code for their new oscillator module, Plaits. I'm trying to adapt the Grainlet Oscillator section (big fan of its granular formant engine) but so far I haven't had any success.
Basically the oscillator is described as "A phase-distorted single cycle sine * another continuously running sine,the whole thing synced to a main oscillator". Also there is some antialiasing using the polyblep method.
I've managed to adapt the Carrier() and Grainlet() functions but I keep on failing at adapting the part of the code where the functions are put together and the polyblep method is used.
Anyway, here's my whole adaptation (the whole source code is also included) if a kind soul happens to have the time to take a look at my adaptation.
Note : subsample() and Next() only seem to refer to the interpolation routine used for the params so I've not adapted them. Also, carrier_phase_ / formant_phase_ / next_sample_ are supposed to be oscillator state variables.
Ok, so I've corrected a few mistakes here and there and now the whole code works. However, my issue now is that I don't really see any difference between the whole adaptation using the polyblep method and a simple naive adaptation only using a synced Grainlet() function.
Quite sure I'm missing something... Here's the patch anyway
EDIT : now I do see the difference, definitely cleaner at high freq.
Here's another model I adapted from the Plaits source code, the variable saw oscillator .
I think it used to be called Csaw in Braids. Anyway, I quite like it, kinda reminds me of the variable saw on the Minilogue.
Thanks a lot ;) Will definitely try a few other ones.
yes, great stuff! keep it coming.
btw. if anybody is interested in this: i've started a project to incorporate the whole plaits system into a max external. It's coming along quite nicely, there's only one nasty problem left which keeps me from finalizing the thing.
here's a little sound demo:
https://soundcloud.com/geplanteobsoleszenz/firstplaits
@Volker Böhm : That's really cool ! Indeed I would be quite interested :) Any chance the project would eventually be available as a x64 Win external?
It's actually quite fun adapting the C code to genexpr. Braids' code was harder to translate into genexpr but Plait's is easier. I'll post my next one soon I hope!
@.quasar: i'm on osx and can't compile for windows, but if i finish the project, i'll make the source available.
Thanks that'd be great ! ;)
Trying to adapt an entire engine now, tried a few times with the Additive / Harmonic Oscillator engine. Haven't succeeded yet but I'm not giving up!
Here's a loose adaptation of the additive/harmonic engine (still haven't managed to do a strict adaptation of the source code). Anyway I figure a way to implement the centroid / spectral bump and I had a bit of fun using mc.gen~. You'll need both the gendsp & maxpat files.
for a macos alpha version see this post
https://cycling74.com/forums/-sharing-mutable-instruments'-plaits-module-macro-oscillator
Your post motivated me to share a new adaptation, this time of the "aux" output of the Waveshaper Engine (Slope/Triangle => Waveshaper => DiodeRingMod lookup table)
It is not a 100% faithful adaptation, I took a few liberties here and there (the oscil is yofiel's LTR asymmetric triangle, there are 4 params in the shaping section instead of just 3, i implemented myself the scaling functions for the gain compensation and indices instead of using the source code's taming function)
However, I'm using exactly the same shapers. I've exported the tables directly from the python code. Tell me if you're missing any abstraction, it's reasonably large patch so I might have forgotten to include something.
.
Here's an updated version of the patch, I realised I missed a sign inversion of the signal just before it was sent to the Diode/Folder. Like the last patch you'll need to have the waveshaping lookup tables downloaded and put in your library folder.