musikinformatik / SuperDirt

Tidal Audio Engine
GNU General Public License v2.0
524 stars 76 forks source link

Start SuperDirt on a server other than default s #265

Open Xon77 opened 2 years ago

Xon77 commented 2 years ago

Following a question on scsynth, it is not possible to start SuperDirt on a server other than s with the following code, since effect synths are not loaded.

( ~serverT = Server(\LocalT, NetAddr("127.0.0.1", 57115)); ~serverT.options.memSize_(2.pow(18)); ~serverT.waitForBoot { ~dirt.free; ~dirt = SuperDirt.new(2, ~serverT); ~dirt.loadSoundFiles(); ~serverT.sync; ~dirt.start(57120, 0!2); ~serverTWindow = ~serverT.makeWindow; }; )

According to the answer of James Harkins, "It’s a bug in SuperDirt.

Effects are created by:

        globalEffects.reverseDo { |x|
            x.play(group, outBus, dryBus, globalEffectBus, orbitIndex)
        }

… where group should be the target.

However group is only a node ID and not a Group() object specifying a server. (In Synth *new, the server is determined from target.asTarget.server – but if the given target is an integer, as it is in SuperDirt, then asTarget always goes to the default server.)

So there was an intention to support alternate servers, but accidental non-support of it by group = server.nextPermNodeID; in the Dirt class. "

telephon commented 2 years ago

I'll think about what is the best way, there is a certain economy to pure numbers, and it would be possible to add the server as an argument to the play method. But maybe group objects are simpler in the end.