Skip to content

.add fails with SynthDefs containing > 255 controls #256

Closed
@jleben

Description

[Issue migrated from SourceForge | ID: 3498640 | Submitted by 'nobody']
[http://sourceforge.net/support/tracker.php?aid=3498640]

SynthDefs with > 255 Controls fail to be created when the .add method is used, due to the max number of vars in a function. Example code:

f = {|numChannels|
    var name, def;
    name = (\Mixer ++ numChannels).asSymbol;
    name.postln;
    SynthDef(name) { |out=0|
        var ins;

        ins = numChannels.collect { |i|
            MidEQ.ar(
                In.ar(NamedControl.kr((\in ++ i).asSymbol), 1),
                NamedControl.kr((\freq ++ i).asSymbol, 440.0),
                NamedControl.kr((\rq ++ i).asSymbol, 1.0),
                NamedControl.kr((\db ++ i).asSymbol, 0.0),
                NamedControl.kr((\mul ++ i).asSymbol, 1)
            );
        };
        Out.ar(0, ins);
    }.add;
};

f.(52); // fails
f.(51); // works

Metadata

Assignees

No one assigned

    Labels

    bugIssues that relate to unexpected/unwanted behavior. Don't use for PRs.comp: sclangsclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions