Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when calling lineAt or xlineAt on a NodeProxy #13

Open
hbeere opened this issue Apr 17, 2019 · 1 comment
Open

Bug when calling lineAt or xlineAt on a NodeProxy #13

hbeere opened this issue Apr 17, 2019 · 1 comment

Comments

@hbeere
Copy link

hbeere commented Apr 17, 2019

The method fails when I call it. Tracing the bug, xlineAt() calls performAtControl(), where at line 131 there is this code:

keys.do { arg key, i;
    var val = nodeMap.settings[key];
    val !? {
        val = val.getValue;
        val !? { startLevels[i] = val };
        bundle = bundle.addAll([key, ctlIndex + i]);
    }
};

"settings" doesn't exist on nodeMap, so this fails. This is my fix:

keys.do { arg key, i;
    var val = nodeMap.at(key);      // here is the bug fix
    val !? {
        // val = val.getValue;      // get rid of this line, too
        val !? { startLevels[i] = val };
        bundle = bundle.addAll([key, ctlIndex + i]);
    }
};
@adcxyz
Copy link
Contributor

adcxyz commented Aug 4, 2021

@hbeere - thanks for the proposal, your fix is an improvement!

I did some more tests which reveal more related problems,
@telephon, could you take a look?

Ndef(\x).clear;

Ndef(\x, { SinOsc.ar(\freq.kr(200) + [0, 0.2]) * 0.1 }).play;

Ndef(\x).set(\freq, 400);
Ndef(\x).set(\freq, 600);

Ndef(\x).lineAt(\freq, 800, 1); // goes from resetted value 200 to 800
Ndef(\x).xlineAt(\freq, 300, 1); // goes from 

//// issue 1: 
Ndef(\x).unset(\freq); // does not go back to 200
Ndef(\x).xlineAt(\freq, 400, 1); // but this goes from default val 200 to 400

// issue 2: fails when control was mapped:
Ndef(\f, { SinOsc.kr(3).range(200, 500) });
Ndef(\x).play.set(\freq, Ndef(\f));
// stays on sinosc and only jumps to goal at the end
Ndef(\x).lineAt(\freq, 500, 1);


// issue 3: lineAt, xLineAt do not work for array values
// set does work for array values:
Ndef(\x, { SinOsc.ar(\freq.kr([200, 300])) * 0.1 }).play;
Ndef(\x).set(\freq, [400, 500]);
Ndef(\x).set(\freq, [600, 700]);

// only sets the first value, second stays where it is:
Ndef(\x).lineAt(\freq, [800, 900], 1); 
Ndef(\x).xlineAt(\freq, 300, 1); 

/// issue 4: mapping an ndef control to a multichannel bus does not work
b = Bus.control(s, 2);
b.set(300, 400);
b.get;
Ndef(\x).set(\freq, [200, 300]).play;
Ndef(\x).set(\freq, b).play; // only sets one value, not two?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants