HISE Logo Forum
    • Categories
    • Register
    • Login

    How do you load samples into the sampler via scripting?

    Scheduled Pinned Locked Moved Scripting
    21 Posts 5 Posters 3.3k 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.
    • E
      elanhickler
      last edited by elanhickler

      Can you load samples into the sampler via scripting? The instrument I'm working on a project where we want to create an interface that the user uses to load their own samples. We just want to allow the user to load a single wav file.

      "Remove" would also be nice.

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

        There is the "Audio Loop Player" sound generator which can load a sinlge audio file and play it either as loop or as pitched note:

        HiseSnippet 1117.3oc4W0taiTCE0SRFUZfxxBKR7SqH9QVoR6jzVVDHDosaKDneD0TJHgPKtybShU8XG4wS6FVsOV7dviBuAf87QlYRl1lrr.RriTThOWe8btWeuG6zSJbgf.gDY81mOYLfrdG69S3pQ6OhP4ntOEY8t1GSBTfDGCs2jwjf.vCYYU8qM.VqVCE87Ge0dDFg6BYPHzEBpKbD0mpxP+kNeGkwNj3AmS8yM6s6z0Uv2WvDgZ9T01AMl3dEYHbBwLsJ1nqovMAHKG6sZug7pVW9q6twLOe+2rmFaXQbjanTBb0EZ2QV1V+o9wx9.OpRH6qHJPul16I7lzej3Ft4U2BcAMfdIChGzWyoXFcnf4YBdCZWtNsLf3BScyAg1eDk40KMsFfzqburjb03j7irOl5QmhmkreuHC3LOxmtspTjx0VVJWJ8rxQuZwz6g18ckzwpLKFt89In2B6hMhp7aUr2WnyLb0F9jqfCk5ASyTM2wwYcbaGmG+E0060AJ70DId2POp3GHWCCDRe7WhS8m34UvTyFEF1vrRlO5EayMw+z21+zSJtV+b8zkJ.LQyXPpnPflS9lIO+58h0piwMtg5oF03ywa2dm0i.FAzgiTZjVa0NFYbZNnqmFNdcvGIDiw8XjIfrwZ0eYBs1rLdkE7GQtDXEC5HnlMh9JIHa8jBQYjo6M5RWf3nRAO2DBMNyDKXWF08JrfiUi.7Mo4dk.yDDOLgiIQgz.JCZr9LYEmYxJo.9gLEkQ4fFa.gE.ylDho8fPtqhpe0B9IBEbJu4iq+h5qV+k0m0xfAkYxD0RAiAxxrZzTj2gaM4g9WBx00IeVHjNOc6Qwlq5KVyka7NPtIJ3c4T0oigoiiCxTDGzzfKOTVPkGMJXJYZYPy2QiRpJz81URlNxZEUTm8GlzCWnZDQ0MvOvtHVT1IuRdNYhOvdt5cjjvGB5jmTYTXMNDgb.2KcroTZpRNZJypFyr0RXVTIRDiVwN92ywDz7JVZcSgWHinJJlZNfJwftFnfbkQRhGPUSxe.1Rnv5bKGJTx9wBR2GZ2ipbGUNeqTBeMav+Cy2jyqVy9fAC.WUFYqYe3O9pd3zqFUdPJUhp8LkdP74RkUMd62R42e8eKE8Elb06ZP9Jonsxyk56uP4Cy+pLr7.NQmJ7xO+yDBkQUHCqWmCy2v3aBh3FIexyS+4rpVK3sXJ1Wja9281gUs+CtJyq+Fs+95BUWL5dO21ZkTN1m5OlokJuFX5p5DwfmBCH5ySmhdujbWkRWtkg7nNmALfDjql5i6bj9zYhb1p0kH9Zs3w2csG7Q1wzEaZtv++Pit5alZzmIBUZQtiIJI0HLcRnees1nKnYBmCLirjUEy8RhG6jJd0G3dNo+erDisLisRL1J03+JuCehqT7L236kXpkeqHDcbyiDgWU+Gg0iwsRuQhI23q03dlqqIY+IsPnx8n8R6wVKsGauzdryR6wmtzd7jk1iO6N7vbfxtgJgebqGB8WNfUhHA
        

        You can connect a AudioWaveformDisplay from your script interface to it. It's not 100% what you need, but it might be a good starting point (let me know if you get along with this).

        1 Reply Last reply Reply Quote 1
        • Dan KorneffD
          Dan Korneff
          last edited by

          @Christoph-Hart Is there a way to make the Audio Loop Player velocity sensitive?

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

            Any hints?
            Make Artificial?
            get value from Velocity Modulator?
            setVoiceGainValue?

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

              What do you mean with velocity sensitive? Just drop a velocity modulator anywhere you want "velocity sensitivity".

              Dan KorneffD 1 Reply Last reply Reply Quote 0
              • Dan KorneffD
                Dan Korneff @Christoph Hart
                last edited by

                @Christoph-Hart when I load a sample into the Audio Loop Player, it plays the sample at 127, no matter what the incoming velocity is.

                1 Reply Last reply Reply Quote 0
                • Dominik MayerD
                  Dominik Mayer
                  last edited by Dominik Mayer

                  confirmed, all VoiceStartModulators don't seem to have any effect on the GainChain.

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

                    Really? Is it just happening on the loop player?

                    1 Reply Last reply Reply Quote 0
                    • Dominik MayerD
                      Dominik Mayer
                      last edited by

                      jup, only on the Audio-Loop player.

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

                        I'm also noticing a discrepancy in the waveform view.
                        https://youtu.be/96DzxI5vTYA
                        It appears that the center line of wav image shifts depending on the sample. Check out this video for a better explanation.

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

                          @Christoph-Hart Anything else I can do to help track this down? Or do yo know what it might be?

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

                            Can you send me the sample? It appears to just happen with audio files that have a DC offset.

                            Dan KorneffD 1 Reply Last reply Reply Quote 0
                            • Dan KorneffD
                              Dan Korneff @Christoph Hart
                              last edited by

                              @Christoph-Hart Here's a link to the samples from the video above. I don't see and can't calculate any offset in the files. They display properly in the LoopPlayer module, but not in the AudioWaveform script panel.
                              https://we.tl/t-qNFLXXShpI

                              I'm not concerned about the waveform display as much I am with the fixed velocity during playback ;) Do you think that's an easy fix? It's the only roadblock to finishing my current project (other than the overlapping midi issue).

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

                                I have fixed the velocity a few hours ago - I just forgot to add sound.applyConstantGainModulation() :)

                                Dan KorneffD 2 Replies Last reply Reply Quote 0
                                • Dan KorneffD
                                  Dan Korneff @Christoph Hart
                                  last edited by

                                  @Christoph-Hart ❤❤

                                  1 Reply Last reply Reply Quote 0
                                  • Dan KorneffD
                                    Dan Korneff @Christoph Hart
                                    last edited by

                                    @Christoph-Hart Is the new version okay to build? I'm getting a bunch of errors on my Mac.

                                    fatal error: too many errors emitted, stopping now [-ferror-limit=]
                                    35 warnings and 20 errors generated.
                                    

                                    Screen Shot 2018-12-30 at 4.25.05 PM.png

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

                                      PC build seemed to go fine... maybe it's me.

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

                                        @Christoph-Hart I don't think it's me. I tried Xcode 10 and 8. Can't get the Mac version to compile.

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

                                          My build server didn't complain. Also these errors look like some intermediate file BS. Try a clean rebuild, something is messing with you.

                                          Dan KorneffD 1 Reply Last reply Reply Quote 1
                                          • Dan KorneffD
                                            Dan Korneff @Christoph Hart
                                            last edited by

                                            This post is deleted!
                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            51

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts