Mono Sampler
-
@d-healey ahh, that makes sense! thing is, It had been stumbled upon when playing notes fast, so if im understanding correctly, this is a problem with the pitch fade function itself, right?
-
this is a problem with the pitch fade function itself, right?
No it's a user issue :) one note only.
-
@d-healey aye-aye!
-
@d-healey hey again! I noticed another thing which I was wondering how to implement, when the glide time is set to anything above 0, when you hold on one note, let’s say C, then press E while holding C, then release E, it causes the note to go back to the C and retrigger it, causing a trill like effect. However when you set the glide time to 0, causing retrigger mode, the same doesn’t happen, and instead holding the C, then pressing E while holding C, then letting go of E while holding C causes E to continue playing, what modifications to the script should I make to get that effect?
-
@Casmat Have you tried using the hardcoded legato script that comes with HISE? That might do what you need without using my mono script.
-
@d-healey not yet.. where can I find that?
-
@d-healey just found it!
-
@d-healey hm, this legato script in hise seems to continue playing notes even when I let them go, if I tap a note, it just plays on even when let go. And having a glide time setting is something I wanted, which the script in hise doesn’t have, or am I missing something, I can’t find any parameters for it
-
@Casmat If the note continues playing that makes me think you have a long release time or the sampler is in one shot mode. The legato script doesn't have a glide setting, and as you've found, the one in my script needs some work for real-world use.
-
@d-healey Woohoo!! After some long fought trial and error, I got the retriggering working for when the glide time is below zero:
/* The MIT License (MIT) Copyright © 2017, 2018, 2019, 2020, 2021, 2022 David Healey Permission is hereby granted, free of charge, to any person obtaining a copy of this file (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ Content.setWidth(650); Content.setHeight(50); reg lastNote = -1; reg retrigger = -1; reg eventId; reg lastTuning = 0; reg vel; reg retriggerHold; //GUI const var bypass = Content.addButton("Bypass", 10, 10); const var time = Content.addKnob("Time", 160, 0); time.setRange(0, 2000, 0.01); function onNoteOn() { vel = Message.getVelocity(); if (!bypass.getValue()) { if (lastNote == -1) { lastNote = Message.getNoteNumber(); eventId = Message.makeArtificial(); } else { if (time.getValue() > 0 && eventId != -1) { Message.ignoreEvent(true); Synth.addPitchFade(eventId, time.getValue(), lastTuning + Message.getNoteNumber()-lastNote, 0); lastTuning = lastTuning + Message.getNoteNumber()-lastNote; } else { if (eventId != -1) Synth.noteOffByEventId(eventId); eventId = Message.makeArtificial(); } retrigger = lastNote; lastNote = Message.getNoteNumber(); } } } function onNoteOff() { if (!bypass.getValue()) { Message.ignoreEvent(true); if (eventId != -1 && Message.getNoteNumber() == lastNote) { if (Synth.isKeyDown(retrigger)) { if(time.getValue() == 0) { Synth.noteOffByEventId(eventId); Synth.addNoteOn(1, retrigger, vel, 0); lastTuning = 0; retriggerHold = retrigger; lastNote = retrigger; retrigger = -2; } else { Synth.addPitchFade(eventId, time.getValue(), 0, 0); lastTuning = 0; lastNote = retrigger; retrigger = -1; }; } else { Synth.noteOffByEventId(eventId); if (retrigger == -2) { Synth.addNoteOff(1, retriggerHold, 0); } eventId = -1; } } if (!Synth.getNumPressedKeys()) { lastNote = -1; lastTuning = 0; } } else if (eventId != -1 && eventId != undefined) { Synth.noteOffByEventId(eventId); eventId = -1; lastNote = -1; lastTuning = 0; } } function onController() { } function onTimer() { } function onControl(number, value) { }
I definitely feel like I overcomplicated things and is not the most efficient way haha
If the note continues playing that makes me think you have a long release time or the sampler is in one shot mode.
Yup, the oneshot mode was the problem, the script still is very buggy and needs work as the retrig pitch shifts an octave lower and whatnot
-
@d-healey scratch that, the retrig thing only works for “one pass through” if you continue “trilling” and let go of all the notes, the retrigger note still continues playing even when no notes are pressed. I had only accounted for one pass through. I was thinking I could make the retrigger note into an eventId, but I couldn’t find a way to do that from the addnoteon function. Is there a way to detect an anchor note (retrigger note) and then play that note when all others are let go except the original retrigger note?
Thanks!
-
@Casmat If you're not using the glide feature just use the hardcoded legato effect (if you turn off one shot mode).
-
This post is deleted! -
@d-healey That's the thing I think I may have to build something from scratch since I'm actually thinking of using a legato that uses the samples position and transfer that position into the samples that are being glided to.