HISE Logo Forum
    • Categories
    • Register
    • Login

    How do you access Scriptnode Synth voices?

    Scheduled Pinned Locked Moved Scripting
    8 Posts 2 Posters 135 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.
    • MorphoiceM
      Morphoice
      last edited by

      What's the proper way to access voices of a scriptnode synthesizer in script?
      I'm looking for a way to e.g. detune a particular voice as if a voice board was damaged or send LFO and bend information to a particular voice... I recon there must be some sort of list or array that let's me get the playing voices. I'm using custom faust oscillators in a hardcoded fx, so basically looking for a way to access a certain voices parameters, not all at once

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

        @Morphoice You can store the node ID in a global and access it using the Message class in the code portion of a script voice start modulator (the code editor, not the scriptnode network).

        You can use event data and access that, which also lets you access that data inside of Scriptnode.

        In any case, you want a return of 0-1, where for bipolar mods 0.5 is the neutral position.

        MorphoiceM 1 Reply Last reply Reply Quote 1
        • MorphoiceM
          Morphoice @aaronventure
          last edited by

          @aaronventure nothing I've ever done before, but I'll fight my way through it. If you know of any examples that showcase this please let me know. I can't find anything in the docs

          MorphoiceM A 2 Replies Last reply Reply Quote 0
          • MorphoiceM
            Morphoice @Morphoice
            last edited by Morphoice

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • A
              aaronventure @Morphoice
              last edited by

              @Morphoice

              1. store your note id into a global. declare this global in on init, if you're using multiple notes, you can make the global an array
              global noteIds = [];
              

              and then store note ids into indexes by note number

              nodeIds[noteNum] = playNote; 
              
              // or just pull in the event node if you're not handling note playback yourself
              
              1. You have two ways of modulating individual events using their IDs
                × Voice start script modulator - is applied at the start of the note. You can write the code and just have to return a value 0-1
              function onVoiceStart(voiceIndex)
              {
                     // perhaps you have per note pitch changes done via the UI, and you're storing this into another global array
                    // you can set a condition so that only the notes that you stored into the noteIds array get this modulation applied. This way if you have other notes firing (for complex samplemaps etc.) you can selectively apply the voice start modulation via code
                     if (Message.getEventId() == noteIds[Message.getNoteNumber()])
              	    return notePitchMod[Message.getNoteNumber()];
              
                 × Envelope script modulator
              

              In both cases, you can also use ScriptNode, making sure that the network output is also 0-1 (with 0.5 being the neutral/midpoint). In that case, when playing notes and/or storing IDs, you would be using the event data method, and then using the event data nodes to get that data individually for each event. In this case, you can modulate it in realtime. Check the snippets (or the snippet waiting room if it hasn't been merged yet) where I posted an example for this.

              MorphoiceM 1 Reply Last reply Reply Quote 1
              • MorphoiceM
                Morphoice @aaronventure
                last edited by

                @aaronventure awesome thank you!
                I'm trying to decide whether it makes sense to put my LFO's inside the faust oscillator, as faust offers the most flexible LFO shapes for my need, and I can get up to FM modulation levels with the LFO speed, or if it makes more sense having a global LFO generator in an extra ScriptFX and distributing it's modulation in the way you described... I wouldn't need individual LFO's on all notes so that probably makes more sense, but there is the issue of aftertouch and velocity sensitivity that requires the lfo to be applied accordingly to each note

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

                  @Morphoice if you don't need polyphonic modulation, just use the Time Variant modulator. That one is monophonic.

                  MorphoiceM 1 Reply Last reply Reply Quote 0
                  • MorphoiceM
                    Morphoice @aaronventure
                    last edited by Morphoice

                    @aaronventure just the amount applied needs to be "polyphonic", not the type of modulation itself
                    but I could do that with an "intensity" pma node inside the oscillator network where I already have the velocity information

                    I also have a hardcoded LFO in the faust oscillator but it's not time synced among all notes of course. that might be a benefit considering playability and sound design capability

                    I guess the CPU overhead of running seperate LFO oscillators on each voice is superficial

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

                    37

                    Online

                    1.7k

                    Users

                    11.7k

                    Topics

                    102.0k

                    Posts