Comments (3)
This has nothing to do with \pset or NodeProxy, it is the Pbindf
that crashes when you pass it an EventStreamPlayer
instead of a Pattern
:
(
Pbindf(Pbind(
\dur, 0.125,
\amp, Pseq(((0..10)/100).scramble, inf),
\mygate, 1.0,
).play,
\foo, 8
).play;
)
instead of
(
Pbindf(Pbind(
\dur, 0.125,
\amp, Pseq(((0..10)/100).scramble, inf),
\mygate, 1.0,
),
\foo, 8
).play;
)
So the above should be:
Ndef(\crash, {
var sig = SinOsc.ar * Env.perc.ar(gate: \mygate.tr(1.0));
Pan2.ar(sig, \pos.kr(0.0));
});
// this crashes not
Ndef(\crash)[2] = \pset -> Pbind(
\dur, 0.125,
\amp, Pseq(((0..10)/100).scramble, inf),
\mygate, 1.0,
)
Of course it would be good to make the Pbindf more tolerant.
from supercollider.
I am testing with this reproducer:
// this is fine
Pbindf(Pbind(\dur, Pseq([0.125], 1)).play, \foo, 8).play;
// if it crashes, this crashes it (infinite loop)
Pbindf(Pbind(\dur, Pseq([0.125], inf)).play, \foo, 8).play;
What happens happens in EventStreamPlayer.prNext
. First an error is thrown, then the interpreter crashes.
ERROR: Message 'round' not understood.
RECEIVER:
nil
ARGS:
PROTECTED CALL STACK:
Meta_MethodError:new 0x7fe5419a7d40
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = nil
Meta_DoesNotUnderstandError:new 0x7fe5419b1dc0
arg this = DoesNotUnderstandError
arg receiver = nil
arg selector = round
arg args = []
Object:doesNotUnderstand 0x7fe570284540
arg this = nil
arg selector = round
arg args = nil
EventStreamPlayer:prNext 0x7fe52074a440
arg this = an EventStreamPlayer
arg inTime = ()
var nextTime = 0.125
var outEvent = ('instrument': default, 'mygate': 1.0, 'dur': 0.125, 'amp': 0.04,
'server': localhost, 'sustain': 0.1, 'isPlaying': true, 'hasGate': true, 'id': [1001],
'msgFunc': a Function, 'freq': 261.6255653006)
var roundedBeat = nil
var deltaFromRounded = nil
a FunctionDef 0x7fe520748280
sourceCode = "<an open Function>"
Function:prTry 0x7fe5205a4d80
arg this = a Function
var result = nil
var thread = a Routine
var next = nil
var wasInProtectedFunc = false
CALL STACK:
DoesNotUnderstandError:reportError
arg this = <instance of DoesNotUnderstandError>
Nil:handleError
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Routine>
arg error = <instance of DoesNotUnderstandError>
Object:throw
arg this = <instance of DoesNotUnderstandError>
Function:protect
arg this = <instance of Function>
arg handler = <instance of Function>
var result = <instance of DoesNotUnderstandError>
Routine:prStart
arg this = <instance of Routine>
arg inval = 9.9995203150029
^^ ERROR: Message 'round' not understood.
RECEIVER: nil
Interpreter has crashed or stopped forcefully. [Exit code: 11]
This happens because of the protect
of the EventStreamPlayer
, which should call streamError
, if it is commented out, no crash happens.
init {
cleanup = EventStreamCleanup.new;
routine = Routine { |inTime|
loop { inTime = this.prNext(inTime).yield }
/*protect {
loop { inTime = this.prNext(inTime).yield }
} { |result|
if(result.isException) {
this.streamError
}
}*/
};
}
It is not the streamError
, but in the protect
:
this crashes:
init {
cleanup = EventStreamCleanup.new;
routine = Routine { |inTime|
protect {
loop { inTime = this.prNext(inTime).yield }
} { |result|
if(result.isException) {
// this.streamError
}
}
};
}
also this crashes:
init {
cleanup = EventStreamCleanup.new;
routine = Routine { |inTime|
protect {
loop { inTime = this.prNext(inTime).yield }
}
};
}
So somehow, returning from a protected call is the problem here.
If don't return in prNext
, it does not crash (just end):
prNext { arg inTime; // <----------------- inTime is an event
var nextTime;
var outEvent = stream.next(event.copy);
var roundedBeat, deltaFromRounded;
if (outEvent.isNil) {
streamHasEnded = stream.notNil;
cleanup.clear;
this.removedFromScheduler;
^nil
} {
nextTime = outEvent.playAndDelta(cleanup, muteCount > 0);
if (nextTime.isNil) { this.removedFromScheduler; ^nil };
nextBeat = inTime + nextTime; // inval is current logical beat
roundedBeat = nextBeat.round; // <-------------------------------------- error happens here (Event.round)
deltaFromRounded = roundedBeat - nextBeat;
if (deltaFromRounded.smallButNotZero) {
nextBeat = roundedBeat;
nextTime = nextTime + deltaFromRounded;
};
/// ^nextTime // <------------------------- commented out
};
}
from supercollider.
Related Issues (20)
- A gtk ide HOT 1
- EnvGen has incorrect duration HOT 6
- Make wiki independent of GitHub HOT 27
- SynthDef not making sound. HOT 2
- Server-side rrand range is inconsistent across rates HOT 1
- `NdefMixer` does not survive `Ndef.clear` HOT 10
- Class library compilation failure disables auto-indent
- Mandatory Booting Proves Unsuccessful - Node Groups Not Working
- switch() - Segfault in one situation HOT 4
- SuperCollider can't boot on Aggregate Device with No Input selected HOT 1
- On macOS, the location of sclang should be moved to `SuperCollider.app/Contents/Resources/' HOT 1
- 1. Plotter seems give different result depending OS. 2. .addKr not understood error HOT 13
- Readme for RPI installation missing info
- Build failure with -DSYSTEM_BOOST=ON against >=boost-1.84: server/scsynth/SC_GraphDef.cpp:49:10: fatal error: boost/filesystem/string_file.hpp: No such file or directory HOT 2
- PyrSymbol's length is only 8bits. HOT 12
- Buffer:-query unexpectedly causes Buffer instance vars to be updated HOT 5
- JACK Error building headless on Raspberry Pi
- NodeProxy: source pattern may re-appear on clear when stopped already.
- build error on macOS 14 (Sonoma) – possibly a boost problem? (BOOST_MPL_AUX_STATIC_CAST) HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supercollider.