Forum

    • Register
    • Login
    • Search
    • Categories

    get current position in sample?

    Scripting Forum
    4
    20
    150
    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.
    • ulrik
      ulrik last edited by

      Is it possible to get current playing position in a sample, in a Sampler or LoopPlayer?

      Hise Develop branch
      MacOs 13, Xcode 14.0.1
      http://musikboden.se

      ulrik 1 Reply Last reply Reply Quote 0
      • ulrik
        ulrik @ulrik last edited by

        @ulrik I'm referring to this:
        Skärmavbild 2021-08-06 kl. 11.48.12.png

        Hise Develop branch
        MacOs 13, Xcode 14.0.1
        http://musikboden.se

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

          I don't see a function that gives access to it.

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

          ulrik 1 Reply Last reply Reply Quote 1
          • ulrik
            ulrik @d.healey last edited by

            @d-healey Hm, it could be useful to have that function.. @Christoph-Hart ?

            Hise Develop branch
            MacOs 13, Xcode 14.0.1
            http://musikboden.se

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

              Yes that is actually a good request - also it‘s the same for table ruler positions and highlighted sliders in a slider pack now so you‘ll get these too for free.

              ulrik 3 Replies Last reply Reply Quote 5
              • ulrik
                ulrik @Christoph Hart last edited by

                @Christoph-Hart Horray!! 🥳

                Hise Develop branch
                MacOs 13, Xcode 14.0.1
                http://musikboden.se

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

                  @Christoph-Hart I just noticed your new commit, is this feature in? 🥶

                  Hise Develop branch
                  MacOs 13, Xcode 14.0.1
                  http://musikboden.se

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

                    Nope, not yet. I'll try to include it when I work on the complex data types next time.

                    ulrik 1 Reply Last reply Reply Quote 5
                    • ulrik
                      ulrik @Christoph Hart last edited by

                      @Christoph-Hart Ok, thanks! 👍

                      Hise Develop branch
                      MacOs 13, Xcode 14.0.1
                      http://musikboden.se

                      UrsBollhalder 1 Reply Last reply Reply Quote 1
                      • Christoph Hart
                        Christoph Hart last edited by

                        Next time was just now 🙂

                        Just create a reference to the actual data object, then call getCurrentlyDisplayedIndex(). Works with Tables, SliderPacks and AudioFiles.

                        UrsBollhalder ulrik 3 Replies Last reply Reply Quote 4
                        • UrsBollhalder
                          UrsBollhalder @Christoph Hart last edited by

                          @Christoph-Hart said in get current position in sample?:

                          Next time was just now 🙂

                          Just create a reference to the actual data object, then call getCurrentlyDisplayedIndex(). Works with Tables, SliderPacks and AudioFiles.

                          Awesome!

                          www.ursbollhalder.com
                          www.Instagram.com/urs_bollhalder_composer

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

                            @Christoph-Hart said in get current position in sample?:

                            Next time was just now 🙂

                            Just create a reference to the actual data object, then call getCurrentlyDisplayedIndex(). Works with Tables, SliderPacks and AudioFiles.

                            But the playhead still isn't visible in my compiled standalone plugin... not sure what is going on...

                            www.ursbollhalder.com
                            www.Instagram.com/urs_bollhalder_composer

                            1 Reply Last reply Reply Quote 1
                            • ulrik
                              ulrik @Christoph Hart last edited by

                              @Christoph-Hart thank you Christoph, it works great, is it possible to get a

                              setPlayhead as well? 😬
                              

                              Hise Develop branch
                              MacOs 13, Xcode 14.0.1
                              http://musikboden.se

                              1 Reply Last reply Reply Quote 1
                              • UrsBollhalder
                                UrsBollhalder @ulrik last edited by

                                @ulrik Did you get this to work? I am trying to get a custom playhead panel to display the sample position... No luck so far.

                                www.ursbollhalder.com
                                www.Instagram.com/urs_bollhalder_composer

                                ulrik 1 Reply Last reply Reply Quote 0
                                • ulrik
                                  ulrik @UrsBollhalder last edited by

                                  @UrsBollhalder yes it works, I use a timer to check current

                                  Timer.setTimerCallback(function()
                                  {
                                  	var current = AudioFile.getCurrentlyDisplayedIndex();
                                  	Console.print(current);
                                  });
                                  

                                  Hise Develop branch
                                  MacOs 13, Xcode 14.0.1
                                  http://musikboden.se

                                  UrsBollhalder 1 Reply Last reply Reply Quote 0
                                  • UrsBollhalder
                                    UrsBollhalder @ulrik last edited by

                                    @ulrik said in get current position in sample?:

                                    @UrsBollhalder yes it works, I use a timer to check current

                                    Timer.setTimerCallback(function()
                                    {
                                    	var current = AudioFile.getCurrentlyDisplayedIndex();
                                    	Console.print(current);
                                    });
                                    

                                    Allright... but... I have a Sampler with multiple audio files (5-7)... I suppose on the onNoteOn I have to somehow feed it the right audio file, no? With the AudioSampleProcessor.getAudioFile??

                                    www.ursbollhalder.com
                                    www.Instagram.com/urs_bollhalder_composer

                                    ulrik 1 Reply Last reply Reply Quote 0
                                    • ulrik
                                      ulrik @UrsBollhalder last edited by

                                      @UrsBollhalder Hmm....yes you have to make a reference to that particular audio file, I don't remember how to do that but I guess you'll find it in the documentation
                                      If I remember correctly, I think you have to make a "selection" of that file using some of these methods
                                      Skärmavbild 2021-09-08 kl. 11.01.22.png

                                      and use it when making the reference ... 🤔

                                      I've only used the "getCurrentlyDisplayedIndex();" inside the AudioPlayer, not the sampler

                                      Hise Develop branch
                                      MacOs 13, Xcode 14.0.1
                                      http://musikboden.se

                                      UrsBollhalder 1 Reply Last reply Reply Quote 1
                                      • UrsBollhalder
                                        UrsBollhalder @ulrik last edited by

                                        @ulrik ok... That'll be fun... 🤣
                                        What is meant by indexes in this case? I also saw this one:
                                        Screenshot 2021-09-08 at 11.14.51.png
                                        slotIndex?!

                                        Thx for the help!

                                        www.ursbollhalder.com
                                        www.Instagram.com/urs_bollhalder_composer

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

                                          @Christoph-Hart could we have a small snippet showing how to

                                          getCurrentlyDisplayedIndex()
                                          

                                          from played sample in a sampler?

                                          I've fiddled around with

                                          createSelection()
                                          createSelectionFromIndexes()
                                          and
                                          createSelectionWithFilter()
                                          

                                          but I just can't getCurrentlyDisplayedIndex()
                                          from any of the selections, I guess I'm doing something stupid 🥺

                                          Hise Develop branch
                                          MacOs 13, Xcode 14.0.1
                                          http://musikboden.se

                                          ulrik 1 Reply Last reply Reply Quote 1
                                          • ulrik
                                            ulrik @ulrik last edited by

                                            @Christoph-Hart I guess we need to enable this for creating the proper reference to the sampler, right?

                                            Skärmavbild 2021-09-09 kl. 09.55.32.png

                                            Hise Develop branch
                                            MacOs 13, Xcode 14.0.1
                                            http://musikboden.se

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

                                            21
                                            Online

                                            982
                                            Users

                                            6.6k
                                            Topics

                                            60.8k
                                            Posts