Forum
    • Categories
    • Register
    • Login

    Wavetable creation

    Scheduled Pinned Locked Moved General Questions
    59 Posts 4 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DanSound @Orvillain
      last edited by

      @Orvillain I’m experiencing the same issues, but this video makes me want to figure out a way to solve it.

      https://www.dropbox.com/scl/fi/tchw8r3e0wtm5sbr23ryv/WT-Demos.mp4?rlkey=qzya4k2dnq40vsrsszi3jhaff&st=20k50khn&dl=0

      1 Reply Last reply Reply Quote 0
      • D
        DanSound @Lindon
        last edited by DanSound

        @Lindon It seems that I managed to make a working PWM wavetable pwmDSonetrack.hwt.zip

        I can explain the process if this is something you're looking for.

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @DanSound
          last edited by

          @DanSound said in Wavetable creation:

          @Lindon It seems that I managed to make a working PWM wavetable pwmDSonetrack.hwt.zip

          I can explain the process if this is something you're looking for.

          Yes I think the procss needs documenting...

          HISE Development for hire.
          www.channelrobot.com

          D 1 Reply Last reply Reply Quote 0
          • D
            DanSound @Lindon
            last edited by

            @Lindon

            I used Serum to create the wavetables, but anything similar like Vital or dedicated wavetable software should work.

            1. Export the wavetable as a single WAV file, not sliced into multiple files.

            2. Drop the file into a Samplemap, fill all keys from C-2 to G8, and save it.

            3. Open the saved Samplemap with the Wavetable Creator. The only parameter I change is Source Length to get the desired result.

            Every time you change a setting, click the large circular arrows icon to refresh the preview. As far as I understand, this rebuilds the waveform based on your current settings.

            After that, save the wavetable and open it with the Wavetable Synthesizer.

            For some reason, all my wavetables sound too high, so I use the Transposer to bring them to the correct range.

            Hope this helps.

            OrvillainO LindonL 2 Replies Last reply Reply Quote 0
            • OrvillainO
              Orvillain @DanSound
              last edited by

              @DanSound You should set the root note of your file to the same root note played when sampling the source. That will cure your transpose issue.

              Musician - Instrument Designer - Sonic Architect - Creative Product Owner
              Crafting sound at every level. From strings to signal paths, samples to systems.

              D 1 Reply Last reply Reply Quote 1
              • LindonL
                Lindon @DanSound
                last edited by

                @DanSound said in Wavetable creation:

                @Lindon

                I used Serum to create the wavetables, but anything similar like Vital or dedicated wavetable software should work.

                1. Export the wavetable as a single WAV file, not sliced into multiple files.

                2. Drop the file into a Samplemap, fill all keys from C-2 to G8, and save it.

                3. Open the saved Samplemap with the Wavetable Creator. The only parameter I change is Source Length to get the desired result.

                Every time you change a setting, click the large circular arrows icon to refresh the preview. As far as I understand, this rebuilds the waveform based on your current settings.

                After that, save the wavetable and open it with the Wavetable Synthesizer.

                For some reason, all my wavetables sound too high, so I use the Transposer to bring them to the correct range.

                Hope this helps.

                Well if it works for you fine, but I was more thinking...

                I have 200 single cycle wave files, how do I convert these into a wave file that I can load into the wavetable player....

                I assume step 1 =

                convert each of these files into a file of length = power of 2 , like say 1024 or 2048.....

                step 2 anyone?

                HISE Development for hire.
                www.channelrobot.com

                D 1 Reply Last reply Reply Quote 0
                • D
                  DanSound @Orvillain
                  last edited by

                  @Orvillain Thanks! Probably that's the issue.

                  1 Reply Last reply Reply Quote 0
                  • D
                    DanSound @Lindon
                    last edited by

                    @Lindon Step 2 = load it into Sampler's Samplemap, stretch from C-2 to G8 and save it.

                    LindonL 1 Reply Last reply Reply Quote 0
                    • LindonL
                      Lindon @DanSound
                      last edited by

                      @DanSound said in Wavetable creation:

                      @Lindon Step 2 = load it into Sampler's Samplemap, stretch from C-2 to G8 and save it.

                      see this:
                      https://docs.hise.dev/hise-modules/sound-generators/list/wavetablesynth.html

                      and the text there in:

                      Using audio files
                      With the recent rehaul of the Wavetable Synthesiser at HISE 4.1.0 the wavetable synthesiser is now also a AudioSampleProcessor , which means that it has an audio file slot that you can use to load any arbitrary wavefile into the wavetable synthesiser. This heavily streamlines the process of creating wavetables as well as provides the user the ability of loading own wavetables. You can even create wavetables programatically and send it directly to the synthesiser to be played back

                      so thats step 2 ONLY if you are building hwt files I think.

                      HISE Development for hire.
                      www.channelrobot.com

                      D 1 Reply Last reply Reply Quote 0
                      • D
                        DanSound @Lindon
                        last edited by

                        @Lindon So far, I don’t see any other way to make it work. Maybe it’s possible to use just audio files with some scripting, but there’s no documentation on that at all, so I’ll stick with hwt files for now.

                        LindonL dannytaurusD 2 Replies Last reply Reply Quote 0
                        • LindonL
                          Lindon @DanSound
                          last edited by

                          @DanSound ..which was my point I think....

                          HISE Development for hire.
                          www.channelrobot.com

                          1 Reply Last reply Reply Quote 1
                          • dannytaurusD
                            dannytaurus @DanSound
                            last edited by dannytaurus

                            @DanSound @Lindon Here's how to switch between audio file wavetables:

                            Engine.loadAudioFilesIntoPool();
                            const wt = Synth.getAudioSampleProcessor("Wavetable Synthesiser1");
                            
                            inline function loadWavetable(component, value) {
                                wt.setFile("{PROJECT_FOLDER}" + component.get("text") + ".wav");
                            }
                            
                            for (b in Content.getAllComponents("Button")) b.setControlCallback(loadWavetable);
                            

                            Four audio files in Audio Files folder: wavetable1.wav, wavetable2.wav, etc
                            Four buttons in the UI, with button text as the filename: wavetable1, wavetable2, etc

                            Video demo here: https://share.cleanshot.com/LvnqfWlM

                            Notice it takes 1-2 seconds to load and process each audio file.

                            There's a cache method but it didn't speed up the load time for me on these simple wavetables. Mainly because, I think, the caching only skips the resynthesis step, which I don't think these simple wavetables need.

                            EDIT: here's a ZIP of the full project - https://wmd.d.pr/f/iIi4gG

                            Meat Beats: https://meatbeats.com
                            Klippr Video: https://klippr.video

                            LindonL D 2 Replies Last reply Reply Quote 2
                            • LindonL
                              Lindon @dannytaurus
                              last edited by

                              @dannytaurus ok great this is part of the solution..

                              now lets assume we have 5 wav files and each is a single cycle, how do we combine these into a single wave file that we can load into the player and have some modulation source move through these as we play. Clearly its trivially simple to join these 5 files together - but how does the wavetable player know we are using (say) 2048 samples as our cycle size and not (say) 1024 ???

                              HISE Development for hire.
                              www.channelrobot.com

                              dannytaurusD 1 Reply Last reply Reply Quote 0
                              • D
                                DanSound @dannytaurus
                                last edited by

                                @dannytaurus Wow, that's cool! Does the 1-2 second load time apply to the plugin build?

                                dannytaurusD 4 Replies Last reply Reply Quote 0
                                • dannytaurusD
                                  dannytaurus @DanSound
                                  last edited by

                                  @DanSound Not sure. Haven't tried compiling it yet. I think it's due to the calculations done after loading the file, so will probably be the same.

                                  I'd like to test the caching more, to see if it can speed up the process.

                                  Meat Beats: https://meatbeats.com
                                  Klippr Video: https://klippr.video

                                  1 Reply Last reply Reply Quote 1
                                  • dannytaurusD
                                    dannytaurus @DanSound
                                    last edited by

                                    @DanSound I thought about concatenating the 4 audio files into one then using the setSampleRange() function.

                                    That might might allow for instant switching between them, but the pause still exists. I think because even though the whole file is loaded, it still does the recalculations when you change the range.

                                    Engine.loadAudioFilesIntoPool();
                                    const wt = Synth.getAudioSampleProcessor("Wavetable Synthesiser1");
                                    const wc = Synth.getWavetableController("Wavetable Synthesiser1");
                                    wt.setFile("{PROJECT_FOLDER}" + "wavetable1234.wav"); // concatenated audio files
                                    const length = 524288; // length of each audio file section of the long file
                                    
                                    inline function loadWavetable(component, value) {
                                        local start = component.get("id").split("n")[1]; // 1-4
                                        start = (parseInt(start) - 1) * length;
                                        local end = start + length;
                                        Console.print(start); // multiples of 524288
                                        wt.setSampleRange(start, end);
                                    }
                                    
                                    for (b in Content.getAllComponents("Button")) b.setControlCallback(loadWavetable);
                                    
                                    

                                    Meat Beats: https://meatbeats.com
                                    Klippr Video: https://klippr.video

                                    1 Reply Last reply Reply Quote 0
                                    • dannytaurusD
                                      dannytaurus @DanSound
                                      last edited by dannytaurus

                                      @DanSound The next attempt actually worked!

                                      I load the concatenated file into the wavetable synth then change the LFO range according to which section of the wavetable you want to play. I set the LFO to 25%, so with the offset it goes from 0%-25%, 25%-50% 50%-75% and 75%-100%.

                                      Weirdly I had to use the Table Index Bipolar mod source with an LFO set to unipolar. But it works.

                                      Video here: https://share.cleanshot.com/SZHZH3Lp

                                      Updated project ZIP: https://wmd.d.pr/f/iVTorn

                                      So this is how we can use audio files as wavetables and allow instant switching between them - with no need to build wavetables beforehand

                                      Caveats: the plugin init will take longer because it’s doing calculations on the long concatenated file, and as you might notice in the video the waterfall flickers on a couple of the join points. Might just need to tweak the concatenated file.

                                      const ws = Synth.getChildSynth("Wavetable Synthesiser1");
                                      
                                      inline function loadWavetable(component, value) {
                                          local start = component.get("id").split("n")[1]; // 1-4
                                          start = (parseInt(start) - 1) * 0.25; // 0%, 25%, 50%, 75%
                                          ws.setAttribute(6, start);
                                      }
                                      
                                      for (b in Content.getAllComponents("Button")) b.setControlCallback(loadWavetable);
                                      
                                      

                                      Meat Beats: https://meatbeats.com
                                      Klippr Video: https://klippr.video

                                      1 Reply Last reply Reply Quote 0
                                      • dannytaurusD
                                        dannytaurus @DanSound
                                        last edited by dannytaurus

                                        @DanSound @Lindon I just found the recent saveAsHwt(). Makes creating HWT files trivial now. 🎉

                                        Just drop an audio file into a Wavetable Synthesiser, then run this code to save a precomputed HWT file.

                                        const wc = Synth.getWavetableController("Wavetable Synthesiser1");
                                        const dir = FileSystem.getFolder(FileSystem.AudioFiles);
                                        const out = dir.getChildFile("MyWavetable.hwt");
                                        wc.saveAsHwt(out);
                                        

                                        For simple wavetables, this seems like the way to go, rather than the whole wavetable creator popup thing.

                                        This totally removes any lag or pause from loading since the HWT is precomputed.

                                        Video here: https://share.cleanshot.com/tD1qGCsv

                                        Meat Beats: https://meatbeats.com
                                        Klippr Video: https://klippr.video

                                        D 1 Reply Last reply Reply Quote 2
                                        • dannytaurusD
                                          dannytaurus @Lindon
                                          last edited by dannytaurus

                                          @Lindon said in Wavetable creation:

                                          how does the wavetable player know we are using (say) 2048 samples as our cycle size and not (say) 1024 ???

                                          Short answer: it's clever.

                                          Longer answer: it guesses the cycle length based on the correlation of slices. It starts at 128 then goes up in powers of 2 to 2048. If it finds a very high correlation in the slices at any one of those slice lengths, it returns that as the cycle length.

                                          I suppose this only works on files that morph fairly slowly between waveforms. If your file has a cycle length of 2048 but each cycle is very different to the next, it won't find a suitable cycle length and will fall back to resynthesis.

                                          Also, if your file happens to have Loop Range metadata, it will use that first, before any guessing or resynthesis.

                                          Meat Beats: https://meatbeats.com
                                          Klippr Video: https://klippr.video

                                          LindonL 1 Reply Last reply Reply Quote 0
                                          • OrvillainO
                                            Orvillain
                                            last edited by

                                            @dannytaurus Do you know whether the mode used is resynthesis or resample?? Coz I tried the drag and drop thing, and the resulting wavetables did not sound great. Not as good as the ones I made in the resample mode inside Wavetable Creator.

                                            Musician - Instrument Designer - Sonic Architect - Creative Product Owner
                                            Crafting sound at every level. From strings to signal paths, samples to systems.

                                            dannytaurusD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            21

                                            Online

                                            2.1k

                                            Users

                                            13.2k

                                            Topics

                                            114.4k

                                            Posts