Forum
    • Categories
    • Register
    • Login

    suck notes with keyassigner script in silent synth

    Scheduled Pinned Locked Moved Scripting
    22 Posts 2 Posters 63 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 @David Healey
      last edited by

      @David-Healey my guess is on something along the path from hise to faust or faust itself
      so i pointed claude to it which revealed the following, which might be the cause and is beyond my reach

      FaustUI.h:201 — each Faust voice has its own MidiZones struct containing a sustain flag:

      
      struct MidiZones {
          float* zones[(int)HardcodedMidiZones::numHardcodedMidiZones];
          bool sustain = false;     // <-- per-voice, defaults to false
      };
      

      PolyData<MidiZones, NumVoices> midiZones;
      FaustUI.h:357-365 — the reset() method only zeros the pointer array, never resets sustain:

      void reset() {
          // ... clears modoutputs, parameters
          for (auto& mz : midiZones)
              mz.reset();   // ← only memsets zones[] to 0
          anyMidiZonesActive = false;
      }
      

      The struct's mz.reset() is:

      
      void reset() {
          memset(zones, 0, sizeof(float*) * ...);   // does not touch sustain
      }
      

      FaustUI.h:330-338 — note-off behavior:

      
      else if(e.isNoteOff()) {
          auto& mz = midiZones.get();
          if(!mz.sustain)              // ← only releases if THIS voice's sustain flag is false
              if (auto gatePtr = mz.zones[(int)HardcodedMidiZones::Gate])
                  *gatePtr = 0.0f;
      }
      

      The mechanism: mz.sustain is set ONLY by the CC 64 handler (FaustUI.h:339-356) — never on voice start, never on reset. So a voice that was allocated AFTER the pedal CC came in, OR whose voice slot has never received a CC 64 during its lifetime, has mz.sustain == false — its gate gets dropped to 0 on note-off regardless of what the JUCE voice manager thinks about the pedal.

      This is independent of JUCE's voice-level sustain handling. The HISE voice manager keeps the voice ALIVE (because JUCE's sustainPedalDown is true), but the Faust envelope's gate has already gone to 0 — so the voice produces silence (release tail) and gets killed by silent_killer.

      https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @Morphoice
        last edited by

        @Morphoice If it's on the faust side I won't be much help.

        I'm not hearing any audio with your snippet.

        On the script side this looks weird. What's the intention?

        global Event 			= {};
        
        Event.noteIds 			= []; 
        Event.noteIds.reserve(128);
        
        for (i = 0; i<128; i++)
        {
        	Event.noteIds[i] = [];
        	Event.noteIds[i].reserve(32);
        }
        

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

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

          @David-Healey dead code

          is there a faust node in the polyphonic scriptfx?

          toes it have a dsp code?

          if not put this

          // Faust Source File: Test
          // Created with HISE on 2026-05-15
          import("stdfaust.lib");
          
          gate = button("[20]gate");							// note on off
          freq = hslider("[21]freq", 200, 20, 20000, 0.1);	// note frequeny
          gain = hslider("[22]gain", 0.0, 0.0, 1.0, 0.01);	// note velocity
          
          attack 			= hslider("AttackTime[style:knob]",0.2,0,6,0.001);
          attackSlope 	= hslider("AttackSlope[style:knob]",0.7,0,1,0.001);
          decay 			= hslider("DecayTime[style:knob]",0.3,0,6,0.001);
          decaySlope 		= hslider("DecaySlope[style:knob]",0.3,0,1,0.001);
          sustain 		= vslider("SustainLevel[style:knob]",0.5,0,1,0.001);
          release 		= vslider("ReleaseTime[style:knob]",1,0,6,0.001);
          releaseSlope 	= vslider("ReleaseSlope[style:knob]",0.3,0,1,0.001);
          velDepth 		= vslider("velDepth[style:knob]",1,0,1,0.001);
          legato 			= vslider("Legato[style:knob]",0,0,1,0.001);
          
          ramp   			= en.adsr(0, release * 0.15, 0, 0, 1 - gate);
          dramp   		= en.adsr(attack, decay * 0.1, 1,0, gate);
          rslope			= releaseSlope - ramp * 0.25;
          dslope			= decaySlope - dramp * 0.20;
          
          velocity 		= 1*(1-velDepth*((1-gain))); 
          
          envelope 		= en.adsr_bias(attack, decay, sustain, release, attackSlope, dslope, rslope, legato, gate) 
          				: hbargraph("CV",0,1);
          
          
          osc = os.polyblep_triangle(freq) * envelope;
          
          process = osc,osc;
          
          

          https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @Morphoice
            last edited by

            @Morphoice Oh hang on, my current build doesn't include FAUST 🤦 I can't rebuild at the moment because I'm in the middle of something, but I think you've nailed down that it's a faust side issue.

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

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

              @David-Healey oh yes, the pleasures of building with faust and ending up without faust .... ;)))

              im very strongly convinced the issues is within how hise implements faust as explained in the post before, not the faust dsp itself. then again that would only explains the issue that notes are not sustained even though the pedal is pressed...

              the other problems are the orphan notes that might still be a problem of the keyassigner... some never get released when the pedal is released.... could be some sort of orphans from a tretrigger of the same note...

              my forte is coding dsp, all that stuff around that makes the world tick -- no clue

              https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David Healey @Morphoice
                last edited by

                @Morphoice Tell me what the key assigners role is.

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

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

                  @David-Healey handle polyphonic aftertouch and pitchbend by sending their values to a knob in the faust (not present in the snippet example)

                  https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

                  David HealeyD 1 Reply Last reply Reply Quote 0
                  • David HealeyD
                    David Healey @Morphoice
                    last edited by

                    @Morphoice Does that need to be scripted? Isn't there a way directly in scriptnode to get those values and forward them to the faust node?

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

                    MorphoiceM 3 Replies Last reply Reply Quote 0
                    • MorphoiceM
                      Morphoice @David Healey
                      last edited by

                      @David-Healey nope, we had this discussion here a long time ago and this was the only working way

                      https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                        @David-Healey i believe it was this thread
                        https://forum.hise.audio/topic/11793/polyphonic-aftertouch/34?_=1778856642370

                        https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                          @David-Healey there's also another bug in the hise/faust midi implementation.... if a key is held and the pedal released, the note stops. although the key is still held.... weird.

                          https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

                          David HealeyD 1 Reply Last reply Reply Quote 0
                          • David HealeyD
                            David Healey @Morphoice
                            last edited by

                            @Morphoice Does this happen if you swap your faust synth for a waveform gen, keeping everything else the same?

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

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

                              @David-Healey there is no waveform generator in a silent synth

                              https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                                @David-Healey i think i isolated the problem and filed an issue, it's in fact three problems
                                https://github.com/christophhart/HISE/issues/954

                                https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                                6

                                Online

                                2.3k

                                Users

                                13.7k

                                Topics

                                119.0k

                                Posts