-
Notifications
You must be signed in to change notification settings - Fork 12
Changes and why
Some names and parameter position have changed and a couple of class names too.
For parameter names I did follow some kind of rules.
- Use Python's notation style rules.
- Names shouldn't be to much long, use the context of the name to catch the right meaning.
- Use the same names for the same functionality/concept across the library.
- Parameters that are most commonly used with its default value shouldn't be before other that need to be set (this apply for the server parameter).
- Try to keep consistency between different objects if the parameter and the context of use is the same.
Because the server being used is 'localhost'
most of the time, for example
Buffer and Bus classes moved it parameter position after the parameters of the
particular abstraction.
TimeThread instead of Thread. In SuperCollider 'thread' has a particular meaning withing the class library, here that would be confusing. I didn't change, however, the name of the routines because Python only uses the term coroutine.
AudioBus and ControlBus instead of Bus.audio and Bus.control respectively. Bus is now the base class of those two. This simple change solves a very common confusion regarding the different capabilities of each kind of bus, e.g., get and set methods are only in ControlBus.
When teaching SuperCollider I use to say 'nil knows everything', e.g., from nil
you can create an array (nil.add(0)
), because some things are confusing. I
tried to avoid root class polymorphism, the paradigmatic case was
AbstractFunction that became AbstractObject as a mixin of mathematical methods
in some cases. Also related, the base class of ugens is SynthObject, because
not every ugen respond to the methods of AbstractObject.
In sclang is common to have class and instance methods with the same name in Python is not possible (not without a big workaround).
The server class uses composition instead of duplicating the methods of other objects that substantially reduce the number of methods.
All methods related to NodeWatcher use the term register
.
I tried to linearize the boot process with moderated success.
The method queryTree now is dump_tree and query_tree belong to Group objects.
Pmono and PmonoArtic were joint. Now Pmono has an 'articulate' parameter that changes the behavior to PmonoArtic.
In commit 3b9a7bad39e2d646e56868ae222df5dbc116c336
Because:
- *_msg methods change the state of the objects without sending the change.
- Server objects need the state of a particular server (allocators).
- The same functionality can be achieved with BundleNetAddr, for example:
from sc3.all import *
def get_msgs(func):
'''Return the list of OSC messages generated when ``func`` is evaluated.'''
with BundleNetAddr(s, send=False) as bna:
func()
return bna.get_bundle()[1:]
get_msgs(lambda: Buffer())
It still changes the state of the evaluated objects but is explicit.