Skip to content

Commit

Permalink
class library: SynthDef - fix uploading of large synthdefs
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Blechmann <tim@klingt.org>
  • Loading branch information
timblechmann committed Mar 23, 2012
1 parent 0046191 commit 5eed0b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SCClassLibrary/Common/Audio/SynthDef.sc
Expand Up @@ -560,15 +560,15 @@ SynthDef {

doSend { |server, completionMsg|
var bytes = this.asBytes;
try {
server.sendMsg("/d_recv", this.asBytes, completionMsg)
if (bytes.size < (65535 div: 4)) {
server.sendMsg("/d_recv", bytes, completionMsg)
} {
if (server.isLocal) {
"Possible buffer overflow when sending SynthDef %. Retrying via synthdef file".format(name).warn;
"SynthDef % too big for sending. Retrying via synthdef file".format(name).warn;
this.writeDefFile(synthDefDir);
server.sendMsg("/d_load", synthDefDir ++ name ++ ".scsyndef", completionMsg)
} {
"Possible buffer overflow when sending SynthDef %.".format(name).warn;
"SynthDef % too big for sending.".format(name).warn;
}
}
}
Expand Down

0 comments on commit 5eed0b7

Please sign in to comment.