Activating/Deactivating a GUI Button via MIDI Keys in HISE?
-
@lijas90 In what way does it not work?
That code looks good and works here.
I also made a more refined version for you
HiseSnippet 812.3ocsUs0aSCCE1tqAQJvDShe.g8TKZZpYq2lPHF8FTAcqhNlPBgl7bbZsZhcUr6fJD+m3mFuwivwIo21l1kJQdHJm6e9b97I8hjTlRIiP3bmLcLCgerU+oB8vFCIbApSSDdSqtDklE4jnp9zwDkh4gv3MdqQA1NKJ942utNIfHnrEpPnSkbJ6C7Ptdg1dG9ddPPahG6Dd3RdW5vNTongLPNAvyFVEQiIzQjAriHF2xXgdGQMDgeg0dtkOv2q79t01qTshG3xpTthmuWU309m6545Uy6fRUYkP3GzxiqkQ80DMSAIstzaZ+gxuIRJvobE+7.lQvE0GpbhZTig7.udyZNJDBms2hV0FIspmY0k6wmqeQK6owFbVDwxMMblaBRt2CHgWBRYSfzVV8oQ7w5EVL34QVcDvDzm.ylkgRhunLJrUCI3gPuaHYDqcDHLOh7UJVbGG3UgWlKGLeTZmQJmW47kRU2woTsuNW6EjHm5SzZovELOKgCX5FxvwRAHje6T6aaxk+DAUykBGo3HolcrHegb+HmcfjRBbDPJ5Bm.X5aRgwgilDdNKJODpcNatuS9QpcgJqgttJunPgb1NvSZE1UwzmRBlvx+7YZFLSSAHE+LmykquueB.tjMyAIRFDXJ80X1Pgito.yKhw8NP+AJ9bGgQ1p7fGb23Azj95RNJEcDb8wiYoxskAdl4q46qxZPoCFC+IEgfq5X1ylormjNFhCIw1Js8ghgug0f9TmlDMYVBfbA4eLKRyMGCbS1EvU9D5nsUSlZjVNN12TV.bxuCk66HrE9O.dmZ93Ww6MtBcGtnI8lDPzqd6yrWJ0.LJVgxan0BEWOc48V2iqjEuwqj2UHtkUOtlN75wXlqAiPy9+AFSWj8DqV99LpdA.yZ09yq6Vqao7eTNQyEC5RzQbyPFtV2GV3SYP0EBVfxLuyXHpIxEMxlNPelvKV3uvSpQWiLN0n6LinPBMRdFMgdaVU9vXM.lDw+JwF9mFH6LmUunOGBatOiRWMUWIv8V2.2ecCrz5FX40MvJqafUW2.qc6AZ9w5alnkgIWaPnt8ZEuMBiaIH.CLlsh9G30MyUG
-
@d-healey Ok, now it works. Thanks. However, it only works when I press the physical key on the controller. Is there a way to make the button activate when a MIDI player is playing those notes? To simulate an instrument animation that triggers when the MIDI is played? Thanks.
-
@lijas90 Have you tested it in a daw? It should work
-
I’ve tried it and it doesn’t work. Do I need to do it in a Script Processor inside the MIDI Processor in some specific way?
-
@lijas90 Sorry, it does work.
-
@lijas90 Thanks David!
-
@d-healey How can I make the button activate only while the key is being pressed, and deactivate when the key is released? Thanks.
-
@lijas90 In
onNoteOn
turn the button on, inonNoteOff
turn the button off. -
@d-healey I’ve tried it like this but it doesn’t work; the button only deactivates when pressing it again, not when releasing the key. Thanks, my friend.
function onNoteOff() { local n = Message.getNoteNumber(); if (ks.contains(n)) btn1.setValue(0); }
-
@lijas90 Post a snippet so I can see the full code
-
@d-healey Sorry, it works now. Thanks again, David