Closed guyfawcus closed 7 years ago
This could also potentially be used for client/server communication which was brought up in issue #4 specifically @covarianttensor's comment
Mmm, can you explain what you're envisioning when you ask for support for this? I'm having difficulty understanding what it might be useful for in the context of this application as we work with arbitrary audio clips rather than midi/notations, which is what this mostly seems focused on.
I'll keep it in mind. There's gonna be a big update to the sound board in about a day. I'll focus on new features after that.
Sorry, didn't give much context with that, was a bit of a brain dump before I forgot!
OSC is way past MIDI in it's capabilities, it can even be used in QLC+ (Ahem, Noah π) to trigger lighting scenes.
To be honest, this is mainly because I'm currently working on a Python3 project (which I plan on uploading to GitHub within a week) that can take either user-input on the keyboard or a serial string from an Arduino or something (for physical buttons) then generates OSC messages which are read by the cueing software I use at work (QLab - I'm a sound engineer) to trigger sound-effects. This could then be used in conjunction with CasterSoundboard, press a button that's hooked up to a micro and one of the cues would play.
It could be as simple as '/CasterSoundboard/<tab-name>/<key-sound-is-triggered-with>/<command>'
so '/CasterSoundboard/unfilter/h/play'
would trigger the Obama "Hey!" clip.
Okay so I've been looking into this some more and THIS IS A MUST HAVE feature. I will add an OSC server to CasterSoundboard after I add audio ducking. Can you refer me to software/scripts I can use to generate OSC messages, so I can test against CasterSoundboard?
Update: I think I already found I library I can use: https://github.com/MugenSAS/osc-cpp-qt
@maelstrom59 I'm already working on adding OSC support as I type this. The soundbaord can now receive messages or bundles.
Good stuff! π
In regards to scripts for testing, there are a few options but I usually find it easier to just do it from scratch in Python 3 using python-osc.
Install it using:
pip3 install python-osc
In-keeping with my example above:
#!/usr/bin/env python3
from pythonosc import udp_client
client = udp_client.SimpleUDPClient('127.0.0.1', 54321)
client.send_message('/CasterSoundboard/unfilter/h', 'play')
would send the play
command to the h
key.
To emulate the server side (only for completeness of this example, you can obviously skip this step if you've already got one going in CasterSoundboard!):
#!/usr/bin/env python3
from pythonosc import dispatcher
from pythonosc import osc_server
def do_thing(addr, val):
print('Address:', addr)
print('Value:', val)
if addr == '/CasterSoundboard/unfilter/h' and val == 'play':
print('Hey!')
dispatcher = dispatcher.Dispatcher()
dispatcher.map('/CasterSoundboard/unfilter/h', do_thing)
server = osc_server.ThreadingOSCUDPServer(('127.0.0.1', 54321), dispatcher)
server.serve_forever()
would print:
Address: /CasterSoundboard/unfilter/h
Command: play
Hey!
when it received a message from the first script.
Just watched the latest JB video - Studio Tour Quickie // VLOG 45 and noticed the Linux powered sound desk Chris has been talking about, it's the Behringer X32.
I'm already somewhat familiar with it as I've come across it before at work and knew about X32 Edit (the controller software) because of it's Linux compatibility but I did a bit more research and guess what protocol the software uses to control the desk... π
Also offered is a separate remote editor running on host computers that will allow for complete editing control of the X32 via Ethernet. Check out behringer. com for more information.
Tip: The X32 remote communication is OSC-based (open sound control) and we will share the protocol on our website, allowing developers to design their own control software. Stay tuned to behringer.com for details on the OSC protocol.
Yup, that's right, you could (implementation dependant) potentially control the desk with CasterSoundboard and vice versa! Something like, when a clip is playing, mute the Mumble room channel, or, configure a button on the desk to trigger a clip.
At the very least, you could grab the OSC bindings for your favourite programming language and control the soundboard and the desk using similar commands. Wink wink JBot @rikai @ChrisLAS @dominickm
There isn't much in the manual about the commands but the MUSIC Group wiki (which could do with some work...) has a load of information about it: http://behringerwiki.music-group.com/index.php?title=OSC_Remote_Protocol
I've made CasterSoundBoard print all osc direct message commands sent to it, we can find out what messages are sent that way. Right now, I have one-way OSC control working, currently working on two-way control to make things like TouchOSC work with CasterSoundboard.
I'm not done, but would you be willing to test what I have so far @maelstrom59 ? I'll commit what I have to the development branch.
OSC Message Format (ONE-WAY):
/castersoundboard/board/<board-name>/player/<player-name>/modify/<interface-name> <value>
Examples:
ADDRESS:
/castersoundboard/board/No
Name/player/,/modify/track_position
VALUE (float):
0.5
ADDRESS:
/castersoundboard/board/No
Name/player/W/modify/volume
VALUE (float):
0.9
ADDRESS:
/castersoundboard/board/No
Name/player/G/modify/loop_state
VALUE (int):
0
ADDRESS:
/castersoundboard/board/No
Name/player/G/modify/loop_state
VALUE(int):
1
ADDRESS:
/castersoundboard/board/No
Name/player/D/modify/play_state/play
VALUE (int):
1
ADDRESS:
/castersoundboard/board/No
Name/player/D/modify/play_state/pause
VALUE (int):
1
ADDRESS:
/castersoundboard/board/No
Name/player/D/modify/play_state/stop
VALUE (int):
1
Code Example:
#!/usr/bin/env python3
from pythonosc import udp_client
client = udp_client.SimpleUDPClient('127.0.0.1', 5051)
client.send_message('/castersoundboard/board/No Name/player/,/modify/track_position', 0.5)
I will make the port changeable, but for now it's listening on port 5051 for OSC packets. Please don't judge what I have so far, as I am not done. I am just letting you preview it so I can get feedback from you. I will most likely be done with the full implementation in about two to three days from now.
Please build from the development branch and test @maelstrom59
Please be aware OSC commands print to the bottom status bar of Caster Soundboard and stay there for only half a second.
I will research the Behringer X32 and see how I can have it interface with CasterSoundboard.
This is awesome! Don't worry about me judging, I'm still pretty new to lower-level languages so you could probably hide a lot without me noticing π
I'd love to test it out but unfortunately it's failing to compile ColorConversion.cpp
for some reason:
Not sure why, considering it hasn't changed from the master branch. I've tried fixing it, got as far as this wiki page and started going down a rabbit hole. I'll keep trying to figure it out but would you mind having a look if you get the chance, I cant wait to try this!
Got it working! Albeit via an extremely hacky method - I just deleted the lines in the generated Makefile that referenced ColorConversion.cpp
and ColorConversion.o
under SOURCES
and OBJECTS
.
Definitely something that still needs investigating by someone with more knowledge in C++ than I, but in the meantime, I've got some stuff to play around with!
Hmm, weird, I've made no changes to that ColorConversion file.
I suspect this is being caused by differences in GCC versions handling things differently.
With a file loaded into cue 1, I tried all of your examples:
client.send_message('/castersoundboard/board/No Name/player/1/modify/track_position', 0.5)
client.send_message('/castersoundboard/board/No Name/player/1/modify/volume', 0.8)
client.send_message('/castersoundboard/board/No Name/player/1/modify/loop_state', 1)
client.send_message('/castersoundboard/board/No Name/player/1/modify/loop_state', 0)
client.send_message('/castersoundboard/board/No Name/player/1/modify/play_state/play', 1)
client.send_message('/castersoundboard/board/No Name/player/1/modify/play_state/pause', 1)
client.send_message('/castersoundboard/board/No Name/player/1/modify/play_state/stop', 1)
it's a great start for sure, I've already integrated it into the application I mentioned earlier (still planning to release it in a few days).
Just a couple of small issues though:
track_position
works fine but it's not always very useful. Maybe this could be renamed track_position_percent
and track_position
could still accept a float, but instead, it be used for the number of seconds into the track?
pause
and stop
both work but play
seems to start the track from the beginning rather than the location it was paused at. This would be fine if there was a resume
argument or something similar.
EDIT: Formatting and resume idea
track_position will be renamed to track_position_percent and I will add resume option to api.
Full open sound control implemented. Will document api in wiki soon. Can control with touchOSC. Sample layout added to repo.
Amazing! Thanks again for all your work on this π I'll get cracking on the wiki as soon as I can as well.
It'd be great to be able to trigger cues using OSC commands.
For the uninitiated, Open Sound Control (OSC) is sort of next-gen MIDI that runs over a network:
Similar software also utilises OSC: