Giter Club home page Giter Club logo

Comments (4)

theseanco avatar theseanco commented on May 28, 2024

Hmm. There's a little bit in the ProxySpace docs here about it under 'nodeproxy with numbers as input', but it doesn't seem to do what the document suggests it does...

What will using an array of proxies give you, just so I have an idea? e.g. why not just this:

(
~s0 = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
~s0.play;
~s1 = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
~s1.play;
// Then be able to change: 
~s0 = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);
)

from howto_co34pt_livecode.

pwqw avatar pwqw commented on May 28, 2024

Yes, nodeproxy with numbers as input isn't clear..
Array of proxies is more dynamically for control the volume with midi knobs, for example. Or iterate with a Task and changing randomly each node

// The initial solution is
p = ProxySpace.push(s.boot);
(
m = Dictionary.new;
m.add(\assign -> { |i, val| switch( i,
    0, { ~s0 = val },
    1, { ~s1 = val },
    2, { ~s2 = val },
    3, { ~s3 = val })
});

m.add(\play -> { |i| switch( i,
    0, { ~s0.play },
    1, { ~s1.play },
    2, { ~s2.play },
    3, { ~s3.play })
});

m.add(\set -> { |i, name, val| switch( i,
    0, { ~s0.set(name, val) },
    1, { ~s1.set(name, val) },
    2, { ~s2.set(name, val) },
    3, { ~s3.set(name, val) })
});
)
// Then..
m[\assign].value(0, { |freq=500, ffreq=120| SinOsc.ar(freq*[1,1.1], SinOsc.ar(ffreq, 0, pi), 0.2) });
m[\play].value(0);
m[\set].value(0, \freq, 400+100.rand2 );

from howto_co34pt_livecode.

theseanco avatar theseanco commented on May 28, 2024

Okay, finally getting back to this. The reason Proxies don't work in an array is because of this.

http://doc.sccode.org/Reference/NodeProxy_roles.html

You use the array indexes for performing various roles upon NodeProxies. Got tipped off about this recently by @datamads and @lvm

So, for example, if you wanted to add a effects to ~s you would use \filterIn

~s[0] = Pbind(\instrument,\default,\amp,0.3);
~s.play;
//add reverb
~s[1] = \filterIn -> {|in| FreeVerb.ar(in,0.6,0.9,0.2)};
//add delay to that
~s[2] = \filterIn -> {|in| CombC.ar(in,0.3,0.2,10)};
//change the wet/dry of `~s[2]` as CombC doesn't pass the original signal
~s.set(\wet2,0.5)

I'll be adding a section about this because it really changes how i've been using effects.

from howto_co34pt_livecode.

pwqw avatar pwqw commented on May 28, 2024

It is a good feature anyway!! 😃

For my part, I solved it using a ProxySpace in a variable, then building the Symbol, for ejample:

var func;

p = ProxySpace.new(s);

func = { |index| 
    var node = ("s" ++ index).asSymbol; // basically
	p[node] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
    p[node].play;
};

func.value(1);

Thanks a lot!

from howto_co34pt_livecode.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.