Issue creating true monophonic behavior
-
Hey guys,
I have a midi processing conundrum regarding monophonic behavior. I'm trying to replicate the real monophonic behavior of a synth (the way Kontakt allows) where pressing a new note will immediately fade out the previous note regardless of the release time.
This is surprisingly tricky in HISE because the instant you call something like
Synth.noteOffByEventId(eventIds[note]);
it will remove the internal HISE event id from the event id array, making it no longer accessible for further processing. In other words, if I send a noteOff and that voice starts an 8 second release time, there's no way to immediately fade out that voice during this release period if I play another note. This would be the expected behavior of a monophonic synth but I haven't found a way to achieve this in HISE. It seems like you only get one chance at removing a note and once you've sent that API call, you can't alter that voice again.@d-healey I've looked through all of your example MIDI scripts and perhaps I'm missing something obvious, but I haven't seen an example of the behavior I'm describing. Any ideas?
-
If I understand correctly , this would be monophonic envelopes.
As it stands this seems to be impossible in HISE.
As far as I can tell?You can put a monophonic envelope on top of a polyphonic one but that will only give you some sort of weird triggering behaviour that resembles the Single&Multi on a Korg Delta.
If you have a mono on top of a poly and play a chord with release , the next note played will trigger that release tail and you will hear the chord tail as well as the new note.
Strange.
-
Ah I see. Wow, that's pretty rough. Some of my test users have already complained that they can't do real monophonic behavior with my plugin. There are so many classic examples of sample libraries where this is essential – even small but super popular Kontakt libraries like "808 Warfare" have this. Otherwise, you literally can't make bass patches lol.
I was hoping it would be possible to achieve via scripting in the midi processing, but maybe it's not.
-
@Lunacy-Audio Its essential for pretty much any synth emulation.
Very few analog synths have poly envelopes.All my projects are on hold at the moment until this is resolved . :)
-
Oof, I feel you. It feels like these things should be resolved before any more experimental features are added. So many gaping holes that are preventing this from being a true Kontakt competitor unfortunately.
-
@Lunacy-Audio Yes, a lot of the basic stuff is not really working.
-
You can just set the voice amount to 1 (Soft limit if it's a sampler) and then you have exactly the behaviour you need, no?
-
WHOA! Yes, that seems to do the trick. I hadn't even considered that. Thank you Christoph.
Quick note: It automatically sets my voice limit to 2 when I play a note, but it still seems to be the right functionality, so maybe this doesn't matter?
From a scripting perspective, I'm assuming I can just do something like this when monophonic is enabled? Need to test that this works.
sampler.setAttribute(6, isMonophonic ? 1 : 128);
-
Yup, the voice limit is a parameter like anything else. I don't notice the 2 voices glitch, but I'll check it. You are using a sampler, right?
EDIT: Just checked again, and it does it here too. I'll sort it out.
-
Functionally it seems to be working fine despite the 2 voices glitch.
However, setting attribute 6 for the sampler seems to be changing the Voice Amount rather than the Soft Limit. Not sure if this matters, but is there a way to access the Soft Limit from the script?
HiseSnippet 1241.3oc4X0saaaCElxNpH1stnsnWraFfPvtvAnKvtMIsXCCQwNIEAqIwvJqaX2zwHQaSDIRAJpz5UTf8Drmk8HrGo9FrcHkjEkqWlqW25vluxme424GdNzdff6SRR3BjUiymFSPV2x1aJSNo+DLkgN9.j051CDjDhD0aZLNIgDfrrp+TkTqFqgzed6d8vgXlOojEB8bN0m7LZDUVxcf6WSCCOBGPNmFYn81tG6yY84g7T.I0s6fhw9WhGSNEqTqlMx5FGFPkbgmDKIIHq05wCl5Mg+RVl9OmlPuHjnH5h7.Gkw9HdXfBwpui5OgFFLnHhSPHK6Akwe8r3+91mPCny3WlGtiVfSoEl4CqZWG75thvyx.dqkAu6Z64KnwxRIJrcS6iYRhXDFJAlvJSWTs6TytOGzfI2JBeI4HAPLyh161oyCb1oSmM+xVMa0DJDIRmqvBGObTbHQz04qbz8DaMlH0fTS0diB4aLugP2ht5ueDOkIAyKNbkC3QwbFPzdippk6kVMorPJi3LJk4KoblC31JJpblfG11uvSO.NzvTxlsZ95VMcfOE.aKvv8kRA8hTIDl454rmSWmuvo6Ceh5Dei9TWN.p7W9o2GGFdAzi19O.cYAiQLbJWRNi0dylutYiluooy7hFMZgxxcGDMKTr5Zj35LrMKM5BhnHEUnHzOUsg8lKWCqeVdxPQN6XFUdVLImtrkVIKKpKj1AMKXMYUFilb0g1BTqj06diAkWGU2cxUGTUpu4b67aN8RkRNCQCTWoqV6P5jj4PLz2b7AXItvefqgiKlHjTURy5.xUfwY2LaXe.I4RIOVqadODL2Z4O8WM6j+ou2c5LB2u08kz.4DXbk0OCzSHzwSjJp95YpuyLBXREOHMDKqN9RMyNW.zhTYNgZV.KgJmZNS+8XlVmENSq6hpPKIbuq8.pzexhwasEfWnD82Mdy2Pzx9vQiH9xRvtl8Qe2ptNX0fxmlAk6Y6IEDbDkMNelmFOMsKl.9gXoMZoWZCOTHjiC7n+ngZ+pauTHeIpx8WbM67mw9GbyQ9PRLAKgxugMq6Nb3SE7z34s5s6oaVNW.CjgTgofyXDHuaFMn9BdRxHHbz9JwTzfTwXUtpjyPxUDQRUdmlFA0dFiDlntEZoFSjPT0Zp+IXXcyqL0VeJcNGqq2vKYzzcmi9gyQ+n4n2dN5clid24nebIcVB8DbrpyP8Rp4l7u9xM4Gbv.LDxFZ1iNdlyy3TcDigpyx4ZbY7tMOhTBkrDCcWvCgtwGg2o8gel1e8Qv0WN39m7TxFEXzippdGxtBt1BbTX7dvVrQ3zPYA2piPNgy3wS3Lpe0KIPS+3wDgI1WX.AuFCtiVx49tCIgDbhws7Oy8Yvy+vhp28euxEcW9bw0Uu9D6L35nl647eiUm0+e+pyqK0c67EmNvoKj+KuNeKa8ndG0l4OVPcHOUM9tXqmMrZzCdNfOwbAYM0R2L5NJZEf7Hr.MwuAexE1sXapRX2BgH+BWAwV920uI2pNgo1lneQXHrmNzrkNAdzgBRvFu+QPYD1Wvege1O5Pg000b.Txz+GFMrOQQ6zs3GYXa2YqNnHXW0K78UWD9bHCuXad3JXyiVAa1dErYmUvlcWAad7JXyStVaTOSX+TIOJaHIvXvgYMVVGNqwpN52oP4dnK
-
This post is deleted! -
Ignore me – the solution was just to set it this way. In my particular case I need to set the VoiceLimit to closer to 5 or 6 to avoid pops and clicks in my plugin, but overall the monophonic functionality is what I'm after so thank you!
sampler.setAttribute(sampler.VoiceLimit, value ? 1 : 128); sampler.setAttribute(sampler.VoiceAmount, value ? 1 : 128);
-
Don't change the voice amount, but only the voice limit:
const var NUM_POLY_VOICES = 128; const var b = Content.addButton("b", 0, 0); const var Sampler1 = Synth.getChildSynth("Sampler1"); inline function bc(c, v) { Sampler1.setAttribute(Sampler1.VoiceLimit, v ? 2 : NUM_POLY_VOICES ); } b.setControlCallback(bc);
If you also change the voice amount, it will reallocate the voices, this might lead to problems when you use it in a realtime context (if you want to switch between monophonic and polyphonic during playback for any reason).
Also the number 2 isn't a glitch: it tells the sampler at which point to start killing voices, so two means "as soon as two are active, fade out the oldest voice". 1 isn't a valid number here (because it would always kills notes then), that's why it updates it to the minimum amount. It's a bit misleading though :)
-
Nice ! This seems to work somewhat for a monophonic sound (bass) although you do need the legato as well (for an analog bass synth emulation) , and for that to work in a predictable way it would need to be able to set the low or high note priority , guess that could be scripted though.
Is there some other way to achieve monophonic envelope (paraphonic) behaviour for polyphonic sounds, something I have missed ? I played with the monophonic envelopes but never got it to work properly ?
-
guess that could be scripted though.
you mean if you release the latest note while holding an older note, it should replay the older note? Just slap a Legato with retrigger module in there and you're done :)
-
I am using the legato module but that does not work in a low or high note priority manner.
Low note priority should only allow notes lower then the initial note to be played, high note the opposite.
This is the way most analog synths work , for most synths its needed and in some instances essential.For example if you have a bass section that is monophonic included in a poly section , like some string synths.
Then you can play a chord on the "lower" section of the keyboard )which includes the mono bass) and the bass will only play the "root note/lowest note"Also needed for monophonic leads.
-
Ah I see, yeah, in that case you need to script something, shouldn't be too hard though...
-
@Christoph-Hart
Ok.Is it reasonable to expect an update where you can make paraphonic behaviour ?
That is , a poly synth with monophonic envelopes ?I am willing to wait if needed , but would love to know if I am wasting my time preparing all these string and bass synths that need that functionality or if in fact I am just missing how to achieve that ?
-
This post is deleted! -
@Christoph-Hart said in Issue creating true monophonic behavior:
Don't change the voice amount, but only the voice limit:
@Christoph-Hart Yup quickly figured this out. Only changing Voice Limit now