Passing the names of variables (not values) from lua > sc

I have a number of variables set in my sc engine, and i’d like to be able to switch between them dynamically from my lua script. is this possible? how can i go about doing this?

For example, I can pass variable values like so:

	this.addCommand(\fm_sine_synth1_pan, "f", {
		arg msg;
		fm_sine_synth1.set(\pan, msg[1]);
	});

example variables i want to switch in sc:

//pulse
env_ping = Env([0, 1, 0, 1, 0, 1, 0], [0.01, 0.1, 0.01, 0.1, 0.01, 0.1], releaseNode: 4, loopNode: 1);			
//drone
env_drone = Env([0, 1, 0, 0.2, 0, 0.5, 0.8, 0], [3, 5, 3, 2, 3, 1, 0.8], releaseNode: 5, loopNode: 1);

totally possible. check out https://github.com/northern-information/dronecaster to see how we did it there

2 Likes

Thank you! Once I figure it out I’ll reply here for posterity :blush: