Soudflow triggers via OSC to Bitfocus Companion
Hi,
I am new here and I have a problem that some of you may be able to help me with.
I would like to connect Soundflow and BitFocus Companion, both running on different computers. Soundflow is running on my Mac and BitFocus Companion is running on a Windows PC. Both computers are connected via network. I would like to trigger BitFocus Companion with Soundflow so that I can trigger the commands in BitFocus Companion.
BitFocus Companion supports OSC, as does Soundflow. But unfortunately I don't know how to code the OSC command in Soudflow so that it works and is recognized by Bitfocus Companion.
I don't know how to code and never have. I found some code on the forum, but it doesn't work. I also haven't worked with OSC before, so I'm a bit lost right now. Here is the code I found:
sf.osc.sendMessage({
host: '127.0.0.1',
port: 9000,
oscAddress: '/style/bgcolor/1/6',
arguments: [
{ type: 'Int', value: 255 },
{ type: 'Int', value: 0 },
{ type: 'Int', value: 0 },
],
});
I changed that into this because I don’t have RGB-values. I want to get a functon from a button:
sf.osc.sendMessage({
host: '127.0.0.1',
port: 9000,
oscAddress: '/press/bank/1/1‘,
});
Have someone of you any idea how I can solve this or do you know another way?
Thank you for your help!
Jan
- Christian Scheuer @chrscheuer2023-06-22 19:16:49.011Z
Hi Thomas,
You'd have to change the IP address and port to the corresponding IP address + port of the machine where you're running Bitfocus.
- TThomas Tom @Thomas_Tom
Hi Christian,
thank you for your reply. I had changed the IP address and port to the corresponding IP address and port, but nothing happend.
Here is the code:
sf.osc.sendMessage({
host: '192.168.1.69',
port: 12321,
oscAddress: '/press/bank/1/9 1‘,
});In Bitfocus Companion I have activated the OSC Listener function and I use the port specified there.
Is it possible to trigger with Soundflow Bitfocus Companion or do I need an additional program in between?
Thank you for your help!
ThomasChristian Scheuer @chrscheuer2023-06-23 10:10:55.573Z
Hi Thomas,
It looks like you're trying to send to an osc address of
/press/bank/1/9
with the integer value1
. You'd have to program that like this:sf.osc.sendMessage({ host: '192.168.1.69', port: 12321, oscAddress: '/press/bank/1/9', arguments: [ { type: 'Int', value: 1 }, ], });
- TThomas Tom @Thomas_Tom
Hi Christian,
thank you for your help! Now, it is working. I have only one little thing. The integer value 1 is the command to press the button and hold it.
That's what the button is doing now. But I would like that after I have released the button, the button is also not pressed anymore.
That would be this command in Bitfocus: /press/bank//
How can I combine this with your script?
Do you know what i mean?
Christian Scheuer @chrscheuer2023-06-23 13:04:17.311Z
Yes, you'd just fire two commands then:
sf.osc.sendMessage({ host: '192.168.1.69', port: 12321, oscAddress: '/press/bank/1/9', arguments: [ { type: 'Int', value: 1 }, ], }); sf.osc.sendMessage({ host: '192.168.1.69', port: 12321, oscAddress: '/press/bank/1/9', arguments: [ { type: 'Int', value: 0 }, ], });
Christian Scheuer @chrscheuer2023-06-23 13:06:29.666Z
This could also be written as:
function sendOnOffMessage(address) { var host = '192.168.1.69'; var port = 12321; sf.osc.sendMessage({ host: host, port: port, oscAddress: address, arguments: [ { type: 'Int', value: 1 }, ], }); sf.osc.sendMessage({ host: host, port: port, oscAddress: address, arguments: [ { type: 'Int', value: 0 }, ], }); } sendOnOffMessage('/press/bank/1/9');
- TThomas Tom @Thomas_Tom
Hi Christian,
thank you for the two scripts, but both don´t work. I dont know why.
The individual commands work on their own, only when they are put together, it no longer works.Do you have any idea? Is it possibly due to Bitfocus Companion?
Christian Scheuer @chrscheuer2023-06-23 15:18:30.908Z
That's possibly because Bitfocus registers it as a "fluke" because the commands are sent immediately after each other. You could experiment with inserting a wait in between the on/off commands
- TThomas Tom @Thomas_Tom
Hi Christian,
now it works better with the wait command, but still not perfect.
It triggers the Release command after the end of the time, although I still press the button.Is there a code where I define that it triggers the first command of Bitfocus when pressing down and holding the stream deck button ?
And the same for releasing the button ?The button should be a talkback. If it is pressed, I can talk, if it is no longer pressed, I can no longer talk.
Thank you for your help!
Christian Scheuer @chrscheuer2023-06-23 16:02:21.122Z
Oh okay, no there's no way to code that today without the help of a meta command (which is something our team or app developers needs to build).