Old 12-09-2017, 10:10 AM   #1
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default Create variable from OSC

Source OSC command is "/track/%{trackNumber}d/volume" where trackNumber is an integer.
I want to store data into string.

With something like:

oscmatch("/track/%{trackNumber}d/volume", #command) ? (
oscparm(0,0,#value);
sprintf("track%dVolume", "Track %d volume is %s", trackNumber, trackNumber, #value);
);

The output for "/track/1/volume, 0.5" should be:
variable name - "track1Volume"
variable contents - "Track 1 volume is 0.5"
#command contents - "/track/1/volume"

Is it possible to generate variable names with sprintf? If yes, what would proper code look like? If not, what method should I use to generate variable name with format specifiers?
eval("track" + trackNumber + "volume");could be used in JS. What is my option with EEL2 in oscii-bot?
fundorin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.