HISE Logo Forum
    • Categories
    • Register
    • Login

    How do you query the voice number?

    Scheduled Pinned Locked Moved Solved Scripting
    6 Posts 2 Posters 139 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.
    • griffinboyG
      griffinboy
      last edited by

      b0527649-9912-42ad-a2bf-834d228dcc00-image.png

      It doesn't seem to be part of event data. Is there any way to get the voice number to do voice specific processing? I want to use the voice number to send event data to specific voices.

      function onNoteOn()
      {
      	Message.ignoreEvent(true);
      	
      	// I'd like to be able to get hold of the voice number to link the detune knobs via voice
      
      	Event.noteIds[Message.getNoteNumber()][0] = Synth.playNote(Message.getNoteNumber(), Message.getVelocity());
      //	Event.noteIds[Message.getNoteNumber()][1] = Synth.playNote(Message.getNoteNumber(), Message.getVelocity());
      	
      	globalRouting.setEventData(Event.noteIds[Message.getNoteNumber()][0], 0, ControlValue.detune1);
      //	globalRouting.setEventData(Event.noteIds[Message.getNoteNumber()][1], 0, ControlValue.detune2);
      	
      }
      
      

      An example @aaronventure wrote for me a while back (now in the snippet browser) exemplified how to create multiple notes from the same voice and detune them differently, but I'm not sure how to do this kind of thing across voices as well! I'm not very good with events yet.

      A 1 Reply Last reply Reply Quote 0
      • A
        aaronventure @griffinboy
        last edited by

        @griffinboy you send data to specific voices using event is

        griffinboyG 1 Reply Last reply Reply Quote 0
        • griffinboyG
          griffinboy @aaronventure
          last edited by

          @aaronventure

          Thanks and sorry: event is? I can't see that in the API

          A 1 Reply Last reply Reply Quote 0
          • A
            aaronventure @griffinboy
            last edited by

            @griffinboy sorry, event ID.

            griffinboyG 1 Reply Last reply Reply Quote 0
            • griffinboyG
              griffinboy @aaronventure
              last edited by

              @aaronventure

              Ah, but event ID increments. So I assume you're saying that I have to keep track and figure out which voices are which at a particular time?

              I need to be able to, for instance, say detune voice two up an octave. When I press and hold three notes on the keyboard, voice 1 2 and 3 are now active. When I release the note that voice 2 was playing, and play a new note, this new note is using voice two as voice 1 and 3 are active. And therefore should inherit voice 2 detune.

              I just want to make sure there isn't already a way to do what I'm needing. Thanks for your responses

              A 1 Reply Last reply Reply Quote 0
              • A
                aaronventure @griffinboy
                last edited by

                @griffinboy you should set your fictional voice count, assign ids to array indexes and remove them when releasing notes. Then you can check along the array to fill the first empty index with a new od and set event data based on the index.

                Your event data for individual voices is in another array, obviously, all ordered by voice order.

                1 Reply Last reply Reply Quote 1
                • griffinboyG griffinboy marked this topic as a question on
                • griffinboyG griffinboy marked this topic as a regular topic on
                • griffinboyG griffinboy marked this topic as a question on
                • griffinboyG griffinboy has marked this topic as solved on
                • First post
                  Last post

                56

                Online

                1.7k

                Users

                11.7k

                Topics

                101.8k

                Posts