Help me understand how the "Loop" works in "Sampler"
-
@Mighty23 I just had another look at the sample import tutorial, it does actually work, but not with the demonstration samples, you need to drop in your own sample.
-
@d-healey is there a way i can connect the values of .SampleStart & .SampleEnd to .LoopStart & .LoopEnd :
const var SampleStart = Sampler1.SampleStart; const var SampleEnd = Sampler1.SampleEnd; const var LoopStart = Sampler1.LoopStart; const var LoopEnd = Sampler1.LoopEnd;
This would simplify both the implementation and the final UI for the user.
-
@Mighty23 Is that a good idea? I think you'll get pops/clicks at the loop points if they are exactly the same as the start/end points.
-
@d-healey said in Help me understand how the "Loop" works in "Sampler":
@Mighty23 Is that a good idea? I think you'll get pops/clicks at the loop points if they are exactly the same as the start/end points.
you might want to do this if the sample is (say) a drum loop
-
@Lindon Without any crossfade?
-
@d-healey of course not - most drum loops are (in my experience) trimmed to be exactly loop-able (hence their name)
-
@Lindon Right, but in this case the user is dropping in samples and adjusting loop points, so it isn't a pre-cut sample with a baked in crossfade. So we will need some time at the start/end to allow for crossfade.
-
@d-healey said in Help me understand how the "Loop" works in "Sampler":
I think you'll get pops/clicks at the loop points if they are exactly the same as the start/end points.
Should the user re-adjust the Attack and Release to avoid this or could control the XFade as in the example in "CustomSampleImport" . Should the audio glitches you are talking about not occur even if you set the SampleStart and SampleEnd incorrectly?
Something like: (this don't work)
const var Sampler1 = Synth.getSampler("Sampler1"); const var SampleStart = Sampler1.SampleStart; const var SampleEnd = Sampler1.SampleEnd; const var LoopStart = Sampler1.LoopStart; const var LoopEnd = Sampler1.LoopEnd; // LOOP const var Button1 = Content.getComponent("Button 1"); inline function onButton1Control(component, value) { local allSamples = Sampler1.createSelection(".*"); for (x in allSamples) { x.set(Sampler1.LoopEnabled, value); if (value == 1) { // If loop is enabled, set LoopStart and LoopEnd to match SampleStart and SampleEnd local sampleStartValue = x.get(SampleStart); local sampleEndValue = x.get(SampleEnd); x.set(LoopStart, sampleStartValue); x.set(LoopEnd, sampleEndValue); } } }; Content.getComponent("Button 1").setControlCallback(onButton1Control);
(I tried the example with other SampleMaps and it doesn't seem to work)
-
@d-healey said in Help me understand how the "Loop" works in "Sampler":
@Lindon Right, but in this case the user is dropping in samples and adjusting loop points, so it isn't a pre-cut sample with a baked in crossfade. So we will need some time at the start/end to allow for crossfade.
hmm, my experience of this sort of loop- and I've worked with them for over 15 years, is that there is no "baked in" cross fade, a drum loop is just that. Try it yourself:
- create a drum pattern in Reaper over 4 bars, export the 4 bars exactly... take the ensuing wav file and (if you like) drag it into a sampler - set the loop start and end points to the start and end of the wav file, press a key - the loop starts to play - hold it down and it repeats - without a glitch or cross fade in sight...
Sure if the last hit on the drum kit rings out past the end of the loop then you might want to do some cross fading - but you dont have to....
-
@Mighty23 To avoid pops/clicks at the loop points you need crossfade, which means you need some space before and after the loop point.
The property constants are part of the Sampler class, not a specific sampler.
Try something like:
x.set(Sampler.LoopStart, Sampler.SampleStart); x.set(Sampler.LoopEnd, Sampler.SampleEnd);
-
-