HISE Logo Forum
    • Categories
    • Register
    • Login

    script cc and pitch bend

    Scheduled Pinned Locked Moved Scripting
    7 Posts 2 Posters 271 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.
    • ulrikU
      ulrik
      last edited by

      I'm familiar with how to create notes for the midi player through scripting like you example @Christoph-Hart

      //	ADD NOTE FUNCTION
      inline function addNote(list, channel, notenumber, velocity, position, length)
      {
          var m = Engine.createMessageHolder();
          m.setType(m.NoteOn);
          m.setNoteNumber(notenumber);
          m.setVelocity(velocity);
          m.setChannel(channel);
          m.setTimestamp(Engine.getSamplesForQuarterBeats(position));
          
          var o = Engine.createMessageHolder();
          o.setType(o.NoteOff);
          o.setNoteNumber(notenumber);
          o.setChannel(channel);
          o.setTimestamp(Engine.getSamplesForQuarterBeats(position + length));
          
          list.push(m);
          list.push(o);
      }
      

      Is there a similar way to script cc and pitch bend information for the midi player?

      Hise Develop branch
      MacOs 15.3.1, Xcode 16.2
      http://musikboden.se

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

        Sure:

        o.setType(o.PitchBend);
        
        o.setType(o.Controller);
        
        ulrikU 2 Replies Last reply Reply Quote 1
        • ulrikU
          ulrik @Christoph Hart
          last edited by

          @Christoph-Hart great, thanks!

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

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

            @Christoph-Hart btw, let's say I have 8 quarter notes in a sequence, and I wan't to have cc1 going from min to max from the start to the end of sequence, how should I calculate the timestamp for cc1, and does it matter in which order the different events is pushed to the list?

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

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

              how should I calculate the timestamp for cc1

              The same way you calculate it for the notes. Use the tick format, then o.setTimestamp(quarterPos * 960.0).

              does it matter in which order the different events is pushed to the list

              Nope, they are sorted chronologically when they are put into the MIDI player.

              ulrikU 1 Reply Last reply Reply Quote 1
              • ulrikU
                ulrik @Christoph Hart
                last edited by

                @Christoph-Hart I use the

                setControllerNumber() & setControllerValue()
                

                for controllers between 1 - 127 and it works great
                but with what function do I set the pitch bend value?

                Hise Develop branch
                MacOs 15.3.1, Xcode 16.2
                http://musikboden.se

                ulrikU 1 Reply Last reply Reply Quote 0
                • ulrikU
                  ulrik @ulrik
                  last edited by

                  @ulrik never mind, I set the pitch bend value with the same function

                  setControllerValue()
                  

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

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

                  48

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  102.1k

                  Posts