2 summary:: network bundle object
3 related:: Guides/OSC_communication
4 categories:: External Control>OSC
7 A bundle object that allows to add preparation messages for async processes. If this feature is not needed, a list object can be used instead.
14 Add an osc message to the bundle.
17 Add an array of osc messages to the bundle.
20 Add a preparation osc message, which is sent before the bundle is sent.
23 Send the bundle to a server. If preparation messages are given, they are sent, the process waits for their reception abd then sends the bundle.
26 Like send, but the sending is synced to a given clock to the next beat.
29 A link::Classes/Server::.
32 A link::Classes/TempoClock::.
35 Can be a pair of values: [quant, offset].
40 // create a new, empty instance
43 // a synthdef that needs to be sent to the server, an operation that is asynchronous,
44 // i.e. we have to wait until it is finished.
45 x = SynthDef("test", { OffsetOut.ar(0, BPF.ar(Impulse.ar(4) * 10, Rand(9000, 1000), 0.1)) });
46 // this is why addPrepare is used.
47 a.addPrepare(["/d_recv", x.asBytes]);
48 // add is used with synchronous operations, like starting synths.
49 a.add(["/s_new", "test", -1]);
51 // the bundle has now the synchronous separated from the asynchronous bundles:
53 a.preparationMessages;
55 // this can be simply sent - the bundle takes care of the server client communication
56 // like waiting for the synthdef to be loaded. the synth is started when the preparation
59 s.boot; // boot the server
62 s.freeAll; // free all nodes on the server
64 // scheduled sending: the synths are started on the next beat.
66 a.schedSend(s, TempoClock.default, 1);
67 a.schedSend(s, TempoClock.default, 1);
68 a.schedSend(s, TempoClock.default, 1);
70 s.freeAll; // free all nodes on the server
72 // the bundle can contain several preparation messages and messages at a time.
73 // the proparationMessages are sent first and only when they are all completed,
74 // the other bundles are sent.
75 // the bundle can also be reused, if there is no specific allocated buffers/node ids.