[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] Re: call-backs, co-routines and inversion of control

Hi Julian, 

what you describe is what my ServerPrep does: 

The user can start synths and routines, and presuppose that any required
synthdefs or buffers will be loaded in the right order to the server,
provided of course that those synthdefs and buffers have been declared. 
I.e. the system does the "book-keeping" and the end user (programmer) does
not have to take care of that.

However, my system does not using async / sync and I am not familiar with
the approach discussed here. It uses a routine to cycle though loading all
SynthDefs and Buffers to the buffer using the "action" or
"completionMessage" argument.  An interesting feature is that new items can
be added even while the loading process is going on. Here is a brief
description of the rationale and function of the system, given as a
hypothetical example: 

- A synth is started (scheduled for sending). At that point: 
- The system checks whether any buffers have been declared for loading, and
if not, loads them.
- The system checks whether any synthdefs have been declared for loading,
and if not, loads them. 
- [!!!] While the system is loading buffers and synthdefs: 
   - if a new buffer is declared for loading, it is added to the queue for
   - if a new synthdef is declared for loading (sending) it is added to the
   - if another synth or routine is added, it is added to the queue of
synths to be sent / routines to start. 
- *After* all buffers and synthdefs are loaded in the correct order, synths
and routines are started. 

This guarantees that synths will always be started *after* any buffers or
synthdefs have finished loading. 

From your code I understand that you do some similar book-keeping at the
level of organizing the sending of bundles. It seems that your splitBundles
method does something similar to what I described above, but I am not
exactly sure. Perhaps the description above may be of help. Might also be
useful if you could provide a similar description of the what splitBundles
does, plus a usage example. 


Iannis Z. 

View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/call-backs-co-routines-and-inversion-of-control-tp7589127p7591998.html
Sent from the SuperCollider Developers New (Use this!!!!) mailing list archive at Nabble.com.

sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/