Comments (12)
You might also consider having the config prompt ask someone to press and release a button. Then, have them do it again.
That will either give you four events (If I'm understanding this issue correctly) 1) on 127 2) off 127 3) on 0 4) off 0, or it will give you potentially enough data from which to autodetect what kind of button/toggle something is.
That's a little more "automagical" of a solution; your choice of course on whether you want to be intuitive and sensing, or explicit, in your UX.
from miditoobs.
worked.
changed to what lebaston100 suggested and set the button a setMute. then headed into the config file du[licated the entry and changed to mute on 127 and unmute on 0.
from miditoobs.
Currently that is intended behaviour. But i want to change that in the future. It's the same base problem as this one: #24
If you want to use the toggle function in the meantime you have to program your controller to send a value of 127 every time the button is pressed.
from miditoobs.
from miditoobs.
I changed
def handle_midi_input(self, message, deviceID, deviceName):
self.log.debug("Received %s %s %s %s %s", str(message), "from device", deviceID, "/", deviceName)
if message.type == "note_on":
return self.handle_midi_button(deviceID, message.channel, message.type, message.note)
to
def handle_midi_input(self, message, deviceID, deviceName):
self.log.debug("Received %s %s %s %s %s", str(message), "from device", deviceID, "/", deviceName)
if message.type == "note_on" or message.type == "note_off":
return self.handle_midi_button(deviceID, message.channel, message.type, message.note)
and then manually added a "note_off" entry in the config file to get this behavior.
That seemed to be the only change needed in main.py. I may look at setup.py next to make button-mapping easier...
from miditoobs.
Implementation is the easy part here, the thing i'm worried about is UX. Because for the controllers that use "note_on" and "note_off" you get a "double" even which could confuse users.
from miditoobs.
Well, that's what's working for me, and at least there's enough information here for others who need that functionality to implement it, and get running.
Might need to add a question like the "is this a fader or a button" for buttons that asks whether it's a momentary or toggle button, and if toggle, what to set the on and off to separately. Or ignore the off.
Two very similar edits got setup.py working with mapping note_off.
from miditoobs.
yea, the information is now here if someone needs it.
I'll think about how to aproach that because it's the same for the value in control_change messages.
from miditoobs.
I changed
def handle_midi_input(self, message, deviceID, deviceName): self.log.debug("Received %s %s %s %s %s", str(message), "from device", deviceID, "/", deviceName) if message.type == "note_on": return self.handle_midi_button(deviceID, message.channel, message.type, message.note)
to
def handle_midi_input(self, message, deviceID, deviceName): self.log.debug("Received %s %s %s %s %s", str(message), "from device", deviceID, "/", deviceName) if message.type == "note_on" or message.type == "note_off": return self.handle_midi_button(deviceID, message.channel, message.type, message.note)
and then manually added a "note_off" entry in the config file to get this behavior.
That seemed to be the only change needed in main.py. I may look at setup.py next to make button-mapping easier...
I made the change you suggested but i couldn't figure about where to add the "note_off" in the config file.
"5": { "msg_type": "control_change", "msgNoC": 112, "input_type": "button", "action": "{\"request-type\": \"ToggleMute\", \"message-id\" : \"1\", \"source\": \"elgato\"}", "deviceID": 1, "bidirectional": false }
this is the code that was added for the toggleMute button i chose. but i don't see a "note_on" so it is not obvious for me how to duplicate the entry with a note off
from miditoobs.
Your controller seems to send control_change messages, not note_on or note_off.
If you use the most recent setup.py from github there will also be a value named msgVoV that is the midi control change value. You would have to add a check to the main.py to check for that value, that's something i will do in the future.
Or you can try to reprogramm your controller to send note_on and note_off, these would go into the "msg_type" field.
from miditoobs.
updated my setup.py with the one on github.
{also, my coding skill is very basic but thought i would try to help
i see now that my controller sends control_change and i can't change that in my controller. with that said i headed to main.py to try and figure where to start:
I figured that since handle_midi_input receives message.type: "control_change" the handle_midi_fader function is handling my input. I was thinking that by allowing the function to add "or value == 0" in the if statement, it will also fire the toggle but it didn't do the trick.
if input_type == "button": if (value == 127 or value == 0) and not self.send_action(result): continue
since my toggle sends either 0 or 127 i thought the problem is that nothing fires when it sends 0 but i guess i didnt understand that correctly :D
I will wait for that feature to be added since it seems I can't figure how to implement it myself :)
from miditoobs.
Try something in that direction instead. I've not tested in but in theory it should check if the msgVoV matches the current input value so it doesn't trigger the same action twice.
if input_type == "button": if value == result["msgVoV"] and not self.send_action(result): continue
from miditoobs.
Related Issues (20)
- SetAudioMonitorType Action Returns Error Invalid Request Type HOT 2
- Run on OBS startup HOT 4
- Change order of scenes HOT 1
- Setup Error: AttributeError: 'Element' object has no attribute 'doc_id' HOT 6
- Problem with ToggleSourceVisibility when not "current" scene HOT 2
- Request: Ability to control Filter: Render Delay
- Request: Please Make command for SceneFilter HOT 7
- Bidirectional setup KORG nanoKONTROL2 HOT 1
- Where to store settings for new feature (screenshot location) HOT 2
- Error when trying to set up a new command HOT 7
- Problems running `setup.py` HOT 2
- Actions do not work HOT 2
- TinyDB Table implementation missing "purge" method (for deleting all devices in setup.py) HOT 1
- (Possibly Mac Only) Filter names in OBS need updating to "filter_v2" in setup.py HOT 2
- Not Working Correctly With Qcon Pro G2 HOT 5
- Output Multi-Channel VU HOT 4
- Support OBS websocket authentication HOT 5
- Source Group Folder Support HOT 1
- An update for the new obs websocket?? HOT 2
- How to uninstall on MacOS? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miditoobs.