HISE Logo Forum
    • Categories
    • Register
    • Login

    Issue creating true monophonic behavior

    Scheduled Pinned Locked Moved Scripting
    33 Posts 5 Posters 2.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Casey KolbC
      Casey Kolb
      last edited by Casey Kolb

      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? 🤔

      G 1 Reply Last reply Reply Quote 0
      • lalalandsynthL
        lalalandsynth
        last edited by lalalandsynth

        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.

        https://lalalandaudio.com/

        https://lalalandsynth.com/

        https://www.facebook.com/lalalandsynth

        https://www.facebook.com/lalalandsynth

        1 Reply Last reply Reply Quote 1
        • Casey KolbC
          Casey Kolb
          last edited by

          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.

          lalalandsynthL 1 Reply Last reply Reply Quote 0
          • lalalandsynthL
            lalalandsynth @Casey Kolb
            last edited by

            @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 . :)

            https://lalalandaudio.com/

            https://lalalandsynth.com/

            https://www.facebook.com/lalalandsynth

            https://www.facebook.com/lalalandsynth

            1 Reply Last reply Reply Quote 1
            • Casey KolbC
              Casey Kolb
              last edited by

              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.

              lalalandsynthL 1 Reply Last reply Reply Quote 1
              • lalalandsynthL
                lalalandsynth @Casey Kolb
                last edited by

                @Lunacy-Audio Yes, a lot of the basic stuff is not really working.

                https://lalalandaudio.com/

                https://lalalandsynth.com/

                https://www.facebook.com/lalalandsynth

                https://www.facebook.com/lalalandsynth

                1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart
                  last edited by

                  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?

                  1 Reply Last reply Reply Quote 0
                  • Casey KolbC
                    Casey Kolb
                    last edited by

                    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);
                    
                    1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart
                      last edited by Christoph Hart

                      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.

                      1 Reply Last reply Reply Quote 1
                      • Casey KolbC
                        Casey Kolb
                        last edited by Casey Kolb

                        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
                        
                        1 Reply Last reply Reply Quote 0
                        • Casey KolbC
                          Casey Kolb
                          last edited by

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • Casey KolbC
                            Casey Kolb
                            last edited by

                            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);
                            
                            1 Reply Last reply Reply Quote 0
                            • Christoph HartC
                              Christoph Hart
                              last edited by

                              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 :)

                              lalalandsynthL Casey KolbC 2 Replies Last reply Reply Quote 1
                              • lalalandsynthL
                                lalalandsynth @Christoph Hart
                                last edited by lalalandsynth

                                @Christoph-Hart

                                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 ?

                                https://lalalandaudio.com/

                                https://lalalandsynth.com/

                                https://www.facebook.com/lalalandsynth

                                https://www.facebook.com/lalalandsynth

                                1 Reply Last reply Reply Quote 0
                                • Christoph HartC
                                  Christoph Hart
                                  last edited by

                                  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 :)

                                  lalalandsynthL 1 Reply Last reply Reply Quote 0
                                  • lalalandsynthL
                                    lalalandsynth @Christoph Hart
                                    last edited by

                                    @Christoph-Hart

                                    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.

                                    https://lalalandaudio.com/

                                    https://lalalandsynth.com/

                                    https://www.facebook.com/lalalandsynth

                                    https://www.facebook.com/lalalandsynth

                                    1 Reply Last reply Reply Quote 0
                                    • Christoph HartC
                                      Christoph Hart
                                      last edited by

                                      Ah I see, yeah, in that case you need to script something, shouldn't be too hard though...

                                      lalalandsynthL 1 Reply Last reply Reply Quote 1
                                      • lalalandsynthL
                                        lalalandsynth @Christoph Hart
                                        last edited by lalalandsynth

                                        @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 ?

                                        https://lalalandaudio.com/

                                        https://lalalandsynth.com/

                                        https://www.facebook.com/lalalandsynth

                                        https://www.facebook.com/lalalandsynth

                                        Christoph HartC 1 Reply Last reply Reply Quote 1
                                        • Casey KolbC
                                          Casey Kolb @Christoph Hart
                                          last edited by

                                          This post is deleted!
                                          1 Reply Last reply Reply Quote 0
                                          • Casey KolbC
                                            Casey Kolb
                                            last edited by

                                            @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 😂

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            22

                                            Online

                                            1.7k

                                            Users

                                            11.9k

                                            Topics

                                            103.4k

                                            Posts