HISE Logo Forum
    • Categories
    • Register
    • Login

    QWERTY Keyboard Octave - setKeyPressBaseOctave - Feature Request

    Scheduled Pinned Locked Moved Feature Requests
    13 Posts 4 Posters 1.4k 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.
    • A
      aaronventure @CyberGen
      last edited by

      @CyberGen What's stopping you from rolling your own functionality for the computer keyboard?

      Admittedly, playNoteFromUI doesn't work as expected (all notes are velocity 127), but I believe that's a quick fix for Chris once he's back from vaykay.

      CyberGenC 1 Reply Last reply Reply Quote 0
      • CyberGenC
        CyberGen @aaronventure
        last edited by CyberGen

        @aaronventure hmm...🤔 ignorance mostly.
        Do you mean with: setConsumedKeyPresses(); and setKeyPressCallback(function(obj) ?
        I hadn't thought about it.... would this override it's default functionality?

        A 1 Reply Last reply Reply Quote 0
        • A
          aaronventure @CyberGen
          last edited by

          @CyberGen if you use these methods (which are for controls), a control will need to be in focus before it can consume the key presses (I think).

          So use the Content.setKeyPressCallback to do it globally.

          Do it for each key individually, and just use a var that refers to whatever your current octave setting is.

          CyberGenC 1 Reply Last reply Reply Quote 0
          • CyberGenC
            CyberGen @aaronventure
            last edited by

            @aaronventure uhm.. sorta got it to work like this:

            const var key = "a";
            const var qwertyOctave = 0;
            
            Content.setKeyPressCallback(key, function(key)
            {
            	if (key == "a")
            	{
            		Synth.playNote(60 + (qwertyOctave * 12), 100);
            	}
            });
            

            Now how do I get the note to stop playing? what is the onNoteOf version of the keyPressCallback?

            A 1 Reply Last reply Reply Quote 0
            • A
              aaronventure @CyberGen
              last edited by

              @CyberGen ah fuck, you're right, you need a key release callback. Nevermind.

              I don't whether that could be added to the keypresscallback (like isFocusChange, the super useful property that's secretly tucked into the keypresscallback). If it's simpler than adding the octave things, it solves not only your custom computer keyboard issue but also enables a bunch of other functionality.

              We'll see what Chris says in a few days/weeks.

              ustkU 1 Reply Last reply Reply Quote 1
              • ustkU
                ustk @aaronventure
                last edited by ustk

                @aaronventure I don't know if isFocusChange could be of any help in this case. But when printing the CB object we see there's no call for a key up. So in the end it might just be good to go noteOffDelayedByEventId. Not an issue for percussive sound, but for longer notes...
                At least until a key up property can be added

                BTW, I reckon playNote is deprecated. addNoteOn should be preferred

                Can't help pressing F5 in the forum...

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

                  @ustk said in QWERTY Keyboard Octave - setKeyPressBaseOctave - Feature Request:

                  I reckon playNote is deprecated. addNoteOn should be preferred

                  Why?

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

                  ustkU 1 Reply Last reply Reply Quote 0
                  • ustkU
                    ustk @d.healey
                    last edited by

                    @d-healey Mmm... Strangely I was certain it was written in the API help but not anymore... Is it me or it has been removed? or another playNote function that is now removed maybe... Or perhaps I had my brain removed :man_shrugging:

                    Can't help pressing F5 in the forum...

                    d.healeyD CyberGenC 2 Replies Last reply Reply Quote 1
                    • d.healeyD
                      d.healey @ustk
                      last edited by

                      @ustk I think you're experiencing a personal Mandela effect 😀

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

                      ustkU 1 Reply Last reply Reply Quote 1
                      • ustkU
                        ustk @d.healey
                        last edited by ustk

                        @d-healey said in QWERTY Keyboard Octave - setKeyPressBaseOctave - Feature Request:

                        @ustk I think you're experiencing a personal Mandela effect 😀

                        It's not what you think... We are sure! :zany_face:

                        Can't help pressing F5 in the forum...

                        1 Reply Last reply Reply Quote 1
                        • CyberGenC
                          CyberGen @ustk
                          last edited by

                          @ustk I believe it's Synth.noteOff() that's deprecated. If you use it, the console throws a message to use noteOffByEventId. Anway, I only used playNote hoping somehow it wouldn't require a noteOff callback as I was testing @aaronventure suggestion.

                          I think it would be better to just add the octave control to the existing qwerty keyboard function. :crossed_fingers:

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

                          31

                          Online

                          1.8k

                          Users

                          12.0k

                          Topics

                          104.1k

                          Posts