Forum

    • Register
    • Login
    • Search
    • Categories

    Message.getTimestamp(); values?

    General Questions
    3
    10
    142
    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.
    • hisefilo
      hisefilo last edited by hisefilo

      Hi guys, what are the Message.getTimestamp(); displayed in? ms? seconds? hotdogs? I got something between 0 and 255 I think. Any light on this?

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

        Samples.

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

          @Christoph-Hart thanks Christoph! Having a hard time trying to get a mono glide script (hoping to useTimestamp to create an if statement). All examples on the forum are buggy or not working. This is the one you did some time ago, but can get the logic yet.

          Content.setWidth(200);
          
          
          reg on = 0;
          reg lastId = 0;
          reg lastNote = 0;
          
          const var GlideTime = Content.addKnob("GlideTime", 0, 0);
          // [JSON GlideTime]
          Content.setPropertiesFromJSON("GlideTime", {
            "min": 10,
            "max": 100,
            "mode": "Time",
            "stepSize": 1,
            "suffix": " ms"
          });
          // [/JSON GlideTime]function onNoteOn()
          {
                  // This is necessary because the volume fade kills the note
                  // (= adds a artificial note off after the fade)
          	Message.makeArtificial();
          	
          	Console.print("lastNote " + lastNote);
          	Console.print("lastId " + lastId);
          	
          	if(lastId != 0)
          	{
          		local delta = lastNote - Message.getNoteNumber();
          		Console.print("delta " + delta);
          			
          		Synth.addPitchFade(lastId, GlideTime.getValue(), -delta, 0);
          		Synth.addVolumeFade(lastId, GlideTime.getValue(), -100);
          		
          		Message.setCoarseDetune(delta);
          		Message.setGain(-99); // -100 kills it :)
          		Synth.addPitchFade(Message.getEventId(), GlideTime.getValue(), 0, 0);
          		Synth.addVolumeFade(Message.getEventId(), GlideTime.getValue(), 0);
          		
          	}
          	
          	lastNote = Message.getNoteNumber();
          	lastId = Message.getEventId();
          }
          function onNoteOff()
          {
          	Message.makeArtificial();
          
          	if(Synth.getNumPressedKeys() == 0)
          	{
          		lastId = 0;
          		
          	}
          }function onController()
          {
          	
          }
          function onTimer()
          {
          	
          }
          function onControl(number, value)
          {
          	
          }
          
          
          hisefilo 1 Reply Last reply Reply Quote 0
          • hisefilo
            hisefilo @hisefilo last edited by

            @Christoph-Hart not going anywhere. I'm not David 😞

            Any chance you can fix this old script you did?

            dustbro 1 Reply Last reply Reply Quote 0
            • dustbro
              dustbro @hisefilo last edited by

              @hisefilo what happens when you use the script posted above?

              Dan Korneff - Producer / Mixer / Audio Nerd

              hisefilo 1 Reply Last reply Reply Quote 0
              • hisefilo
                hisefilo @dustbro last edited by hisefilo

                @dustbro glide starts but it has just a few milliseconds of life. And can't figure out how to fix it

                dustbro 1 Reply Last reply Reply Quote 0
                • dustbro
                  dustbro @hisefilo last edited by

                  @hisefilo looks like it's set to max out at 100ms. Can you change this property ?

                  Content.setPropertiesFromJSON("GlideTime", { "min": 10, "max": 100, "mode": "Time", "stepSize": 1, "suffix": " ms"

                  Dan Korneff - Producer / Mixer / Audio Nerd

                  hisefilo 1 Reply Last reply Reply Quote 0
                  • hisefilo
                    hisefilo @dustbro last edited by

                    @dustbro tried that earlier. Is not. I guess something related to noteIds cos sometimes I got also messages like

                    onNoteOn() - Line 16, column 22: NoteOn with ID6505 wasn't found
                    
                    dustbro 1 Reply Last reply Reply Quote 0
                    • dustbro
                      dustbro @hisefilo last edited by

                      @hisefilo I don't have my computer in front of me at the moment. Im trying to look for something silly. I see the onNoteOn function line is commented out
                      '''
                      // [/JSON GlideTime]function onNoteOn()
                      '''
                      Is the script sitting properly in the onNoteOn callback?

                      Dan Korneff - Producer / Mixer / Audio Nerd

                      hisefilo 1 Reply Last reply Reply Quote 0
                      • hisefilo
                        hisefilo @dustbro last edited by

                        @dustbro yes, this is just a copy-paste error here on forum. is properly placed on Hise

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

                        11
                        Online

                        741
                        Users

                        5.4k
                        Topics

                        50.4k
                        Posts