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

add remote file information handshake #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions local_superdirt_startup.scd
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
(
// returns the created dirt instance
~bootRemoteSuperDirt = { |ip, port = 57111, channels = 2|
var dirt;
o = Server.local.options;
o.numOutputBusChannels = channels;
q = Server.remote(\remote, NetAddr(ip, port), o);
q.waitForBoot {
dirt = SuperDirt(channels, q); // two output channels, increase if you want to pan across more channels
// dirt.addModule('envelope', {}, { false });
dirt.removeModule(\envelope);
// ~dirt.loadSoundFiles; // does not yet work
q.sync; // wait for samples to be read
dirt.start(57120, [0, 0]); // start listening on port 57120, create two orbits, each sending audio to channel 0. You can direct sounds to the orbits from tidal e.g. by: `# orbit "0 1 1"
};

Server.default = q;
q.latency = 0.5;
dirt;
// assumes that the remote SuperDirt sclang application has a DirtRemoteSoundfileInfo running
// DirtRemoteSoundfileInfo(dirt.soundLibrary).start(langport);
~bootRemoteSuperDirt = { |ip, port = 57111, channels = 2, langport = 57120|
var dirt, remoteLoader, langaddr;
o = Server.local.options;
o.numOutputBusChannels = channels;
q = Server.remote(\remote, NetAddr(ip, port), o);
langaddr = NetAddr(ip, langport);
q.waitForBoot {
dirt = SuperDirt(channels, q); // two output channels, increase if you want to pan across more channels
dirt.removeModule(\envelope);
remoteLoader = DirtRemoteSoundfileInfo(dirt.soundLibrary);
remoteLoader.sendRequest(langaddr, { |buffers|
buffers.pairsDo { |key, buffer|
~lib.addBuffer(key, buffer, appendToExisting: true)
}
});
dirt.start(langport, [0, 0]);
};

Server.default = q;
q.latency = 0.5;
dirt;
};
)