HISE Logo Forum
    • Categories
    • Register
    • Login

    Polyphonic variables

    Scheduled Pinned Locked Moved Scripting
    9 Posts 2 Posters 570 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 d.healey

      I'm trying to improve my breath controller script. It works like this, the user presses a key and blows into their breath controller, when the CC value crosses a threshold a note is played for the key that is held. When the key is released or the CC drops below the threshold the note is killed.

      This I can do no problem.

      Now I'm trying to do it polyphonicaly so that the user can hold any number of keys, and this is where I'm having difficulty. My current attempts have been using a MIDI list to keep track of held notes and a MIDI list to keep track of note IDs. Then in a loop I check every single note to see if it's held or playing (depending on the CC and keydown status).

      The problem I'm having is a) Synth.getNumPressedKeys() is a liar (it actually uses a note on/off counter from what I understand) and b) using a loop in the MIDI callbacks seems like a bad idea.

      Is there an obvious solution that I'm missing?

      Also, what does Synth.addNote() do? I understand it adds a note to the buffer but how would one use this? And how do we determine the timestamp?

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

      Dan KorneffD 1 Reply Last reply Reply Quote 0
      • Dan KorneffD
        Dan Korneff @d.healey
        last edited by

        @d-healey said in Polyphonic variables:

        what does Synth.addNote() do?

        It's hard to tell. From what I read on the JUCE site, the variables are (channel, note, velocity). Not sure what the timestamp is for.

        Dan Korneff - Producer / Mixer / Audio Nerd

        1 Reply Last reply Reply Quote 0
        • Dan KorneffD
          Dan Korneff
          last edited by Dan Korneff

          My first thought is to create an array and use the Push command to send the note numbers to the array, and then use the Pop command on your noteOff to remove them from the array... but I don't think that function exists in HISE.
          @Christoph-Hart is there an equivalent to Pop in HISE that can remove items from an array?

          edit: after readying a little more, pop only removes the last element from an array... so that' not exactly helpful

          Dan Korneff - Producer / Mixer / Audio Nerd

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

            @dustbro That's essentially what I'm doing with MIDI lists. Rather than use push/pop though I'm setting the note to true/false.

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

            Dan KorneffD 1 Reply Last reply Reply Quote 1
            • Dan KorneffD
              Dan Korneff @d.healey
              last edited by

              @d-healey said in Polyphonic variables:

              I'm setting the note to true/false

              And they don't change to False when you release the note? or they continue to play even though they are set to false?
              I still got my training wheels on, so I'm trying to fully understand the problem (and solution) :)

              Dan Korneff - Producer / Mixer / Audio Nerd

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

                @dustbro I'll put a snippet together

                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

                  @Christoph-Hart I just discovered that you can't set a MIDI list entry's value to -1. This seems like a bug.

                  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

                    @dustbro I've solved the issue now I figured out the problem with MIDI lists.

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

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

                      Here's my breath controller script - https://raw.githubusercontent.com/davidhealey/HISE-Scripting-Framework/master/modules/breathControl.js

                      Rather than using a specific CC it has a Level knob that you can control from your main interface whichever way you like. This also avoids the issue of putting loops inside the MIDI callbacks.

                      Unfortunately I haven't been able to make it work with the hardcoded legato script or my own legato script.

                      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

                      16

                      Online

                      1.8k

                      Users

                      12.1k

                      Topics

                      104.9k

                      Posts