How do you load samples into the sampler via scripting?



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



  • 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).



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



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



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



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



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



  • Really? Is it just happening on the loop player?



  • jup, only on the Audio-Loop player.



  • I'm also noticing a discrepancy in the waveform view.


    It appears that the center line of wav image shifts depending on the sample. Check out this video for a better explanation.



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



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



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



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





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



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



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



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



  • This post is deleted!

Log in to reply
 

11
Online

491
Users

1.7k
Topics

12.9k
Posts