Invert polarity of sampler



  • @Crystal-Audio yeah it's in the module browser. Check the image above.



  • @hisefilo can you explain a bit how you go about additive synthesis ? I gather you have a sound that you want to recreate , you look at the partials and then add sines to recreate it ?

    If i am correct , what do you use to analyse the partials and dont they all change per note?

    Very interested and would love to hear how you approach this.



  • @lalalandsynth You can use SPEAR to find modes:

    http://www.klingbeil.com/spear/

    Sine Wave - Set exact frequency (from array)

    • Sound -> Analyze -> Select whatever sound you want.
    • Edit -> Select Partials Below Threshold (mode-selection sensitivity).
    • View -> Print Average Frequencies
    • Window -> Console

    You'll see a list of primary modes. If you want to bring them into HISE in a neat way you can use Google Sheets:

    • Copy the values into a Google Sheet (as a vertical list).
    • Data -> Split Text to Columns (select the Space operator).
    • Save the sheet as a .csv with comma-separated values.
    • Open it in whatever text editor, then just copy + paste the values into an array.

    To get the residue file, which is whatever is left when the modes are removed, just hit delete with the modes still selected, and export that file.

    Now you can import the array to HISE and setup Sine Wave Generators, using Ratio to setup the partials. Unfortunately there's no way to just read from the array, so you'll have to figure out the ratios (you can automate it with a for loop and something like this:

    moderatio = (modes[i] / modes[0]) - 1; 
    modules[i].setAttribute(modules[i].FineFreqRatio, moderatio);
    

    For each mode, it divides the current mode by the fundamental (mode[0]), which gives you a general ratio.

    It's not 100% accurate, but it's free and definitely good enough to start experimenting. The main weakness is that you don't have a lot of information about decay times for each mode, which is where paid software might come in...

    I'm praying HISE 3.0 gives us a way to just set sine wave frequencies exactly, so we can just read them from arrays. I could basically make any sound I want with that, with some tweaking... My favourite part of additive synthesis/physmod is once I have a sound, I can tweak it by just shifting the modes and their relationships around, eg: stiffness property involves sharpening certain modes, you can even script random robin on every note.

    And yes, for some instruments, every note has different partials. This would again be a lot easier if we could set exact freqs ☺



  • @iamlamprey Thanks , looking into this. Do you need another instance of the sine gen for each partial ?

    I am not great at programming , if you have a snippet I could look at that would be very helpful .



  • @iamlamprey said in Invert polarity of sampler:

    decay times for each mode, which is where paid software might come in...

    What paid software is available for this purpose , I did not find anything in my search .



  • @lalalandsynth yeh you need to stack a couple of sine wave gens, there is a built-in saturation if you just want to add harmonics but ideally we'd prefer control over each one 🙂

    Here's a simple Glock i was messing with. Check the init script for most of the stuff, and the NoteOn script for the RR. There's 1 slider setup for adjusting the gain of the modes, which kinda emulates material stiffness property, the convolution probably wont work but just use the basic hise reverb if you want reverb

    HiseSnippet 3730.3oc6c07ababEeWKwjXkXGmTmTen.kvHGjsYn3PN7K6DHYqOrUi+PQqiSKRLho3NRhvbI2RxUNJEAMsmJPODTzhVjdJG5kTTXj1lVjzCoFs.E8PJPK5khdJME8PPaAx+AsuYH2cI0tqztJ1RZkm8fvLuYdu4Mu2ad72LypkKDE5RhiCiJU9fWc85jRkeDgJqGjr5zq53ETZ9YJUdLgy6G5dSwo0Kct0q6DGSpVpb4QNOs8xGbzRrOe1jmyw2IvkzlToRWKzykbQuZdIsotvTOmmu+bNUIW0qVtdimZd2vfoC8Ca.5xHBJkp63dSmUHW1g1sCHTp7CLaUujvnJINIj3RkG8bgUWuxpg2JHs+WyK1aIeBsBpTEPPojmKzuJUioTKM8pd9UWn4bNtToxO5Bss.ijZANpvk7p50hdaKwQXMH1li71ixGXyTOTd0So+Uux4TuQSUuGSnhajW8j1sP0sGVX9fDRzxNfKHuZk12RG3a+DBSGB8HHQtlyMIyEAUZww3ZJJRhpJJm3LGZrCM1DmTb9.uDw0bh7b.cNlRbImXRsvpjXQuXQvIItD3eZTWRzaYwaQDCHjphIghqPRXsPKmrJQLLxaEu.GeQmnHm0koR5jSP+K3siYCgXaI+rhuDRQWS1Twz.qJgPZlxHUrhplDREYJqXiLL0kTUvXYUKrN1PREopC8QWEikTwZpx1V551.ccDPGaanaIoZXAkMsr0AdsLLjsMsM0f9.sJqnXngsjzTrMj0ULsPZRZpJlx5VZfTkzzUUkwZFJZ5RZlJpxV.AaZYaKYCKrEBKoYqfgwx.agkvJHUYccLx1VBivHnOl.IIrpERV0vvPAJqYoHqnACilDFahk0.k0.JqC5ulN11BJR42DqIqZh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bGFrn5POXwe56zOfEO56wAKxAKxAKdeEXQUNXQNXwcUvhZ8Br3cR99em8MfEuym7298SxOYw88fE0F5AK9Cdu9Ar3M94bvhbvhbvh2WAVTiCVjCVbWErHtmmr3n3u0PHXwiz8SV7S+Y292xAKtuGrHdnGr3a9t8CXwG4WyAKxAKxAKdeEXQLGrHGr3tJXwd9Suo3Iem38MfEei+q92iexh6+AKpOzCVb5eQ+.V769q3fE4fE4fEuuBrnAGrHGr3tJXQiMArn69Fvhkl9O7W4fE2+CVzXnGr3u418CXwex6vAKxAKxAKdeEXQcNXQNXwcUvhlaBXwJCgfEE2N+2P+mmjCVbeAXQygdvhJuUe8aOElCVjCVjCVjCVjCVjCVbGCrn0l.Vb5gPvhGefAK9F+6m+OxAKt+.rnEGrHGrHGrHGr39Qvh1bvhbvh6pfEs6EXwo9nej4PHXwmZfAK91m+e724fE2e.VzlCVjCVjCVjCVbXGr3S1semEU3nE4nE2oPK9E65uJ2J8Dt3QZ7kGBgKdrtBW7F+vO7X2g+sVb3Ct3naNbwGei+rbqvwKxwKxwKxwKN7fW7fMU1z2clMSkk8t2YFxxNM7SZ8SI68hDbsobzo5HQySM0EgGn5DcuKWS49zycr74ZD2S85jcv7gHtObn2Gpx8g6A8g7clt2amo6DiA6MU9q3l9dImFK+PLJv7Nf81x5fBrWb4hnlul0OpfhrNVg9QEg0MMLgrx0fMf8JttTq+SClqtKB0lhP.DgR+wi11fG71fG8sAOFaCdL2F7Xso7P266YajDVKckIPXgYSeArUd1Vu.1Foz+GWBMi4C
    

    Residue file: https://drive.google.com/file/d/1MeAAVGeAve4WwsbV3Q0zT0ejBwQRpHfI/view?usp=sharing

    Load the residue file into the Sampler and map it across every key, make sure it's not set to repitch

    What paid software is available for this purpose , I did not find anything in my search .

    I can't list any specific ones cause I haven't really put the time into searching for them. I think Melda Productions have a good analyzer, Izotope probably have something that could do it, you basically just need a good spectrogram and an efficient way to export the modes and residue. You could probably reach out to the support teams for those companies and ask if there's a way to export spectrogram information as a table before you purchase anything

    There's loads of papers on the topic but from what I've seen a lot of scholarly articles are just circle jerks for "hey look what we did" without actually sharing any software or methods.

    Either that, or just a wall of math 🤢



  • Oh also I should mention that ScriptNode lets you set exact frequencies of the sine wave osc, but I couldn't get more than 2-3 oscillators before it crashed, you might have better luck ☺



  • @iamlamprey said in Invert polarity of sampler:

    modes, which kinda emulates material stiffness property, the convolution probably wont work but just use the basic hise reverb if you want reverb

    Thanks mate , looking into this ! 🙂



  • @lalalandsynth mate! Sure, take the CollaB3 we developed together as a primitive example. Basically it's everything you need there.

    Sine wave generators with pitch (frequency), amplitude and phase (see scripted phase modulator on each sine module)

    For analysis, Spear, as @iamlamprey said. And also SMS-TOOLS is a good way to get into the spectral peaks.

    I spent a lot of time here https://ccrma.stanford.edu/~jos/jnmr/Spectral_Modeling.html and following those rabbit-holes



  • @hisefilo cool, will dive into this 🙂


Log in to reply
 

13
Online

804
Users

3.0k
Topics

25.5k
Posts