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

setProperties fails for plots of signals #1762

Closed
sleexyz opened this issue Dec 10, 2015 · 4 comments
Closed

setProperties fails for plots of signals #1762

sleexyz opened this issue Dec 10, 2015 · 4 comments
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs.
Milestone

Comments

@sleexyz
Copy link

sleexyz commented Dec 10, 2015

Plotter:setProperties works fine for plots of Arrays, Buffers, and Envs, but results in a noop for Functions.

Here's a snippet that demonstrates this bug:

// setProperties works for Array:plot
(
a = (0..31).plot;

a.setProperties(
    \plotColor, Color.blue,
    \backgroundColor, Color.black,
);
a.refresh;
);

// setProperties works for Buffer:plot
(
b =  Buffer.read(s, Platform.resourceDir +/+ "sounds/sinedpink.aiff");
)
(
a = b.plot;

a.setProperties(
    \plotColor, Color.blue,
    \backgroundColor, Color.black,
);
a.refresh;
);

// setProperties works for Env:plot
(
a = Env.perc.plot;

a.setProperties(
    \plotColor, Color.blue,
    \backgroundColor, Color.black,
);
a.refresh;
);


// But setProperties is a noop for Function:plot
(
a = {SinOsc.ar}.plot;

a.setProperties(
    \plotColor, Color.blue,
    \backgroundColor, Color.black,
);
a.refresh;
);

// However, plotMode works for Function:plot, for some reason:
(
a = {SinOsc.ar}.plot;

a.plotMode = \steps;
a.setProperties(
    \plotColor, Color.blue,
    \backgroundColor, Color.black,
);
a.refresh;
);
@sleexyz
Copy link
Author

sleexyz commented Dec 10, 2015

Running 3.7 latest build for OSX, on the supercollider homepage (as of 2015-12-10)

@telephon
Copy link
Member

Same here on master. Not immediately clear what it is.

@telephon telephon added the bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. label Dec 13, 2015
@telephon telephon added this to the 3.7.x milestone Dec 13, 2015
@telephon
Copy link
Member

When you resize the window, the colors are updated.

@telephon
Copy link
Member

Ah, ok: the plot is waiting for the waveform to be calculated when you set its properties. Once it has received them, it somehow uses the old ones. This works:

a = {SinOsc.ar}.plot;
// and then, separately:
(
a.setProperties(
    \plotColor, Color.blue,
    \backgroundColor, Color.black,
);
a.refresh;
);

telephon added a commit to telephon/supercollider that referenced this issue Feb 20, 2016
for function:plot this is done by initialising the plot instance before
it begins to wait for the server to send back the wave data. This fixes
supercollider#1762.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs.
Projects
None yet
Development

No branches or pull requests

2 participants