Panasonic Mixer Control

steve holmes's picture

Well after a bit of a false start and some stupid errors of mine dealing with Hex data I finally have a composition that can be used to control a AVE-55 and I am pretty sure will work on most panasonic mixers with serial input. Thanks to Toby Sparks for the Javascript work for ASCII Hex conversion, which works great. The patch can change sources on the A and B bus has a take button as well as a mixer position which is setup for a number range 0-1 for control from VDMX.

The last bit of the puzzle I could do with help with is the javascript patch for decimal hex conversion, for this to work well I need to pad the value so the HEX value is digit, digit (00, 01, 02,3 etc)

Currently I have

function (__string Hex) main (__number d)
{
var result = new Object();
result.Hex=d.toString(16).toUpperCase();
   return result;
}

This works but for the first 10 items it only produces a single digit, so I am trying to get this to work

function decimalToHex(d, padding) {
   var hex = parseInt(d, 16);
   padding = typeof (padding) === "undefined" || padding === null ? padding = 2 : padding;
 
   while (hex.length < padding) {
       hex = "0" + hex;
   }
 
   return hex;
}
 
function (__string outputString) main (__number inputDecimal)
{
   var result = new Object();
   result.outputString = decimalToHex(inputDecimal, 0);
   return result;
}

This doesn't work and produces nothing, if anyone can get this to work I would greatly appreciate it. Hopefully someone might find this patch usefull. Cheers Steve

PreviewAttachmentSize
panasonic mixer control.qtz16.72 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
Re: Panasonic Mixer Control

var result = new Object();
function (__string stuff) main (__index number)
{
   result.stuff = number.toString(16);
   if(result.stuff.length < 2)
      result.stuff = "0"+result.stuff;
   return result;
}

steve holmes's picture
Re: Panasonic Mixer Control

Thank so much for that it works brilliantly. I was wondering where is the best place to put little macro patches like the Ascii to Hex and decimal to Hex patch, I was thinking I would put them on Quartz Compositions but that does seem to be used much now, what are peoples thoughts, it would be good to keep useful patches in one place. Cheers Steve

dust's picture
Re: Panasonic Mixer Control

im all giving advice on the qc list seems you got things sorted over here.