<commit_before>#!/usr/bin/env node

var prefix= "o2a"; 
// OSC: /o2a/(universe)/(channel) value
/*
Universe in decimal!
Subnet: first 4 bits
Universe: last 4 bits

Example: Subnet 1 (0x1) DMX-Universe 0 (0x0) = 0x10 = 0d16 = Dezimal 16
*/
//Set up Artnet
var art_options = {
	
}
 
var artnet = require('artnet')(art_options);
 
// Create an osc.js UDP Port listening
var osc = require("osc");
var udpPort = new osc.UDPPort({
    localAddress: "0.0.0.0",
    metadata: true
});

// Open the socket.
udpPort.open();

// When the port is read, send an OSC message to, say, SuperCollider
udpPort.on("message", function (oscMsg) {
    //Split String
	var uri_parts=oscMsg.address.split('/');
	//Check for Prefix
	if ((typeof uri_parts[1] !== 'undefined')&&(uri_parts[1]==prefix)) {
		//Check for valid Universe
		if ((typeof uri_parts[2] !== 'undefined')&&(parseInt(uri_parts[2])>=0 && parseInt(uri_parts[2])<256)) {
			var universe=parseInt(uri_parts[2]);
			//Check for valid Channel
			if ((typeof uri_parts[3] !== 'undefined')&&(parseInt(uri_parts[3])>=0 && parseInt(uri_parts[3])<512)) {
				var channel=parseInt(uri_parts[3]);
				//Check for valid Value
				if ((typeof oscMsg.args[0].value !== 'undefined')&&(!isNaN(oscMsg.args[0].value))) {
					var value=parseInt(oscMsg.args[0].value);
					if(value>=0&&value<256) {
						console.log("SendArtnet: U"+universe+" Ch."+channel+" Val."+value);
						//Send ArtNet
						artnet.set(universe, channel,  value, function (err, res) {
						
						});
					}
				}
			}
		}
	}
});<commit_msg>Works with hardcoded universe<commit_after>#!/usr/bin/env node

var prefix= "o2a";
// OSC: /o2a/(universe)/(channel) value
/*
Universe in decimal!
Subnet: first 4 bits
Universe: last 4 bits

Example: Subnet 1 (0x1) DMX-Universe 0 (0x0) = 0x10 = 0d16 = Dezimal 16
*/
//Set up Artnet
//Load dmxnet as libary
var dmxlib=require("dmxnet");
//Create new dmxnet instance
var dmxnet = new dmxlib.dmxnet({});
//Create new Sender instance
var sender=dmxnet.newSender({ip:"255.255.255.255",subnet:1,universe:0,net:0});

// Create an osc.js UDP Port listening
var osc = require("osc");
var udpPort = new osc.UDPPort({
    localAddress: "0.0.0.0",
    metadata: true
});

// Open the socket.
udpPort.open();

// When the port is read, send an OSC message to, say, SuperCollider
udpPort.on("message", function (oscMsg) {
    //Split String
	var uri_parts=oscMsg.address.split('/');
	//Check for Prefix
	if ((typeof uri_parts[1] !== 'undefined')&&(uri_parts[1]==prefix)) {
		//Check for valid Universe
		if ((typeof uri_parts[2] !== 'undefined')&&(parseInt(uri_parts[2])>=0 && parseInt(uri_parts[2])<256)) {
			var universe=parseInt(uri_parts[2]);
			//Check for valid Channel
			if ((typeof uri_parts[3] !== 'undefined')&&(parseInt(uri_parts[3])>=0 && parseInt(uri_parts[3])<512)) {
				var channel=parseInt(uri_parts[3]);
				//Check for valid Value
				if ((typeof oscMsg.args[0].value !== 'undefined')&&(!isNaN(oscMsg.args[0].value))) {
					var value=parseInt(oscMsg.args[0].value);
					if(value>=0&&value<256) {
						console.log("SendArtnet: Ch."+channel+" Val."+value);
						//Send ArtNet
						sender.setChannel(channel, value);
					}
				}
			}
		}
	}
});
{'fraction_non_alphanumeric': 0.18346900438321853, 'fraction_numerical': 0.03412648716343143, 'mean_word_length': 3.9153846153846152, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1099138', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1174, 'n_words': 273}