.discretize
samples the envelope at equally-spaced time points.
You’re right to note that the method is undocumented – would be worth filing a bug report for that.
You could actually investigate it for yourself in the meantime.
e = Env([0, 1, 0.5, 0], [0.1, 0.4, 0.8]);
-> an Env
e.discretize(512);
-> Signal[ 0.0, 0.025440312922001, 0.050880625844002, 0.076320938766003, 0.101761251688, 0.12720157206059, 0.15264187753201, 0.17808219790459, 0.20352250337601, 0.22896282374859, 0.25440314412117, 0.27984344959259, 0.30528375506401, 0.33072406053543, 0.35616439580917, 0.38160470128059, 0.40704500675201, 0.43248531222343, 0.45792564749718, 0.4833659529686, 0.50880628824234, 0.53424656391144, 0.55968689918518, 0.58512717485428, 0.61056751012802, 0.63600784540176, 0.66144812107086, 0.6868884563446, 0.712328791618...etc...
OK, so it’s a big long list of numbers. One way to look at a long list of numbers is to plot it.
e.discretize(512).plot;
… and you’ll see the envelope shape.
I’m trying to understand the difference between the .sendCollection and .loadCollection
loadCollection
uses a temporary disk file (faster for large arrays). sendCollection
sends all of the data using network messages (a bit less work for the system, if the array is small – the default discretize
size is 1024, which counts as small in this context).
Help file reports this:
sendCollection (collection, startFrame: 0, wait: -1, action),
while on the IDE I can see this:
sendCollection (server, collection, numChannels, wait, action).
Is this a known bug or error?
No. It’s correct.
There are two sendCollection methods:
-
One belongs to the Buffer class:
Buffer.sendCollection(...)
. Its job is to create and allocate a new buffer and fill it with the given collection. Because it’s a new buffer, you have to tell it which server to use and how many channels it should have. http://doc.sccode.org/Classes/Buffer.html#*sendCollection -
The other belongs to Buffer instances:
aBufferObjectThatIAlreadyMade.sendCollection(...)
. This method uses an existing buffer and puts the array’s contents into it. Because the buffer already exists, the server and number of channels are already known, so youdon’t have toshouldn’t state them again. Buffer | SuperCollider 3.12.2 Help
hjh