LoginSignup
0
1

More than 1 year has passed since last update.

Pythonで Art-net 出力

Last updated at Posted at 2022-07-31

Pythonで Art-net 出力が 出来ました

python-Raspberry-out.png

まだ全ソース公開出来るほど整理できていませんが、一部だけ公開します。
(参考サイトも調べて、追記予定です)

def pack_put():
    #player.note_on(64, 127)
    #1  ID[8]  Int8  -  Array of 8 characters, the final character is a null termination. 
    #                   Value = puthon ‘A’ ‘r’ ‘t’ ‘-‘ ‘N’ ‘e’ ‘t’ 0x00 
    packet.extend(map(ord, "Art-Net"))
    packet.append(0x00)          # Null terminate Art,-Net

    #2  OpCode  Int 16  -  The OpCode defines the class of data following 
    #                      ArtPoll within this UDP packet. 
    #                      Transmitted low byte first. See Table 1 for the 
    #                      OpCode listing. Set to OpPoll. 
    packet.extend([0x00, 0x50])  # Opcode ArtDMX 0x5000 (Little endian)

    #3  ProtVerHi  Int8  -  High byte of the Art-Net protocol revision number. 
    packet.append(0x00)          # Null terminate Art-Net
 
   #4  ProtVerLo  Int8  - Low byte of the Art-Net protocol revision number. 
    #                      Current value 14. Controllers should 
    #                      ignore communication with nodes using a protocol version lower than 14.  
    #packet.extend([0x00, 0x0e])  # Protocol version 14
    packet.append(0x0e)           # Protocol version 14
    packet.append(0x1f)           # Protocol version 14
    packet.append(0x00)           # Protocol version 13
    packet.append(DMX_Universe)   # Protocol version 14
    packet.append(0x00)           # Protocol version 15
 
    #5  TalkToMe  Int8  -  Set behaviour of Node 
    #   7-5  Unused, transmit as zero, do not test upon receipt.  __sequence_counter)  Sequence, 
    #   4   0 = Enable VLC transmission. 
    #       1 = Disable VLC transmission. 
    #   3   0 = Diagnostics messages are broadcast. (if bit 2). 
    #       1 = Diagnostics messages are unicast. (if bit 2). 
    #   2   0 = Do not send me diagnostics messages. 
    #       1 = Send me diagnostics messages. 
    #   1   0 = Only send ArtPollReply in response to an ArtPoll or ArtAddress. 
    #       1 = Send ArtPollReply whenever Node conditions change. This selection allows the 
    #           Controller to be informed of changes without the need to continuously poll. 
    #   0   0 = Deprecated.  
    packet.append(0x02)                 # Physical

    #6  Priority  Int8  -  The lowest priority of diagnostics message that should be sent. See Table 5. 
    packet.append(0x00)

    #with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp:

参考文献

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1