Active Channel Number

I've built a lighthack for my Nomad and it's working really well. It would be really useful to be able to display the active channel number too - does anyone know if this would be possible?

Parents Reply Children
  • Well... that almost worked!

    If a channel is unpatched or is patched as a generic "Dimmer" or with a Type of "Fresnel" or "Profile" or "Parcan" then "/eos/out/active/chan" is the channel number and is displayed on the Lighthack display as a string of numerals. However, if the Type is anything more complex or the channel has a Label then two strange symbols are displayed on the Lighthack display even though "/eos/out/active/chan" is shown correctly in the Diagnostics Tab.

    I eventually tracked this behaviour down to the size of the chanMessageRaw array. The array is too small at 32 if the Type and Label combined are greater that 32 characters. Everything seemed to work correctly with the array at 96, so I erred on the side of caution and made it 128. I assigned chanMessageRaw to a new string variable, chanMessageFullString, and then set chanMessage as a 4 character substring 'cause Nomad will never use more than a 4 digit channel number.

    I hope this might be useful for someone else - but I could NEVER have got there without your initial work on this, so a big thank you!

    Here's my modified code: 

    Global Variables

    String chanMessage; // for the channel message
    String chanMessageFullString;
    parseMsg = "/eos/out/active/chan";
    if (msg.indexOf(parseMsg) != -1) {
    char chanMessageRaw [128]; // size is max 32 chars
    oscmsg.getString(0, chanMessageRaw, 128); // size is max 32 chars
    chanMessageFullString = String();
    chanMessageFullString = chanMessageRaw;
    chanMessage = String();
    chanMessage = chanMessageFullString.substring(0,3);
    connectedToEos = true;
    updateDisplay = true;
    parseMsg = String();
    return;
    }
  • As a hint the string send by eos is formatted in following way:
    <channel selection><space><[><value><]><space><type>
    To get only the selection, which can contain more than one channel, search for the first occurrence of the space char (' ') and take the string before.