Adapting Mutable Plaits source code to genexpr

    Sep 28 2018 | 1:19 pm
    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.

    • Sep 28 2018 | 4:42 pm
      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.
    • Oct 16 2018 | 1:44 pm
      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.
    • Oct 17 2018 | 9:39 am
      Thanks a lot ;) Will definitely try a few other ones.
    • Oct 18 2018 | 10:02 pm
      Next is an adaptation of Plaits' VOSIM model. It's actually one of the only oscillator model not using polyblep antialiasing so it could be worthwhile to use poly~ to oversample it.
      Here's the example patch with the model plus a quick and dirty proto sequencer.
    • Oct 22 2018 | 6:51 am
      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:
    • Oct 22 2018 | 11:18 am
      @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!
    • Oct 23 2018 | 3:31 pm
      @.quasar: i'm on osx and can't compile for windows, but if i finish the project, i'll make the source available.
    • Oct 24 2018 | 10:25 am
      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!
    • Oct 25 2018 | 1:11 pm
      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.
    • Dec 30 2018 | 12:32 pm
      for a macos alpha version see this post'-plaits-module-macro-oscillator
    • Jan 08 2019 | 10:47 pm
      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.
      diode ringmod/folder lut
      bump waveshaping lookup table
      double bump waveshaping lut
      inverse sin waveshaping lut
      inverse tan waveshaping lut
    • Jan 10 2019 | 9:15 am
      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.