HISE Logo Forum
    • Categories
    • Register
    • Login

    Audio Loop Player Auto Detect Note

    Scheduled Pinned Locked Moved Bug Reports
    6 Posts 4 Posters 552 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.
    • DanHD
      DanH
      last edited by

      I have a 1 second timer running which returns the root note (as automatically detected in the loop player). This updates a combo box with which you can select a new root note or whatever. Basically you drag in a file and within a second it updates the root note combo box.

      Now, when I begin changing the start point of the sample the root note changes! Is it updating itself based on what the start is? The sample is a vocal so changes pitch throughout. It's not very helpful tbh! Once the root note is set I imagine you want it kept that way.

      I don't think there is a callback for loading in a new audio file - please correct me if I'm wrong...

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by d.healey

        I've just encountered the same issue. I'm wondering if we can use the new broadcaster system for this and react when the pitch is updated. @Christoph-Hart ??

        By the way, the detected pitch seems to be 10 semitones out for me. If I load a C3 (MIDI 60) file the detected pitch is 50. If the file is 73 the detected pitch is 63. Are you experiencing that? Maybe it's just my audio files.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey
          last edited by d.healey

          Actually I found the proper solution and it's quite simple.

          const audioFile = AudioLoopPlayer1.getAudioFile(0);
          	
          audioFile.setContentCallback(function(event)
          {
              if (isDefined(event))
              {
          	var rootNote = AudioLoopPlayer1.getAttribute(AudioLoopPlayer1.RootNote);
          	knbRoot.setValue(rootNote);
              }			
          });
          

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          1 Reply Last reply Reply Quote 3
          • d.healeyD
            d.healey
            last edited by d.healey

            @Christoph-Hart Coming back to this one after a while. The setContentCallback doesn't always fire when an audio file is set using the setFile function. Correction, it does fire, but event isn't always defined.

            And the detected root note is almost always wrong.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            bendursoB 1 Reply Last reply Reply Quote 0
            • NatanN
              Natan
              last edited by

              @d-healey Sir David, DO you have a Working Idea to Read the Pitch Tracking information and Show it up on UI?
              This doesn't work anymore :/

              1 Reply Last reply Reply Quote 0
              • bendursoB
                bendurso @d.healey
                last edited by bendurso

                @d-healey @Natan The problem continues even today. If we declare the event as undefined it works perfectly. Would there be a problem with this trick?

                audioFile.setContentCallback(function(event)
                {
                    if (!isDefined(event))
                    {
                	var rootNote = AudioLoopPlayer1.getAttribute(AudioLoopPlayer1.RootNote);
                	knbRoot.setValue(rootNote);
                    }			
                });
                

                Or to be even safer, remove the condition (works as well):

                audioFile.setContentCallback(function(event)
                {
                	var rootNote = AudioLoopPlayer1.getAttribute(AudioLoopPlayer1.RootNote);
                	knbRoot.setValue(rootNote); 			
                });
                

                Oh and the pitch detector seems to be working now (at least with my samples)

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

                24

                Online

                1.8k

                Users

                12.0k

                Topics

                104.5k

                Posts