HISE Logo Forum
    • Categories
    • Register
    • Login

    Monophonic behaviour ?

    Scheduled Pinned Locked Moved General Questions
    14 Posts 3 Posters 507 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.
    • d.healeyD
      d.healey
      last edited by

      Sounds like you just need a note filter.

      Something like this:

      if (noteB > noteA)
          Message.ignoreEvent(true);
      

      You'll need to handle the setting and unsetting of the two variables in the on note on and on note off callbacks.

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

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

        I see, thanks !

        https://lalalandaudio.com/

        https://lalalandsynth.com/

        https://www.facebook.com/lalalandsynth

        https://www.facebook.com/lalalandsynth

        1 Reply Last reply Reply Quote 0
        • lalalandsynthL
          lalalandsynth @d.healey
          last edited by lalalandsynth

          @d-healey Still struggling with this , I suck at programming !

          I get that I should program it so that is note B is ignored if it is higher then note A.
          But how do I implement that ? How can I ask HISE which note is played first ? I must be missing something here ?

          https://lalalandaudio.com/

          https://lalalandsynth.com/

          https://www.facebook.com/lalalandsynth

          https://www.facebook.com/lalalandsynth

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @lalalandsynth
            last edited by

            @lalalandsynth - us e the note on call back and record the last played note...then compare lastPlayedNote against the current note

            HISE Development for hire.
            www.channelrobot.com

            1 Reply Last reply Reply Quote 2
            • d.healeyD
              d.healey
              last edited by

              Store the last note that was played in a variable.

              So in onNoteOn you'd have something like this

                  if (Message.getNoteNumber() > lastNote)
                      Message.ignoreEvent(true);
              
                  lastNote = Message.getNoteNumber();
              

              You need to declare lastNote as a reg variable in your on init callback. All of this should be in a separate realtime script (not in your interface script which should be deferred).

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              lalalandsynthL 1 Reply Last reply Reply Quote 1
              • lalalandsynthL
                lalalandsynth @d.healey
                last edited by

                @d-healey said in Monophonic behaviour ?:

                All of this should be in a separate realtime script (not in your interface script which should be deferred).

                So to be clear when you say separate realtime script , does that mean just an external script and I point to that in the oninit of the Midiprocessor/scriptprocessor ? What exactly does the word deferred mean ?

                https://lalalandaudio.com/

                https://lalalandsynth.com/

                https://www.facebook.com/lalalandsynth

                https://www.facebook.com/lalalandsynth

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @lalalandsynth
                  last edited by

                  @lalalandsynth

                  does that mean just an external scrip

                  No, it means you add another MIDI processor into your project

                  ? What exactly does the word deferred mean ?

                  Link Preview Image
                  Scripting Best Practices

                  This is a collection of useful tricks which will be extended over time. I divided them into two categories: Interface Design and MIDI Processing. Interface d...

                  favicon

                  Forum (forum.hise.audio)

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  lalalandsynthL 1 Reply Last reply Reply Quote 0
                  • lalalandsynthL
                    lalalandsynth @d.healey
                    last edited by

                    @d-healey ok, I think I understand. In this case I am not using any knobs from the interface script to enable or disable this function. I am assuming that is what the deferred thing is for?

                    https://lalalandaudio.com/

                    https://lalalandsynth.com/

                    https://www.facebook.com/lalalandsynth

                    https://www.facebook.com/lalalandsynth

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • lalalandsynthL
                      lalalandsynth
                      last edited by lalalandsynth

                      @d-healey said in Monophonic behaviour ?:

                      if (Message.getNoteNumber() > lastNote)
                      Message.ignoreEvent(true);

                      lastNote = Message.getNoteNumber();
                      

                      This will only work for the first time , that is , I play and hold one note , then a higher note and it works .
                      But If I hold the first lower note , then play the upper note twice it will play the upper note on the second play.
                      Which makes sense when its only looking at the last note , but not true low note priority .

                      https://lalalandaudio.com/

                      https://lalalandsynth.com/

                      https://www.facebook.com/lalalandsynth

                      https://www.facebook.com/lalalandsynth

                      1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @lalalandsynth
                        last edited by

                        @lalalandsynth You should defer your UI script anyway, unless you have a good reason not to :D

                        But If I hold the first lower note , then play the upper note twice it will play the upper note on the second play

                        Hmm this becomes more complicated because now you need to keep track of all held notes.

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey
                          last edited by

                          I have an idea, let me know if it works

                              if (Message.getNoteNumber() > lastNote)
                                  Message.ignoreEvent(true);
                          
                              if (Message.getNoteNumber() < lastNote)
                                  lastNote = Message.getNoteNumber();
                          

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          lalalandsynthL 1 Reply Last reply Reply Quote 1
                          • lalalandsynthL
                            lalalandsynth @d.healey
                            last edited by lalalandsynth

                            @d-healey said in Monophonic behaviour ?:

                            if (Message.getNoteNumber() > lastNote)
                            Message.ignoreEvent(true);

                            if (Message.getNoteNumber() < lastNote)
                                lastNote = Message.getNoteNumber();
                            

                            No, I get no notes like that .

                            Also the first version does not take into account whether the note is held , so if I play a lower note, let go of it , it will not play an upper note until the second time I play it. So basically if I play from C1 to C2 I have to play each note twice to hear it.

                            What it should do is ignore an upper note only if an lower note is held .

                            https://lalalandaudio.com/

                            https://lalalandsynth.com/

                            https://www.facebook.com/lalalandsynth

                            https://www.facebook.com/lalalandsynth

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @lalalandsynth
                              last edited by

                              @lalalandsynth With my previous example try intializing lastNote to 128 (probably still won't work but worth a try).

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public HISE tutorials

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

                              33

                              Online

                              1.7k

                              Users

                              11.8k

                              Topics

                              102.7k

                              Posts