Problem rendering samples with modified start times
-
Using the sampler, sample start mod active and a modulator to change the start time works fine on playback, but as a compiled plugin it doesn’t render it the way it’s played back if you export it from your DAW. It will treat it as if it’s just triggered once and play the sample throughout instead of as it’s heard when played back. Any idea how to fix this?
-
Do you have a minimal example project?
Which DAWs have you tested? -
Tested in Ableton Live, Reaper and Maschine so far. Reaper renders zero output, Ableton Live and Maschine renders it as if it was a "regular trigger".
HiseSnippet 1419.3oc4X0saaaCEVJNrn1qqXsnWrK1EBE6BGfVG6z+FP2PcriSqQqSLrSyF1tnfQh1lMTjBTToycnXOJ6UXOB6QpuAaGRJaS45lklk1ArkKBz4vyg567+QtuTDRRSERO+xGLMg34eEzvob0j1SvTtW2c77uJpGNUQjAVVsllfSSIQd99kdrlge408L+81G0Byv7PxBVddGJngjmQiopEb627oTFaWbD4.Zriz2sY2PAusfIx.7TBU2KAGdLdLYOrVr0Pd9WpSDUIjCUXEI0ye8VhnoCmHdE2J+gzT5QLhlng2P3hrr2UvhzHV+rW6ITVT+Y1cpmmOp+BuPIqW3FndzH5b9K7Feg4ffEZ35O7WqH7JU.dMdevaEPx2ARqagz0PCCkzD0hSz34yPc4PvYDFb6tPwJq2Z+1Zn1BPBtpVL9XxtRfXtFUue852J.92FOrREv0mpBNACAZ8SXtpQv2EXRFpMln5IhxXXv3pdy4meyh5ofnoDzoCeLkSpEJIfaPGhk6ezKIgppZwkjwAFUfCn7wf3MpU+gF1jS.X1MpNv61M.QobFbOAix3gJpfGjvvSGhiSXjpaT4WpT1QdKL0BrmPosqaEzXqG.uuxyAasThwx4oT0zpNPPKUQD4Rc6f50.v7lJULlm9VLlTaLicDjdVcAp13gygpfqww9bKP6AwKHMtFcLWHIczvtpRlQzu47aUgk16s5VlvwapDr7kMZj81r1J2xp0zNVuP0YdC2KUjXuySwQ.d+20AXBIEgfNKRJXL8soQwRGm+dVwI4JVkmEeDQdKHSgAV9LAgz6h0LW5rUyDZSpcDTv6xop8SH4zKJ5arhJLu7pB3om2cGrBqK5x4AxkPjJpFN96PNA5fYKAKi1gjdL3UgdXuS8IzYXVIha6BcOx7C.+QgZz4AA2dnK2CY82u+n9JawsRq8LB2qg5SUgSVMdWaE3E7ZerwadG4OG0YzHnIxBvtNZ2e3Ta+dgCkuxBkqiFpfda5ZEagusUbETNUiKhgjIm4gj8kDl.GMj9ZGw9ilsx.+krH2euo4UscrHiW3cki7AjDnmMD9cz4xMGL3wRQVxxZ81GYRVNPBcAAWg6A6yIfeW4ZiskhzzQf4XtqT2i5mIGq8UK3L.ZlISKxaurXH1y4DFnLx2WW4lRzwZZXOrRR+YWoMuk5GfMwaXyACcikn2ZI56rD8cWh9dKQe+knevBZeTwbwKe1Zq0CmzGClnijsn4YYvYVNEao3H5berAGN6E883SHiDxXGYWwRGW5i0dPeR6g8OukaoyFb+aVaq7LLNjpidc3m.ko.GMFuNLHYDNiolwsXKidBtHYhfSCKVT.I4iGSjtXekFz1JETStfyMZNfvH3Tmp5ut4yfcqvxh05eP9hO7UXWY75KQV3Fn6yE7eiQkk9e+nxSy0c07AkAC0a8dgFm+.9puUjeVAMaI47usZ9NyWnMQN8BmypW7JHyLm.8JB+aUqLPjofQ+yF+hfYzCg8RBItSpWSO82RWWSqAzPBOxP7mve4G1X1Xc8gMlcnW3rqBrs7mM6q6Whv0i4LqlxfEFXt0Zov1OZHAih8RMYawv3SPTKAH5.gdAEj+2BR+LwSIS0Da.DOglS7SlSNTewVT+DZNwupsc6VQy.8tTV9uSQDZSXwDY5luTvAfxiwr3M6kkRC2LOuW+yZjt4Nau2i6L34+X.3x3QGSUAGMMnEi75WGzB1BKcytPxmLKF9hj7mCZOQH30dE9DucxRXzPHVZ9Xey0ZplfDEMht4gehhNw3Po3Eg1uwSGitrgCDc3FmQYTOMcPCOy28A5gpWqtWLr7vKBC0cltMjYsZc15bnycNG5b2ygN26bny8OG57fygNeyopidussyThX6TKfQ+N1BJ+NyKnJ48WvTUG2T
-
Increase the timer speed on onNoteOn() for a more dramatic difference, in my real project I have it pushing down at 25.
-
@d-healey Any clue why this happens?
-
@blezzbeats Why are you using a timer and not an envelope for this?
-
@d-healey Didn't know there was a way to do that with an envelope, my project calculates the bpm based on the sample length, chops a sample up into pieces, and plays it back in different sequences in the tempo of the host bpm regardless of pitch. So it's a haxxor timestretch using the sampleStartMod that needs to be as precise as possible. Surely some sort of timer must be needed?
-
@blezzbeats Yep, probably need a timer for that, and you probably don't want it in your interfaces script (since this should be deferred).
-
@d-healey Oh yeah? I got that backwards then. I thought deferring callbacks was useful for non-realtime things.
You think that might have something to do with the audio being rendered differently too?
-
I thought deferring callbacks was useful for non-realtime things.
It is. Always defer your interface script. Anything you need realtime (like starting timers at precise moments) should be in a secondary script.
You think that might have something to do with the audio being rendered differently too?
Possibly.
-
@d-healey Thanks for your input!
-
@d-healey One follow-up question that I can't seem to find any good info on when I'm detangling my scripts, how do I update a variable in another script from the interface script?
-
@blezzbeats You can use global variables, but you should avoid them at all costs because they make things messy.
Generally scripts should be independent of each other. Treat scripts like the way you treat HISE's built in modules, if you want to connect things on the UI script to the module you use either parameter/processor ID, or you use the
setAttribute()
command.I posted a video on patreon last Saturday about articulation switching where I demonstrate this.
-
@d-healey Thanks!
-
I think I found the problem in case anyone else runs into it. If you create a timer with Engine.createTimerObject(), it will be straight-up ignored when you render it in your DAW. The regular onTimer function does work though. I used a timer to trigger another timer so I guess I'm outta luck.
-
@blezzbeats Oh yes that's true. Timer objects are non-realtime, but the synth timer is. If you want two timers then use two scripts/midi processors.
-
@d-healey Do you know how I can trigger the timer of the second script from the first one?
-
@blezzbeats Maybe, tell me what you are trying to achieve and I'll see what I can suggest.
-
@d-healey The sample is divided into 16 even pieces. One timer controls when it should switch over to the next piece (next 16th), according to the host BPM, by changing the Constant modulator of the SampleStartMod of the sampler. Each time that one triggers, it triggers another timer which takes a calculation on how much to stretch the sample based on host BPM, sample rate, sample length, grain size, currently played pitch etc. and machineguns the same Constant modulator.
I had everything working pretty much, now after backtracking and rewriting everything I just need to figure out how to trigger that second timer from the first one. It may work having them run parallel?
-
The way things are twisted together it would be much easier if there's a way to have the timer of script 1 trigger the timer of script 2 though, to avoid duplicates of like 50 variables.