HISE Logo Forum
    • Categories
    • Register
    • Login

    Assigning a key to the midi player

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 396 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.
    • B
      BWSounds
      last edited by

      Is it possible to assign a key (lets say c5) to the keyboard so when you press that key it plays the midi pattern in the midi player?

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

        Call this in your onNote on callback (and give it the timestamp from Message.getTimestamp() for sample accurate playback).

        B 2 Replies Last reply Reply Quote 0
        • B
          BWSounds @Christoph Hart
          last edited by

          @Christoph-Hart I keep getting this message:
          Illegal operation in audio thread: String creation

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

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • B
              BWSounds
              last edited by

              @BWSounds said in Assigning a key to the midi player:

              Is it possible to assign a key (lets say c5) to the keyboard so when you press that key it plays the midi pattern in the midi player?

              Still stuck on this!..ive tried,tried & tried, but still no luck.

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

                @BWSounds declare the midiPlayer as this:
                "Create typed MIDI.....
                Skärmavbild 2019-10-04 kl. 07.42.47.png
                you'll get this reference:

                const var MIDIPlayer1 = Synth.getMidiPlayer("MIDI Player1");
                

                in the NoteOn Callback:

                function onNoteOn()
                {
                	if(Message.getNoteNumber() == 84)
                    {
                        var timeStamp = Message.getTimestamp();
                        MIDIPlayer1.play(timeStamp);
                        Message.ignoreEvent(true);
                    }
                }
                 
                

                I have the

                Message.ignoreEvent(true);
                

                so that the pressed key doesn't sound as well

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

                B 1 Reply Last reply Reply Quote 2
                • B
                  BWSounds @ulrik
                  last edited by BWSounds

                  @ulrik Thank you! I guess I was over complicating things.

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

                  35

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  101.9k

                  Posts