16bit artnet in MadRouter?
  • sorenknud
    junior Member
    Posts: 3
    Joined: Tue Dec 22, 2015 1:09 am

    16bit artnet in MadRouter?

    by sorenknud » Mon Jan 04, 2016 1:24 am

    Can anyone help me with a Python script for MadRouter that can take some 16bit artnet channels and convert to OSC floats? I think the math is pretty simple: take the Fine channel, divide it with 256 and add it to the Coarse channel, then you have the 16bit value. But how do I write it for MadRouter? Thanks a lot! :)

    /Soren
  • mad-matt
    garageCube team
    Posts: 794
    Joined: Mon Sep 09, 2013 5:50 pm

    Re: 16bit artnet in MadRouter?

    by mad-matt » Wed Jan 06, 2016 12:28 pm

    Two options, those ones are forwarding the 10 first DMX 16 bits channels to OSC

    Without script:
    Source URL = "/dmxin/ArtNetIn-0-0/[1-10][16]"
    Target URL = /osc/MadRouterOscOut/channel[1-10]

    With script:

    Code: Select all

    def artNet16BitsToOSC():
      for chIdx in range(1,10):
        chValue = mad.getChannelValue( "/dmxin/ArtNetIn-0-0/" + str(chIdx*2) + "[16]");
        mad.setChannelValue("/osc/MadRouterOscOut/channel" + str(chIdx*2), chValue);

    mad.connect("onLoop()", artNet16BitsToOSC);

    Let me know

Who is online

Users browsing this forum: mad-matt and 2 guests