Audio Jacks and cable information

Post Reply
drøhn C
Posts: 1
Joined: Wed Jun 30, 2021 2:26 pm

Audio Jacks and cable information

Post by drøhn C » Wed Jun 30, 2021 2:39 pm

If a module contains several input and output jacks, is it possible to obtain the information which one of them are currently connected by a common cable?
For example: the module has three inputs "in1", "in2" and "in3" as well as three outputs "out1", "out2" and "out3". How to detect that user connected "out2" to "in3"?

The VoltageAudioJack objects seem not to offer any methods for this, and the events do not provide enough information either.
(In fact the cable ID in there is always 0, there is only the "clicked" VoltageAudioJack passed as first parameter "component". Even more confusing: connecting a jack sends both a "connect" event as well as an "disconnect" event at the same time...)
Last edited by drøhn C on Fri Jul 02, 2021 10:24 am, edited 1 time in total.

User avatar
honki-bobo
Posts: 170
Joined: Sat Nov 09, 2019 1:18 pm

Re: Audio Jacks and cable information

Post by honki-bobo » Wed Jun 30, 2021 6:51 pm

My first idea was to use the SetUserProperty and GetUserProperty methods of the VoltageComponent class. Both, VoltageAudioJack and VoltageAudioCable extend this class. So you could add the jack as a property to the cable.

But, as you already mentioned, there is no way (at least that I know of) to get the cable as an object and use it in the code. I've just made a quick check and can confirm that the cable ID that is supposed to be passed as longValue with the Jack_Connected and Jack_Disconnected notifications is always 0. I suppose this is a bug. Could someone @cherryaudio confirm this?

Besides that, a Jack_Connected notification only occurs with the first cable connected to a jack, and similarly a Jack_Disconnect notification only occurs when the last cable is disconnected.

If somebody knows how to solve this. I'd be interested, too ;)

Best regards,
Martin
Image
Monkey Business Audio
Modules - Forum

ColinP
Posts: 171
Joined: Mon Aug 03, 2020 7:46 pm

Re: Audio Jacks and cable information

Post by ColinP » Mon Jul 05, 2021 2:57 pm

Hi Martin,

Where is the VoltageAudioCable class you mentioned? I can't find it in the API.

User avatar
honki-bobo
Posts: 170
Joined: Sat Nov 09, 2019 1:18 pm

Re: Audio Jacks and cable information

Post by honki-bobo » Mon Jul 05, 2021 3:12 pm

Download the Voltage Module Designer - Development Kit from your Library and unpack it. You will find the API documentation in Documentation/JavaDocs/voltage/core/VoltageAudioCable.html
Image
Monkey Business Audio
Modules - Forum

creart
Posts: 39
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: Audio Jacks and cable information

Post by creart » Mon Jul 05, 2021 5:02 pm

I guess there's also not a way to disconnect a cable using Java is there?

ColinP
Posts: 171
Joined: Mon Aug 03, 2020 7:46 pm

Re: Audio Jacks and cable information

Post by ColinP » Mon Jul 05, 2021 5:37 pm

Thanks for that info Martin.

@creat and everyone else, unfortunately it looks like all VoltageAudioCable adds is a GetValue() SetValue() method pair.

In an ideal world the sockets interface would expose the collection of cable objects connected to a socket, a means of disconnecting the cables and possibly even a means of making new connections (this being the most tricky).

Cable objects would have an interface that included get methods for the module package name, instance number and socket name at the other end of the cable.

Also this would be the place for reading and writing cable colors! And maybe customizing marching ant animation.

Ultimately a Cable class could perhaps also implement a "meta message" system where data other than the core value could be exchanged between modules as an option.

In a far off place one might imagine auto connection mechanisms where a manufacturer could say that socket A of module B should automatically connect to socket C of all modules of type D then send a meta message E and maintain the connection if it gets a reply of F.

creart
Posts: 39
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: Audio Jacks and cable information

Post by creart » Thu Jul 15, 2021 3:40 pm

Ya Colin..wishful thinking....

Post Reply