Changing the start point of the samples on reverse playback mode by code
-
Use a different sampler and sample map for the reverse mode, then you can cut the samples exactly how you need them.
-
Use a different sampler and sample map for the reverse mode, then you can cut the samples exactly how you need them.
I'll try it! And how can I switch between Normal and One Shot playback? I'm trying to use
Sampler1.setAttribute("OneShot", value);
But don't work. Any suggestions?
-
@Gabriel-Strozi Try
Sampler1.setAttribute(Sampler1.OneShot, value)
-
@d-healey said in Changing the start point of the samples on reverse playback mode by code:
@Gabriel-Strozi Try
Sampler1.setAttribute(Sampler1.OneShot, value)
Also didn't work. Nothing changes
-
@Gabriel-Strozi You need to get the sampler as a child synth.
HiseSnippet 1175.3ocyW0saaaCElJNJH1qKXsnWraFfPvtvAnKvtMMc.EC0wNNEFqIwvJqX2UvHQaSDIRARJu5MzGnc2dD1yvdR5av1gTR1TtFdNdsY0WXvyeje77KUeAOfHkbAxo5USSHHm645OkoF2YLlxP8NE4rm64XohH7xX0dZBVJIgHGmJuTyvo51Hyu2+h13HLKfLmEB8ZNMf7JZLUMma+V+HMJ5LbH4JZrk1G0pW.m0gGwSA7TwsAJAGbCdD4BrVssbQN6zMjp3BeEVQjfNs4gS8Gy+EVl9ulJoWGQzDMQ9vFkwF0YLMJrewcUhPNt8meyqjcyen64zP5L9y8.ekQf2bKr8ANasJH07V.IGKHscFjtuqefflnlKQimuvsGCBHCwfq1FJY5h152cb6vAMXpCiw2PNS.Dyrn9wMZ7HO3uCddsZf6Vp7lfEd933jHhno2O3Yh+GNhnLPzPUe+B46qMixhnLh2vTVfhxYdbV6TkhyZpOVAOpd.ONgy..7HXyiRIGT62pUsXKNTRTmnTB50oJR8YbujQ.21LKdds2AmTw8Pilh8r994m19Gn2p7yrCNJ5ZHco9hfA1IKfdAWQtjU2.nZuql2hhFNboxx2K.nKUrNOVrJCqyRiulHrcGZEg.c4rmcVurmfL2hkhbVOFUcYBIm9LdTnNqPu9Cy0P49UX0O06TrBqS+x4A5kPDJpFNNmRl.0uYIiUcOkHuQwSL5lGLfJIkQ5d4opYNeDMTaPdj.8VPMm+BNso5EgvBIdBoGquf.QPctK5CS9gxNdXZDVUtVT2zIW.3hKU.nSxYRpZpcSoaQAZiUVfttP79t8opfwKGiasDLBN+OEXLus1W51c3PRfZN.218redS6gs9G+2jc7Ov0WIH3XJaTdotAC0bKJ7+XLQIYsmn.YbQbbnO8WsT6Oa0NE7Qhxb+iVli5jXdJqzYki7AjDBVAgYKa1s0fAuTvSSVzp2+BSRwUBnEE3JrEj23y9N1Qvkxgv0wrWRaQ8SEiz9p4bFPlPDxx7tHMFh2LFIRpq3bzE5RhN9RCNGC8deqs1lSowUXSLFFyZnat.8iWf9IKPezBzOcA5iWf9YyoybnmiSzYF5w7KzUb20qqHrA8wvU1Ry1zQy17LNkaeXo5LetAWVOpvmnTPHSZo6RlduympGTr85UL9uzv+y+1qkd+S0BL5S0QutrIPYKvQiwG.ygFhSiTEbK2B4bNimLlynAkKRfj9QiHBaruzKD7zDnFcNmG1Z.IhfkVU4eaqWAu+AKJW6eq7E292Btz30W6lAWOceOu+Kws6zzrUNhrxZMh7iNd27wk2ott8xGb5AmtP8Ydb9dtlV8d5Iy+eA0A7Tc66hodtvnQe34.AD6AjaoG5lQ2PSqAjOgEZH9a3WtvlESS0BaVHDETrUvcKes4U0NUHL8zDyK+hf4zQ1ozR3QGZHAS7tSPYLNPveSP1Wjnw5tFN.JYlOvtJ7k9.sWSj4qT.6babXCTLLq5MAA5BguC7vK2lGuA17jMvli1.ad5FXywafMOaCr46WoM5mIbRphGm0jDXzuaVhkS2YIVUP+Cn97DG.
-
It worked! Now I just have to cut the samples and create new SampleMaps for the reverse Sampler.
Thank you so much!
-
@Gabriel-Strozi Don't cut the samples. Just duplicate your sample map and rename it, then shift the start and end times inside HISE. That way you won't have to use extra disk space or RAM as it will share the same samples.
-
@d-healey How do I use both Sample Start End Knob and OneShot/Normal button?
If I useconst var Sampler1 = Synth.getChildSynth("Sampler1");
Start End Sample and Samplemap CB Not working..
If I use
const var Sampler1 = Synth.getSampler("Sampler1");
Normal/Oneshot not working.... How to compensate both scenarios?
-
@DabDab name them with other names
const var SSynth = Synth.getChildSynth("Sampler1"); const var SSampler = Synth.getSampler("Sampler1");
-
@ulrik Ok.. got the logic.. :) (y) Thank you.
-
@DabDab or use the asSampler function
-
Getting the sampler with the Synth.getSampler("Sampler1") you can change between Normal/Oneshot using the parameter ID from Module Browser instead of using the parameter name:
Sampler1.setAttribute(10, value);
The Sampler parameters are:
It worked for me as well.
-
@Gabriel-Strozi said in Changing the start point of the samples on reverse playback mode by code:
parameter ID from Module Browser
The reason you shouldn't do this is in case the numbers are changed in the future.
-
The reason you shouldn't do this is in case the numbers are changed in the future.
Makes much sense! It's a relevant reason!
Let's rewrite some code hahah -
I am having an issue. I am little weak in Sampler stuff. My Two questions are how can I switch between Noram, OneShot and Reverse mode via ComboBox.
const var A = Synth.getChildSynth("Sampler1"); const var B = Synth.getSampler("Sampler1"); const var ComboBox1 = Content.getComponent("ComboBox1"); inline function onComboBox1Control(component, value) { switch (value) { case 1: B.setAttribute(10,value); case 2: B.setAttribute(13,value); case 3: B.setAttribute("Normal",value); }; }; Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
Compiled OK. But Once it's changed nothing happened via ComboBox.
how to fix it? What have I done wrong?
And what is the value for
Normal
mode? -
@DabDab Check the posts above : you have to write it like this :
module.setAtrribute(module.parameter, value)
And don't use the magic numbers.
EDIT : Corrected.
-
@Matt_SF said in Changing the start point of the samples on reverse playback mode by code:
@DabDab Check the posts above : you have to write it like this :
module.setAtrribute(module.parameter(name, value)
And don't use the magic numbers.
I think it's this way
module.setAttribute(module.parameter, value))
-
-
@Matt_SF @ulrik Not very clear to me though...
To be precise here is my Snippet...
HiseSnippet 1343.3oc4X80aSbDDeu3bT7UREfPp8kJsJpOXjRC1g.TUTEN1IA4BIXEGn8Mzl6Fauh618zd6kfKhuS8iP+Hw2f1Yu+3aswI3FUnn16kjY1Yl82N+OouR5CIIREwo9wShAhy0bGLQnG2cLiKH81k3349y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hIG1r5pjIICwmSlsRre98SUiL9pJNk84s4cXZDF6EBHzztywAY87DvDq49GvvIEu1V5rao4wrr3MttVFcq4n2ZN56NG81yQeu4nu+bzOnhN2gd.K1jYXVWbt90dKW+Zz.8Y3S1RxN7QSMdNmpD3ljot4LnXsO5uvNEFhMurrz.Pqw.WhEq40ZA6.dkOqWQ8SWi4ZKGb+.aQWuDilkGCg8DmhEyHGCFuIN+aHKMTWxc1FKGHEx3wRA2e1RGrTXzHPYi8E9fv0qvJ2JN2p8QPHfKiUw56Z+TbATlZ1NB+s7EsVdewEEu9F2b3RMcCo+2XfZs+2OP8hbceUw3TJd6J8m4w4q4lM.fZlW+uETORlZZmWNKzEGXN.WRvGrGathYe9b5lFZCfF.hfLh+D+JNrU4LVygsJOj3WZJ7sU76Yay6TCDlQGY6IFhSuCsSoSvUQLPBmC9IAkQLek7k94+sJFrd0LNHJEY+6ap6dfglN8OOw0s4lMIQ3rpW56aJD9dzCuXc15RnycuD5r8kPm6cIz49WBcdvkPme3B0wrlvNoZYTdSRjQ+8xSrb1aZhUMxeUebkAH
Can you correct me?
-
You have this
B.setAttribute("OneShot", value);
, which is not in the format Ulrik showedmodule.setAttribute(module.parameter, value))
But in your case you don't want to pass
value
because that will be the value of the combobox, you need to pass either true or false.You should also use breaks after each case.
You might find this document useful too - https://github.com/christophhart/hise_documentation/blob/master/scripting/scripting-in-hise/hise-script-coding-standards.md