How to add Portamento
-
Hello, my apologies, I am aware there are many forum posts on this topic but they are not helping me achieve portamento.
I already copied and pasted the following script from Github and it is not working for me.I don't know what to put in the property editor under processor id for each of these sliders either.
Can I get some help?reg note = -1; reg noteId = -1; reg origin = -1; reg target = -1; // Last note of the run reg velocity; // Velocity of the target note reg rate; // Tempo - taken from the host - to play the glide at reg interval; // Get all child sample start constant modulators const var modulatorNames = Synth.getIdList("Constant"); // Get child constant modulator names const var startModulators = []; // For offsetting sample start position for (modName in modulatorNames) { if (Engine.matchesRegex(modName, "(?=.*ample)(?=.*tart)")) { startModulators.push(Synth.getModulator(modName)); } } // GUI Content.setWidth(650); Content.setHeight(100); const var btnMute = Content.addButton("btnMute", 0, 10); btnMute.set("text", "Mute"); const var knbOffset = Content.addKnob("knbOffset", 150, 0); knbOffset.setRange(0, 1, 0.01); knbOffset.set("text", "Offset"); const var knbRate = Content.addKnob("knbRate", 300, 0); knbRate.set("mode", "TempoSync"); knbRate.set("text", "Rate"); knbRate.set("max", 11); const var btnWholeStep = Content.addButton("btnWholeStep", 450, 10); btnWholeStep.set("text", "Whole Step"); const var knbMinInt = Content.addKnob("knbMinInt", 0, 50); knbMinInt.setRange(1, 24, 1); knbMinInt.set("text", "Min Interval"); knbMinInt.set("suffix", "st"); const var knbMaxInt = Content.addKnob("knbMaxInt", 150, 50); knbMaxInt.setRange(1, 36, 1); knbMaxInt.set("text", "Max Interval"); knbMaxInt.set("suffix", "st"); const var knbBendAmount = Content.addKnob("knbBendAmount", 300, 50); knbBendAmount.setRange(0, 100, 1); knbBendAmount.set("text", "Bend Amount"); knbBendAmount.set("suffix", "Ct"); inline function getRate(range, velocity) { local rateValue = knbRate.getValue(); // Get rate knob value // If rate knob is set to the maximum then the actual rate will be determined by velocity if (rateValue == knbRate.get("max")) { rateValue = Math.floor((velocity / (knbRate.get("max") - 1))); if (rateValue > knbRate.get("max")) rateValue = knbRate.get("max") - 1; // Cap rate at max rate } rateValue = (Engine.getMilliSecondsForTempo(rateValue) / 1000) / range; // Get rate based on host tempo and selected knob value if (rateValue < 0.04) rateValue = 0.04; // Cap lowest rate at timer's minimum return rateValue; } inline function setOffsetIntensity(value) { if (startModulators.length > 0) { for (mod in startModulators) { mod.setIntensity(value); } } } function onNoteOn() { if (!btnMute.getValue()) { Synth.stopTimer(); Message.ignoreEvent(true); if (origin != -1) interval = Math.abs(origin - Message.getNoteNumber()); // Calculate interval // In interval range or no note played yet if ((interval >= knbMinInt.getValue() && interval <= knbMaxInt.getValue()) || noteId == -1) { if (noteId != -1 && origin != -1) { setOffsetIntensity(knbOffset.getValue()); note = origin; target = Message.getNoteNumber(); velocity = Message.getVelocity(); rate = getRate(Math.abs(origin - target), velocity); Synth.startTimer(rate); } else if (origin == -1) // Origin has not yet been played { setOffsetIntensity(1); origin = Message.getNoteNumber(); noteId = Synth.playNote(origin, Message.getVelocity()); // Play first note } } } } function onNoteOff() { if (!btnMute.getValue()) { if (Message.getNoteNumber() == origin || Message.getNoteNumber() == target) { Message.ignoreEvent(true); if (Message.getNoteNumber() == target) // Target released { Synth.stopTimer(); if (noteId != -1) Synth.noteOffByEventId(noteId); origin = -1; noteId = -1; target = -1; } if (!Synth.isKeyDown(origin) && !Synth.isKeyDown(target) && noteId != -1) // Both keys have been lifted { Synth.stopTimer(); Synth.noteOffByEventId(noteId); noteId = -1; origin = -1; target = -1; } } } else { // Turn off hanging note, if any if (noteId != -1) { Synth.noteOffByEventId(noteId); noteId = -1; origin = -1; target = -1; setOffsetIntensity(1); // Reset sample start offset } } } function onController() { } function onTimer() { if (!btnMute.getValue()) { target > origin ? note++ : note--; // Increment/decrement the note number by 1 (a half step) // If the whole step button is enabled then increment/decrement the note by another half step if (btnWholeStep.getValue()) { target > origin ? note++ : note--; } if (noteId != -1 && origin != -1 && ((target > origin && note <= target) || (target < origin && note >= target))) { local bendAmount = knbBendAmount.getValue(); if (origin > target) bendAmount = -bendAmount; // Debug messages to verify note and pitch transitions Console.print("Playing note: " + note); Console.print("Applying pitch fade to: " + bendAmount); Synth.addVolumeFade(noteId, rate * 1000, -100); // Fade out old note Synth.addPitchFade(noteId, rate * 1000, 0, bendAmount); // Pitch fade old note to bend amount noteId = Synth.playNote(note, velocity); // Play new note and store its ID Synth.addVolumeFade(noteId, 0, -99); // Set new note's initial volume Synth.addVolumeFade(noteId, rate * 1000, 0); // Fade in new note Synth.addPitchFade(noteId, 0, 0, -bendAmount); // Set new note's initial detuning Synth.addPitchFade(noteId, rate * 1000, 0, 0); // Pitch fade new note to 0 } else { origin = target; note = target; Synth.stopTimer(); } } } function onControl(number, value) { switch (number) { case btnMute: origin = -1; target = -1; Synth.stopTimer(); setOffsetIntensity(1); break; case knbRate: // If timer's already started then update its Rate if (Synth.isTimerRunning() == 1) { rate = getRate(Math.abs(origin - target), velocity); Synth.startTimer(rate); } knbRate.set("text", "Rate"); // Default if (knbRate.getValue() == knbRate.get("max")) { knbRate.set("text", "Velocity"); } break; } }
-
@weezycarter said in How to add Portamento:
Hello, my apologies, I am aware there are many forum posts on this topic but they are not helping me achieve portamento.
I already copied and pasted the following script from Github and it is not working for me.Where did you copy/paste this to?
I don't know what to put in the property editor under processor id for each of these sliders either.
You dont need to use the property editor here I think. You just need to set up you own MIDI script processor for this...
-
Do you want portamento for the sampler or for a synth? This script is playing a "scale" while repitching the samples so it's most useful for sample libraries.
An example for a synth portamento / glide can be found here:
https://docs.hise.dev/tutorials/midi/index.html#monophonic-glide-script
-
@Christoph-Hart I have a sampler and a waveform generator. I want the portamento to control the glide of both the sampler and waveform generator.
-
@Christoph-Hart said in How to add Portamento:
https://docs.hise.dev/tutorials/midi/index.html#monophonic-glide-script
In the link you provided it gives this script
HiseSnippet 2637.3oc2Y01aabbDlzRrnjoMHtHnnebqQgMkgBkTZhaQLbikkkLXajrfobb6mLVd2djazc6d816DEag+I0+K8mR9Gz9LyduQIZGWglhjZD3vaucdYm4Ydl4VeZlMP4b1rNc6e1xTUmt+rdSVZxmevbo1zY7S6z8C6crzkqxD9kdxxToyoB6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toB96toB96+tEjZBseQt0eK+XCGe5g7Lkc6dnQBTNWQz4eCA4n0V
Where do I paste the script to, just put it in the code editor?
-
@Christoph-Hart Ok So I selected Import HISE snippet from the file menu, but it opens a new blank project with portamento instead of adding portamento to my existing project. How do I add portamento to my existing project?
-
@Lindon When I choose midi processor then choose script processor, it erases my interface.
-
@weezycarter said in How to add Portamento:
@Lindon When I choose midi processor then choose script processor, it erases my interface.
no it doesn't - it creates a script processor and take s you its interface, your interface will be in the list just above it - named Interface. Like this:
-
@Christoph-Hart I’ve been having issues with the monophonic glide script in my latest project…I noted in this post last week with no replies…I also posted a video showing the issues
https://forum.hise.audio/topic/9803/monophonic-glide-script-weirdness?_=1718098651616 -
@Lindon Right it takes me to the script processor interface and no matter what button I click in the view menu it won't take me back to my original interface where I designed the plugin. I can only see the interface of my plugin if I hit the home button above the interface designer. But my interface designer no longer shows my plugin interface
-
-
@weezycarter It sounds like you are still working from the HISE Snippet, which is why you can't see your original project. The Script Processor sets up its own interface instance for you to use. You can toggle between that and the Interface with the green boxes in the Module Tree:
As Lindon suggested, you need to start from your original project, add in a Script Processor, and paste the code there. You'll also want to do more research on the HISE environment before adding modules and implementing scripts, but here is a bit more info on the topic: https://docs.hise.dev/hise-modules/midi-processors/list/scriptprocessor.html
Also @johnmike Only experienced some of the issues you mentioned in your previous post.
The maximum octave range (currently at 3 octaves) can be reset here:
knbMaxInt.setRange(1, 36, 1);
, the problem of it breaking when you are playing fast is probably related to the timer not updating fast enough, so you will have to go in the code and see if you can increase it. I also didn't experience hanging notesAlso the "wormy-ness" you were describing sounds to me like you are referring to the nature of the code, not much you can really do about it since it sounds to me like a pitch shifting algorithm.
-
@HISEnberg Thank you, I put my original code in the script processor and these knobs popped up but they're unresponsive.
-
@HISEnberg I've actually tried out a bunch of different Hise snippets and they all work when I import the hise snippets by themselves but when I try to copy the code into a script editor into my project it will show me some knobs but the knobs are unresponsive.
-
@weezycarter said in How to add Portamento:
it will show me some knobs but the knobs are unresponsive.
What do you mean by unresponsive.
It's also likely that the script is not all you need. Looking at your screenshot above I can see the script is expecting to find a child constant modulator, I would assume that without it the script won't work properly. You'll need to copy the structure that is being used in the snippet across to your project.
-
@d-healey I'm trying to utilize this snippet
HiseSnippet 1923.3oc6Zs0baabEdAkVEQYYGKGOo8QL5gNTMpbHkyk1zIiotP4pZSaVQEkjWRxZfkj6HfcgAVnH1NcFO8o9V9Ik7Snyj+H9gL801yhEf.fDhBFwIyDYiwiGsmcOm86bN6kC9.66KrnAABejQ8Sl3QQFqiGLgKGu+XBiiN5.jwsvOvgYS6dAw0ygh1ahGIHfZiLLV5ApwXTeYTzyKt+dDGB2hlJBgNUvrnOh4xjoR624gLGmCI1zSXtYF8624HKAeegiHDvyR3VHOh0YjQzGSTCqFFYrRWalT3OPRjz.jwx6IrmLXr3a35weJKf8T.jPi1nAfgzhOT3XqPr5uQ6Ol4X2OwuCPHCb+znvR5nvcw8X1roxSiF2NpCyTMxFOLpsH30thvqVF3srFdafGX4y7jo8nv1MvGwkT+gDq7oI8XQ098F38EvH3xltjynG5CMlpQiOrUqsMg+aq+7ZqAog.oYTd27SLiVPzbDUlKlzXyn92DFud3m3S3Adh.p+BzIcPJEGFxsjLA2TverPReBuwVq8OVq9Z+y0LmsqgCKrOkC4Kbbn9E1sZAl+hTrAOz8oT+sMOm3DRmNPHRmOUtR4RkV53alAJ3GwYxm3QiamlraWPxFEmffz9xwHDFpLJoeq3j9.UX2GwrUY7nbPz1nHGX5lom+EcPkv.2TafccEgvjl2DHz2iJEFllSmy.nK0.6EJkBdjAtEdWeutbBDN2Sxm0Fu39nO8nCHRBDRLhiNPDyi5KYpDiwAzygiXz6KpiOfFblT3EE9b8DbUrz3lkJ.dQVfOIaiugYKGmJ3K6LlxFMNyIZG0wUXCyvJ3HK4RRs0+9G5DHodCX+8bNUP3vgLXTXroa.xkYa6P6KBXpUmSGWmusiWxhii.z9VZzBGK5CmHBabUBWAKUyIpT9a97cJJeNoyKsGm8r+FeeVeF0nPe9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UgXEM1Fwjlq+iKmO6B4EdF5xySMdVh0W.+mEELh.1+JKvJlVZEBW4G+e5GMZVY8hnl9MUD85XEQ2RCkafG.WcFcpWDPd2n1leF4bp4CnPYQpf5NKnzn+yq9RizLPl94MxX3DV8BxJ7SCnG5Se1wprbV46KH9E10Kt+gfSVnNCHxP+nkKwechrKOlojskJ2ItETGzx+pqLsbePGckyYDjERy94cVv9qJG.+k6HqkJ29tqHHVOAiCXpeuIc4mCEBARTX7NvETCIgNxDo42s0SvEdiEblU1H4wToOazHpeVrWnCsqTpXZZpj614X387IY1VY90cdDrcf32K5VoJEKZW9XwhxW+VrFtlpiHLudbUyRuddUywhPIiOpGAVnpJYQ8M+fS3snwr5Dnpdol5TZc6VIUyLfxsiZnpaIty1Ie0FUmsS57Zyb3Rr7EekkthX09kUij.wVdzORr53dp1lsmmNK0Kl7UVV4M0bJtSUU7dUUw2upJ9AUUwOrpJ9QUUw+3Uqn5p6cCkBW8wBHTu9cidyECijeYAvNPz+2dD5Kt
It works perfectly when I open the snippet on its own. But when I copy the code from the snippet code editor and script processor over to my project the knobs suddenly don't respond. I've looked everywhere in that snippet for code I can copy over and I've copied the code over with no results.
-
@d-healey And what I mean by unresponsive is that when I import the snippet to Hise I hear a pitch bend, but when I copy the script over to my project there is no bend
-
@weezycarter That snippet you just posted, is that the same as the one you showed in the image above? I don't see that script in that snippet.
-
@d-healey The snippet has different code than my original post.
I'm starting fresh with that snippet because it has less knobs. It is responsive when I import it to Hise but copying all the code over from the snippet to my project doesn't work. -
@weezycarter said in How to add Portamento:
but copying all the code over from the snippet to my project doesn't work.
How are you copying it?