Forums > Javascript

i do not understand getvalueof

March 22, 2010 | 4:04 pm

i have a few live objects in my patch. i want to grab their values for initialization from within a js

how do i define getvalueof? how do i accomplish what i am attempting with the code below? (i am unclear about how pattrs should be involved as well.)

function initialize() {
	var _mWidth = this.patcher.getnamed("clipstepMonomeWidth");
	var _mHeight = this.patcher.getnamed("clipstepMonomeHeight");
	var _scale = this.patcher.getnamed("clipstepScale");
	var _velocity = this.patcher.getnamed("clipstepVelocity");
	var _noteLength = this.patcher.getnamed("clipstepNoteLength");
	var _cycles = this.patcher.getnamed("clipstepCycles");
	var _rootNote = this.patcher.getnamed("clipstepRootNote");

	monomeWidth = _mWidth.getvaleof();
	monomeHeight = _mHeight.getvalueof();
	buildMonome();
	newNoteVelocity = _velocity.getvalueof();
	newNoteLength = _noteLength.getvalueof();
	cycles = _cycles.getvalueof();
	rootNote = _rootNote.getvalueof();

	post("gs.ClipStepSequencer finished loadingn");
}

March 22, 2010 | 8:58 pm

For anyone else, the solution is to bind a pattr to an object (live.numboxes in my case) and then use the getnamed method above on the PATTR.

i bound using the middle outlet, but i imagine that that is immaterial.

you do not need to define a getvalueof or setvalueof method if all you are doing is accessing objects in the patch.


Viewing 2 posts - 1 through 2 (of 2 total)