View Single Post
Old 10-15-2020, 04:27 AM   #8
Florian.S
Human being with feelings
 
Florian.S's Avatar
 
Join Date: Jul 2020
Location: Ger
Posts: 8
Default

I've managed to get it working.

Probably it is not a good written Script. But maybe someone is willing to help me clean it up and do it "the right" way.
Code:
@input DAW_Reaper OSC „localhost:9001“ //9001 osc out port from reaper
@output Reaper OSC    "127.0.0.1:9000" // 9000 osc in port to reaper
@output Companion OSC „localhost:12321“ //12321 osc in port to companion


@init
//Setup:
send2page2 = "s/style/text/2/";
send2page3 = "s/style/text/3/";
last_t =time;
time_w = 10;
marker_count = 24;
printf("Reaper to Companion Markername transition script");

@oscmsg

oscmatch("/oscii/refresh/",$'s') ? ( 				// If Osc Input String matches "/oscii/refresh/"
	printf("oscii/refresh/");
	oscsend(Reaper, "i/device/marker/count", 0); 		// Setting Marker Count of Reaper to 0
	sleep(1);
	oscsend(Reaper, "i/device/marker/count", marker_count);	// Setting Marker Count of Reaper to specified marker amount. 
);

oscmatch("/marker/*",$'s') ? (	
	strcpy(send2page2, "s/style/text/2/"); 			// Resetting the string of "send2pagexy" for not getting broken later in the script 
	strcpy(send2page3, "s/style/text/3/");
	oscmatch("/marker/*/name",$'s') ? (
	val = null; #string = null;
			oscparm(idx,type);
			type=='s' ? (
				oscparm(0,'s',#string);
				strcpy(#a, #string);
			);
		);

	oscmatch("/marker/*/number/str",$'s') ? (
		val = null; #string = null;
			oscparm(idx,type);
			type=='s' ? (
				oscparm(0,'s',#string);
				strcpy(#b, #string);
			);
			strcat(send2page2,#b);
			strcat(send2page3,#b);
			oscsend(Companion, send2page2, #a);
			oscsend(Companion, send2page3, #a);
		);
	);
@timer
time >= last_t + time_w ? (					// Making Reaper reaper resend the marker names	regularly 					oscsend(Reaper, "i/device/marker/count", 0); 			// Setting Marker Count of Reaper to 0
sleep(1);
oscsend(Reaper, "i/device/marker/count", marker_count);		// // Setting Marker Count of Reaper to specified marker amount. 
last_t += time_w;
);
Florian.S is offline   Reply With Quote