Problem with looppoints
-
I have a problem when I enable the loop function in the sampler. When I do this, a generated end point appears. If I change my own end point, it is ignored.
I only want one end point, and that should be my own—not the generated end point that the sampler creates.
How can I prevent this from happening?
Schermopname 2025-04-01 om 10.26.05.mov
//AudioWave LAF const var SampleStart = Sampler1.SampleStart; const var SampleEnd = Sampler1.SampleEnd; const var laf = Engine.createGlobalScriptLookAndFeel(); laf.registerFunction("drawThumbnailRange", function(g, obj) { g.fillAll(0); // Start point (using existing position property) var startX = obj.position * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(startX, startX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(startX, startX, 0, obj.area[3], 1.5); g.setColour(0xffFFFFFF); g.setFont("regular", 12.0); g.drawAlignedText("Start Pt", [startX + 5, 5, 50, 20], "left"); // End point (using new endPosition property) var endX = obj.endPosition * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(endX, endX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(endX, endX, 0, obj.area[3], 1.5); g.setColour(0xffFFFFFF); g.setFont("regular", 12.0); g.drawAlignedText("End Pt", [endX - 55, 5, 50, 20], "right"); }); // Variables to store loop points const var loopPoints = { start: 0.0, end: 1.0, enabled: false, settingStart: true, // Flag to toggle between setting start and end points endPoint: 1.0 // Adding the EndPoint property to the object }; laf.registerFunction("drawThumbnailRange", function(g, obj) { g.fillAll(0); // Draw playhead position var x = obj.position * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(x, x, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(x, x, 0, obj.area[3], 1.5); // Draw start point marker var startPointX = loopPoints.start * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(startPointX, startPointX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(startPointX, startPointX, 0, obj.area[3], 1.5); g.setFont("regular", 12); g.setColour(Colours.white); g.drawAlignedText("Start", [startPointX - 0, 5, 40, 20], "centred"); // Tekst voor startpunt // Draw end point marker var endPointX = loopPoints.endPoint * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(endPointX, endPointX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(endPointX, endPointX, 0, obj.area[3], 1.5); g.setFont("regular", 12); g.setColour(Colours.white); g.drawAlignedText("End", [endPointX - 40, 5, 40, 20], "centred"); // Draw loop start and end markers if loop is enabled if (loopPoints.enabled) { var loopStartX = loopPoints.start * obj.area[2]; var loopEndX = loopPoints.end * obj.area[2]; // Draw loop region background g.setColour(Colours.withAlpha(0xFFFF5400, 0.15)); g.fillRect([loopStartX, 0, loopEndX - loopStartX, obj.area[3]]); // Draw loop start marker g.setColour(0xFF8d478d); g.drawLine(loopStartX, loopStartX, 0, obj.area[3], 2.0); // Draw loop end marker g.setColour(0xFF8d478d); g.drawLine(loopEndX, loopEndX, 0, obj.area[3], 2.0); // Draw loop region border g.setColour(Colours.withAlpha(0xFFFF5400, 0.5)); g.drawRect([loopStartX, 0, loopEndX - loopStartX, obj.area[3]], 1); } }); laf.registerFunction("drawThumbnailPath", function(g, obj) { g.fillAll(obj.bgColour); var a = obj.area; g.setGradientFill([0xFFFF5400, a[0], a[1], 0xFF8d478d, a[2], a[3]]); g.drawPath(obj.path, obj.area,1.5); g.fillPath(obj.path, obj.area); });
-
@tiesvdam In your video you have multiple samples selected. Please show just one sample selected.
-
@d-healey Then this is happening, almost the sameSchermopname 2025-04-02 om 16.10.02.mov
-
@d-healey, I also have the problem that the audio waveform shows only the line following the audio of the first note in my sampler. Is it possible to do this with all the notes?
-
@tiesvdam What you're showing in the video is what you have drawn, correct? At the moment I'd say the problem is in your code, if you can put a minimal example together I can test further.
-
@d-healey Sorry what do you mean by a minimal example? i think its the code to
-
@tiesvdam this is the code i made
//AudioWave LAF const var SampleStart = Sampler1.SampleStart; const var SampleEnd = Sampler1.SampleEnd; const var laf = Engine.createGlobalScriptLookAndFeel(); laf.registerFunction("drawThumbnailRange", function(g, obj) { g.fillAll(0); // Start point (using existing position property) var startX = obj.position * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(startX, startX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(startX, startX, 0, obj.area[3], 1.5); g.setColour(0xffFFFFFF); g.setFont("regular", 12.0); g.drawAlignedText("Start Pt", [startX + 5, 5, 50, 20], "left"); // End point (using new endPosition property) var endX = obj.endPosition * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(endX, endX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(endX, endX, 0, obj.area[3], 1.5); g.setColour(0xffFFFFFF); g.setFont("regular", 12.0); g.drawAlignedText("End Pt", [endX - 55, 5, 50, 20], "right"); }); // Variables to store loop points const var loopPoints = { start: 0.0, end: 1.0, enabled: false, settingStart: true, // Flag to toggle between setting start and end points endPoint: 1.0 // Adding the EndPoint property to the object }; laf.registerFunction("drawThumbnailRange", function(g, obj) { g.fillAll(0); // Draw playhead position var x = obj.position * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(x, x, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(x, x, 0, obj.area[3], 1.5); // Draw start point marker var startPointX = loopPoints.start * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(startPointX, startPointX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(startPointX, startPointX, 0, obj.area[3], 1.5); g.setFont("regular", 12); g.setColour(Colours.white); g.drawAlignedText("Start", [startPointX - 0, 5, 40, 20], "centred"); // Tekst voor startpunt // Draw end point marker var endPointX = loopPoints.endPoint * obj.area[2]; g.setColour(0xFFFF5400); g.drawLine(endPointX, endPointX, 0, obj.area[3], 10.0); g.setColour(0xFFFFFFFF); g.drawLine(endPointX, endPointX, 0, obj.area[3], 1.5); g.setFont("regular", 12); g.setColour(Colours.white); g.drawAlignedText("End", [endPointX - 40, 5, 40, 20], "centred"); // Draw loop start and end markers if loop is enabled if (loopPoints.enabled) { var loopStartX = loopPoints.start * obj.area[2]; var loopEndX = loopPoints.end * obj.area[2]; // Draw loop region background g.setColour(Colours.withAlpha(0xFFFF5400, 0.15)); g.fillRect([loopStartX, 0, loopEndX - loopStartX, obj.area[3]]); // Draw loop start marker g.setColour(0xFF8d478d); g.drawLine(loopStartX, loopStartX, 0, obj.area[3], 2.0); // Draw loop end marker g.setColour(0xFF8d478d); g.drawLine(loopEndX, loopEndX, 0, obj.area[3], 2.0); // Draw loop region border g.setColour(Colours.withAlpha(0xFFFF5400, 0.5)); g.drawRect([loopStartX, 0, loopEndX - loopStartX, obj.area[3]], 1); } }); laf.registerFunction("drawThumbnailPath", function(g, obj) { g.fillAll(obj.bgColour); var a = obj.area; g.setGradientFill([0xFFFF5400, a[0], a[1], 0xFF8d478d, a[2], a[3]]); g.drawPath(obj.path, obj.area,1.5); g.fillPath(obj.path, obj.area); });
-
@tiesvdam said in Problem with looppoints:
@d-healey Sorry what do you mean by a minimal example?
a HISE snippet that contains only what's needed to demonstrate the issue
-
@d-healey I think you need all i send in the snippet, because I think the problem is with the start/endmarker that I draw here
-
@tiesvdam Make a new project, add in whatever is needed to demonstrate the issue - and no more than that. Then either send me the project folder (if I need some external files you are using) or post a snippet here - Export >> Export as HISE Snippet.