HISE Logo Forum
    • Categories
    • Register
    • Login

    Some basic questions

    Scheduled Pinned Locked Moved Scripting
    74 Posts 4 Posters 17.8k 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.
    • Christoph HartC
      Christoph Hart
      last edited by

      A key difference to KSP is that there is no wait() instruction. Instead you delay events using Message.delayEvent(). The problem with stuck notes can be solved by delaying the note off command with the same amount (it's hardly noticeable on note off commands).

      1. Don't use the Engine.createTimerObject() for audio stuff. This is running in the GUI thread and has absolutely no predictability or accuracy.

      2. There are scripting callbacks for adding volume fades. Check out Synth.addVolumeFade().

      3. the onTimer callback runs in the audio thread and has sample accuracy.

      Thanks for the hint, I'll fix the getUptime doc in the API...

      1 Reply Last reply Reply Quote 0
      • LevitanusL
        Levitanus
        last edited by

        Ok, I think, the last question in this direction))
        How about JUCE API? Can it work inside the script processor?

        1 Reply Last reply Reply Quote 0
        • LevitanusL
          Levitanus
          last edited by

          can't find are reg global, and if not, 32 per plugin or 32 per script?

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by

            32 per namespace:

            namespace n1
            {
                reg n1_1 = 1;
                // ...
                reg n1_32 = 32;
            }
            
            namespace n2
            {
                reg n2_1 = 1;
                // ...
                reg n2_32 = 32;
            }
            1 Reply Last reply Reply Quote 1
            • LevitanusL
              Levitanus
              last edited by Levitanus

              Very interesting)))
              So i can use 32 pieces of
              reg atck_var
              and 32 of
              reg sus_var &

              And they are global, am i right?

              Another question. I placed Synth.noteOffByEventId(atck_id); into timer callback, as well as to the note_off callback. Now, pretty predictable i receive error in console about missing event by timer or by noteOff callback depends on situation. Is it bad? Or I can eat it as usefull information and newer mind?

              and more, more questions ))))
              When does envelope work? I know that once triggered by the voice KONTAKT envelope works as it was before triggering, even if it has been changed during the note playback.
              For example, if I move some points in noteOn, will it "eat" them respectivelly to the current note and not for any other already triggered?
              or it will work with all currentely produced samples? Or new values will be produced only with next notes, or with artifically played with a bit of delay?

              P.S. and.. I have been confused a little by the dates od requests, so can;t understand actual things. Is timer global for the plugin, or local for each script?

              1 Reply Last reply Reply Quote 0
              • LevitanusL
                Levitanus
                last edited by

                Well I have almost done the "Hello world", but can't find how to set persistence of wigets... Or they will be saved automatically (as fbx)?

                1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart
                  last edited by

                  Widgets are persistent by default. If you don't want this, you can call

                  widget.set("saveInPreset", false);
                  
                  1 Reply Last reply Reply Quote 1
                  • LevitanusL
                    Levitanus
                    last edited by

                    Thanks! But I can't get the widget value by simple:

                    modwheel = Content.addKnob("modwheel", 346, 110);// [JSON modwheel]
                    Content.setPropertiesFromJSON("modwheel", {
                      "max": 127,
                      "stepSize": "1"
                    });
                    // [/JSON modwheel]
                    modwheel.showControl(false);
                    Globals.MW = modwheel.getValue();
                    

                    What should be here else?

                    1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart
                      last edited by Christoph Hart

                      The persistent data is not available in the onInit callback. This happens behind the scenes:

                      1. The persistent widget values are stored.
                      2. The script gets compiled.
                      3. The persistent widget values are restored.
                      4. For all persistent widgets, the onControl callback gets executed.

                      In your case, you need to move the

                      Globals.MW = modwheel.getValue();
                      

                      line in the onControl callback.

                      1 Reply Last reply Reply Quote 1
                      • LevitanusL
                        Levitanus
                        last edited by

                        why Event is not been ignored?

                        reg note = 0;
                        reg vel = 0;
                        
                        reg newnote = 0;
                        reg lastnote = 0;
                        var i = 0;
                        Globals.pos_interval = 0;
                        Globals.neg_interval;
                        
                        Globals.Attack_length = 600;
                        Globals.Attack_fade = 150;
                        Globals.Release_fade = 200;
                        
                        Globals.Attack = 0;
                        Globals.Legato = 0;
                        Globals.Glissando = 0;
                        
                        function onNoteOn()
                        {
                        	if (lastnote == 0)
                        	{
                        		Globals.Attack = 1;
                        	} 
                        	if (lastnote != 0)
                        	{
                        		if (Message.getVelocity() < 80)
                        		{
                        			Globals.Legato = 1;
                        			interval = lastnote - Message.getNoteNumber();
                        			Globals.pos_interval = Message.getNoteNumber() - lastnote;
                        			Globals.neg_interval = lastnote - Message.getNoteNumber();
                        			if (Globals.pos_interval >0)
                        			{
                        				Message.setVelocity(Globals.pos_interval);
                        			}
                        			if (Globals.neg_interval >0)
                        			{
                        				Message.setVelocity(Globals.neg_interval);
                        			}
                        		} else
                        		{
                        			Globals.Glissando = 1;
                        			interval = lastnote - Message.getNoteNumber();
                        			Globals.pos_interval = Message.getNoteNumber() - lastnote;
                        			Globals.neg_interval = lastnote - Message.getNoteNumber();
                        			if (Globals.pos_interval >0)
                        			{
                        				Message.setVelocity(Globals.pos_interval);
                        			}
                        			if (Globals.neg_interval >0)
                        			{
                        				Message.setVelocity(Globals.neg_interval);
                        			}
                        		}
                        	}
                        	lastnote = Message.getNoteNumber();
                        }
                        function onNoteOff()
                        {
                        	Globals.Attack = 0;
                        	Globals.Leg = 0;
                        	Globals.Glissando = 0;
                        	if (Message.getNoteNumber() == lastnote)
                        	{
                        		lastnote = 0;
                        	}
                        }
                        
                        //script perocessor 2
                        Sampler.enableRoundRobin(false);
                        reg leg_grp = 0;
                        reg vel = 0;
                        reg note= 0;
                        
                        if (Globals.MW > 64)
                        {
                        	leg_grp = 1;
                        }else
                        {
                        	leg_grp = 2;
                        }
                        function onNoteOn()
                        {
                        	note = Message.getNoteNumber();
                        	vel = Message.getVelocity();
                        	Message.ignoreEvent(true);
                        	if (Globals.Glissando = 1)
                        	{
                        		Synth.playNote(note,vel);
                        	}
                        }
                        

                        The problems are:
                        Globals.Legato and Globals.Glissando are set with every event.
                        And even with setting them to 0 leg and gliss samplers are played. But shouldn't because of ignoreEvent

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

                          I might be too tired to be thinking striaght but I think you need to ignore the event in your first script too

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

                          1 Reply Last reply Reply Quote 1
                          • Christoph HartC
                            Christoph Hart
                            last edited by

                            Yes. Events have a natural signal flow so if it gets ignored in the second script, the first script is long gone waiting for the next event...

                            1 Reply Last reply Reply Quote 1
                            • LevitanusL
                              Levitanus
                              last edited by Levitanus

                              Well, in HISE all works pretty fine. Just couldn't add CC gain modulator to the master container.
                              But with compilled VST trash: https://www.dropbox.com/s/oa8xbrnxhqx0k7r/Hise Hello World by Levitanus.rar?dl=0

                              Problem A: engine settings button is visible and crushes the host.
                              Problem B: nothing is sounding, but voices are triggered.

                              Playable keys G3,A3,E4. And CC1

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

                                CC Modulators can't be added to the master container but you can add them as a global modulator :)

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

                                1 Reply Last reply Reply Quote 1
                                • LevitanusL
                                  Levitanus
                                  last edited by

                                  but you can add them as a global modulator :)

                                  wah! of course!

                                  1 Reply Last reply Reply Quote 0
                                  • LevitanusL
                                    Levitanus
                                    last edited by Levitanus

                                    And what is with compiled VST? Where have I mistaken?

                                    1 Reply Last reply Reply Quote 0
                                    • Christoph HartC
                                      Christoph Hart
                                      last edited by

                                      I'll need to take a look. The engine settings button is definetily a bug and if HISE makes sound but the compiled plugin doesnt then theres something wrong too.

                                      1 Reply Last reply Reply Quote 0
                                      • Christoph HartC
                                        Christoph Hart
                                        last edited by

                                        Can you upload the project folder (without the samples)? It's hard to check what's wrong with only the binaries...

                                        1 Reply Last reply Reply Quote 0
                                        • LevitanusL
                                          Levitanus
                                          last edited by

                                          Can you upload the project folder (without the samples)?

                                          It's alreasy there.. The folder "testhise"
                                          And the first is the binaries
                                          Will be glad if you take a look :)

                                          1 Reply Last reply Reply Quote 0
                                          • Christoph HartC
                                            Christoph Hart
                                            last edited by

                                            Ah sorry I downloaded the file but somehow overlooked the testhise folder. I'll take a look whats going on.

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

                                            36

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            102.3k

                                            Posts