From 138fdcc886bdfb33f0cbad557c88082de0cb8e03 Mon Sep 17 00:00:00 2001 From: Jano Svitok Date: Fri, 10 Mar 2017 21:49:22 +0100 Subject: [PATCH] Docs: add note about generating OSC profile with ruby. Based on http://www.qlcplus.org/forum/viewtopic.php?p=47051#p47051 --- resources/docs/oscplugin.html | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/resources/docs/oscplugin.html b/resources/docs/oscplugin.html index 540c96bda1..a088a12190 100644 --- a/resources/docs/oscplugin.html +++ b/resources/docs/oscplugin.html @@ -70,5 +70,38 @@

Controllers

+
+ +

Advanced: Generating profile programmatically

+ +

WARNING: Consider this part as "unofficial". There is no guarantee that it will work. It may stop working at any time!!!

+ +

It is possible to generate channels for profile programmatically. It may prove useful e.g. when generating profile with +lots of similar channels. For start, manually (using QLC+ wizard) create some channels, and then open the profile in a text editor, +and add the rest of the channels.

+ +

Sample code in ruby: Install digest-crc gem by running: + +

+gem install digest-crc
+
+ +Script: + +
+require 'digest/crc16_qt'
+dig = Digest::CRC16QT.new
+dig << ARGV[0]
+crc = dig.checksum
+puts %[ <Channel Number="#{crc}">]
+puts %[  <Name>#{ARGV[0]}</Name>]
+puts %[  <Type>Button</Type>]
+puts " </Channel>"
+
+ +Use: +
ruby ./crc.rb /myoscmessage
+ +

(Hint contributed by padide.)

- \ No newline at end of file +