HISE Logo Forum
    • Categories
    • Register
    • Login

    Invert polarity of sampler

    Scheduled Pinned Locked Moved General Questions
    44 Posts 8 Posters 4.1k 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.
    • Christoph HartC
      Christoph Hart
      last edited by

      The phase is independant from the frequency because they all use the fixed wavetable length of 2048 samples.

      But to be honest the experiments I made with additive synthesis lead me to discard any efforts of reproducing the phase of harmonics because you simply don‘t hear it - but I am curious about your findings ;)

      hisefiloH 1 Reply Last reply Reply Quote 0
      • hisefiloH
        hisefilo @Christoph Hart
        last edited by

        @Christoph-Hart I can hear the difference, but is much more obvious looking at the waveform. These are the 16 same sinewaves played together.

        No phase:
        Screen Shot 2019-04-03 at 7.04.14 AM.png

        Phase shifted:
        Screen Shot 2019-04-03 at 7.04.03 AM.png

        I guess nature planed the waveform to look like last one :)

        1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart
          last edited by

          Yes, that the waveforms look different is obvious, but as far as I know, human ears have a very hard time to distinguish phases between harmonics.

          I found an interesting read about this subject here:

          http://www.silcom.com/~aludwig/Phase_audibility.htm

          hisefiloH 1 Reply Last reply Reply Quote 0
          • hisefiloH
            hisefilo @Christoph Hart
            last edited by hisefilo

            @Christoph-Hart Excellent paper! Will read it carefully at bed! My guess is phase is audible when it contributes to create a "recognizable" waveform (as in the images I posted. Here are 2 examples, same harmonics, with and without phase shift.

            No Phase Shift
            Phase Shifted

            My theory is that partials phase should be placed to contribute to a major simple waveform (I mean a waveform you can visually remember or recognize), shaping the final waveform by adding small variations of a major curve to make it look smooth. Just flip any of the partials on a additive sawtooth waveform and you'll see ramp to be distorted. (maybe Im crazy, but this is what I suppose)

            1 Reply Last reply Reply Quote 0
            • ustkU
              ustk
              last edited by

              I haven't read the paper yet, but for what I know, the phase is important when two or more sources are reproducing the same frequency, as the crossover frequency in a 2-way speaker for instance, where alignment is crucial... But if you take two frequencies far away enough below and above the crossover freq, the ear cannot notice a poor alignment (except if you change it in real time).

              Can't help pressing F5 in the forum...

              hisefiloH 1 Reply Last reply Reply Quote 0
              • hisefiloH
                hisefilo @ustk
                last edited by

                @ustk my post is related to phases within harmonics on the same sound. I guess phase alignment on speakers is kind of different stuff I can't understand yet

                1 Reply Last reply Reply Quote 0
                • ustkU
                  ustk
                  last edited by

                  It was an image, but the behaviour is approximately the same if your harmonics are not identical, and the phase will automatically move in relation anyway

                  Can't help pressing F5 in the forum...

                  hisefiloH 1 Reply Last reply Reply Quote 0
                  • hisefiloH
                    hisefilo @ustk
                    last edited by

                    @ustk oh I got it :)

                    1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart
                      last edited by

                      BTW, the most apparent difference between your sound examples is that the unshifted sample is clipping pretty badly so you're not really hearing phase distortion, but real distortion :)

                      hisefiloH 2 Replies Last reply Reply Quote 2
                      • hisefiloH
                        hisefilo @Christoph Hart
                        last edited by hisefilo

                        @Christoph-Hart yeah. Sorry. Will send a leveled one. Are the same partials, same amplitude... But unphased raises some weird peaks.

                        By the way. Having a hard time trying to calculate phase rotation. (since harmonics rotates differently based on #).
                        alt text

                        Any clue on how to calculate this?

                        1 Reply Last reply Reply Quote 0
                        • hisefiloH
                          hisefilo @Christoph Hart
                          last edited by hisefilo

                          @Christoph-Hart is there a way to do sinewaves to start when they cross zero Y value? Got some artifacts when phase is not close to 180 or 360

                          Despite this, results are amazing

                          1 Reply Last reply Reply Quote 0
                          • Christoph HartC
                            Christoph Hart
                            last edited by

                            Lol, if you want them to start at zero, phase is either 0 or 180 degrees :)

                            What you need in this case is a simple envelope with an attack time of about 3-5 ms to remove the click.

                            hisefiloH 1 Reply Last reply Reply Quote 0
                            • hisefiloH
                              hisefilo @Christoph Hart
                              last edited by

                              @Christoph-Hart LOL I know. Doing this workaround alreay.But I'm guessing if there's a way to keep phase angle but delay the start n samples until sinewave crosses zero. Don't know if it makes sense.

                              I measured phase as is and is doing what it's supposed to do. Just trying to do a custom trick since artifact are a problem for anyone using phase shift

                              lalalandsynthL 1 Reply Last reply Reply Quote 0
                              • C
                                Crystal Audio @Christoph Hart
                                last edited by

                                @Christoph-Hart said in Invert polarity of sampler:

                                I think I'll add this to the SimpleGain module

                                Has this been added to the SimpleGain module? I didn't see it when I had a look.

                                Dan KorneffD 1 Reply Last reply Reply Quote 0
                                • Dan KorneffD
                                  Dan Korneff @Crystal Audio
                                  last edited by

                                  @Crystal-Audio It has been added. There isn't a button for it, but you can find it in the Simple Gain API

                                  Dan Korneff - Producer / Mixer / Audio Nerd

                                  C 1 Reply Last reply Reply Quote 2
                                  • lalalandsynthL
                                    lalalandsynth
                                    last edited by

                                    gain.jpg

                                    https://lalalandaudio.com/

                                    https://lalalandsynth.com/

                                    https://www.facebook.com/lalalandsynth

                                    https://www.facebook.com/lalalandsynth

                                    1 Reply Last reply Reply Quote 1
                                    • C
                                      Crystal Audio @Dan Korneff
                                      last edited by

                                      @dustbro @lalalandsynth I'm having trouble locating Simple Gain in the api. I don't see it when I search for "Simple Gain" and I didn't notice it when I scrolled through the full list. Is there a special place to find the modules in the api browser?

                                      Dan KorneffD 1 Reply Last reply Reply Quote 0
                                      • Dan KorneffD
                                        Dan Korneff @Crystal Audio
                                        last edited by

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

                                        Dan Korneff - Producer / Mixer / Audio Nerd

                                        1 Reply Last reply Reply Quote 0
                                        • lalalandsynthL
                                          lalalandsynth @hisefilo
                                          last edited by

                                          @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.

                                          https://lalalandaudio.com/

                                          https://lalalandsynth.com/

                                          https://www.facebook.com/lalalandsynth

                                          https://www.facebook.com/lalalandsynth

                                          ? hisefiloH 2 Replies Last reply Reply Quote 0
                                          • ?
                                            A Former User @lalalandsynth
                                            last edited by

                                            @lalalandsynth You can use SPEAR to find modes:

                                            Link Preview Image
                                            SPEAR Homepage

                                            SPEAR Homepage

                                            favicon

                                            (www.klingbeil.com)

                                            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 ☺

                                            lalalandsynthL 2 Replies Last reply Reply Quote 2
                                            • First post
                                              Last post

                                            17

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.4k

                                            Posts