HISE Logo Forum
    • Categories
    • Register
    • Login

    multi-callback ScriptProcessor portamento script (combined Delta Time + Velocity glide)

    Scheduled Pinned Locked Moved Presets / Scripts / Ideas
    4 Posts 2 Posters 58 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.
    • K
      keysounds
      last edited by

      Hi everyone,

      I’m working on a custom portamento / legato engine inside a ScriptProcessor in HISE (version 4.1.0, commit a8bcc642). I need to implement a combined portamento behavior similar to SWAM / Oriental Solo engines:
      • Glide time depends on Delta-Time between two legato notes
      • Glide time also depends on note velocity
      • When the last pressed note is released, it performs a backward glide to the previously held note
      • Everything must run in multi-callback mode (separate tabs: onInit, onNoteOn, onNoteOff, etc.)

      The issue is not with the logic itself, but with getting the code to work correctly as a multi-callback ScriptProcessor. Whenever I test or import my script, HISE expects the callbacks to be split across tabs, but my code becomes merged or creates syntax errors like:

      Cannot assign to this expression
      const var declaration must be on global level
      Unexpected token after '}'

      I understand the following:
      • const and var must be defined at global level (Interface tab)
      • reg variables may be used inside onInit
      • In multi-callback mode, callbacks must not contain nested function onNoteOn() declarations
      • Clipboard export merges all callbacks into one block, which does not work for multi-callback mode
      • HISE 4.1.0 does not support “Paste Snippet”; it only supports Import Snippet (.xml)

      What I am requesting

      Could someone please create a working HISE Snippet (.xml) that contains a ScriptProcessor with full multi-callback structure:
      • onInit
      • onNoteOn
      • onNoteOff
      • onController
      • onControl
      • onTimer

      …and implements the following portamento logic:

      1. Delta-Time Glide
        Glide time is mapped from the time difference between two legato-played notes.

      2. Velocity Glide
        Higher velocity → faster glide
        Lower velocity → slower glide

      3. Combined Glide
        Final glide time = average between Δt-based glide and velocity-based glide.

      4. Backward Glide on NoteOff
        When releasing the last played note, it should automatically glide back to the previously held note.

      5. Legato note list
        Notes are tracked using a simple array:
        playlister.push({ noteNum, noteID })

      6. Uses
        • Synth.addPitchFade
        • Message.makeArtificial()
        • safe noteOff handling

      Why I need it

      I need a clean, importable .xml snippet that I can load via:
      File → Import Snippet…
      so I can continue building my instrument without structural callback conflicts.

      At the moment I keep running into callback-level and global-level variable issues, so a proper template snippet would help a lot.

      Help needed

      If anyone familiar with HISE scripting architecture can assemble a clean multi-callback ScriptProcessor snippet that contains:
      • correct global variable placement
      • correct inline helper functions
      • correct callback structure
      • the combined portamento behavior described above

      …I would greatly appreciate it.

      Thanks in advance!

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

        @keysounds if you're pasting a script in to the editor use the load script from clipboard option in the right click context menu. This will put the callbacks in the correct place.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        K 1 Reply Last reply Reply Quote 1
        • K
          keysounds @d.healey
          last edited by

          @d-healey thank you, I learned that from your videos, and it's really very helpful. If somebody have and want to share one json File for this purpose can be also helpful for others at Forum. Portamento(Glide) with velocity and depend on how quick we playing the second Legato Note, something Like on SWAM Instruments.

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

            @keysounds SWAM instruments use physical models, they are very complicated.

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

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

            22

            Online

            2.0k

            Users

            12.9k

            Topics

            111.5k

            Posts