i do not understand getvalueof

Griotspeak's icon

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");
}
Griotspeak's icon

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.