Page 1 of 1

Fader value TCP command

PostPosted: Tue Dec 19, 2017 8:13 pm
by nathansaw
Hello,

I'm trying to control an audio system from WD. I've been successful in sending strings to trigger Boolean commands like play, stop, mute etc. However I would like to incorporate a volume fader on the WD page now. I was wondering how I could assemble a string that could incorporate a variable fader value. i'm quite new to WD so forgive my ignorance please.

More info on the audio control protocol here - http://q-syshelp.qschome.com/Content/Ex ... otocol.htm

The string format for triggering "buttons" is as follows - {ct AudioMute [CR LF]} - ct meaning "change trigger", AudioMute being the control name and carriage return/line feed. To change the fader's value I can do this in a number of ways, either send a dB value or a relative position if the fader from 0 to 1 (0db on the fader taper is roughly 0.75). Lets assume we use position, the string the audio system would need to see is {csp FaderName value [CR LF]}. Can you advise how to set this up?

Also, the next step would be to get bidirectional positions as their are other control methods (snapshots etc) in place for these values and it would be good to have the current value reflected on the WD page. The device will send the following in response - {cv "FaderName" "20.0dB" 20 1} - values are listed in 3 ways - value, string and position of the control. How would I process this data back into the fader on the WD page?

Hope this explanation is clear enough.

Thanks and best regards,
Nathan

Re: Fader value TCP command

PostPosted: Tue Dec 19, 2017 8:33 pm
by nathansaw
OK quick update.
I tried to put this together with nodes only and succeeded - see attached

Would still appreciate some help to get the response interpretation

Regards,
Nathan

Re: Fader value TCP command

PostPosted: Wed Dec 20, 2017 2:09 pm
by Thomas Mrozek
Hi Nathan,
to use responses you can go with the same setup you have - just inverted. The only thing is to change TCP Message Node to TCP Input Node.
cheers
Thomas

Re: Fader value TCP command

PostPosted: Thu Dec 21, 2017 5:40 am
by Dennis Kuypers
Hello Nathan,

there is a regex node that may help you. Do you know Regular Expressions (Regex)?

Dennis

Re: Fader value TCP command

PostPosted: Fri Dec 22, 2017 11:21 am
by nathansaw
Dennis Kuypers wrote:Hello Nathan,

there is a regex node that may help you. Do you know Regular Expressions (Regex)?

Dennis


Hi Dennis,
No, I've never used that. Do you have an example?

Regards
Nathan

Re: Fader value TCP command

PostPosted: Sat Dec 23, 2017 1:42 am
by Dennis Kuypers
Hey Nathan,

Regex allows you to find, replace or extract text. There are a lot of great resources online if you want to learn it.

If we want to turn We have 3 apples and 2 bananas into We have apples (3) and bananas (2) we could use a pattern of ([0-9]+) (\w+) and a replacement pattern of $2 ($1) (Try it out!)

For your task you basically define a rule to find the part that you need and then use a replacement pattern of $1.

Regards
Dennis