[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Aw: [sc-users] Regexp with incoming OSC



there are no doubt much more elegant ways of achieving this, but hee are some ideas
 
 
(
var msg = "value=200 valueB=300 valueC=400";
msg.findRegexp("value")
)

(
var msg = "value=200 valueB=300 valueC=400";
msg.split($=)
)
(
var msg = "value=200 valueB=300 valueC=400";
msg.split($=).collect(_.split($ )).flatten(1)
)
(
var msg = "value=200 valueB=300 valueC=400";
msg.split($=).collect(_.split($ )).flatten(1).asDict
)

(
var msg = "value=200 valueB=300 valueC=400";
var dict = msg.split($=).collect(_.split($ )).flatten(1).asDict;
dict.keysValuesDo{|k,v| "%: %\n".postf(k, v.asInteger)}
)
 
cheers,
eddi
__
https://soundcloud.com/all-n4tural
https://alln4tural.bandcamp.com/album/mix-root-gumbo
 
_______________________________________________ sc-users mailing list info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx archive: https://listarc.bham.ac.uk/marchives/sc-users/ search: https://listarc.bham.ac.uk/lists/sc-users/search/