supriya-project / supriya Goto Github PK
View Code? Open in Web Editor NEWA Python API for SuperCollider
Home Page: http://supriya-project.github.io/supriya
License: MIT License
A Python API for SuperCollider
Home Page: http://supriya-project.github.io/supriya
License: MIT License
The import expression:
from supriya import *
... should import the synthdefs
subpackage by default.
Restructure docstrings from:
class Foo(object):
'''Blah blah.
'''
... to ...
class Foo(object):
'''
Blah blah.
'''
It looks nicer.
It may be possible to consolidate the various dispatcher-like classes into a single class with common functionality.
You should be able to add an unallocated Synth to an unallocated Group, then allocate the Group and have the entire structure allocate properly.
Every class, method and function should have a docstring.
Desired features:
yield from
SSIA.
As all busses and buffers "already exist" on the server, does preallocating all of them on the language-side proxy server make sense? Is it overkill?
Hi, for me python-wavefile wasn't found when installing, I had to rename it to just "wavefile" and it worked fine.
Many SC docs for UGen provide useful - more importantly, applicable - examples for each UGen.
This is crucial for non-realtime rendering of infinite patterns.
Consult the synthdeftools.UnaryOperator
and synthdeftools.BinaryOperator
enumerations for the names and numeric values of the mathematical operators defined in SuperCollider.
Implement these as Python special methods on synthdeftools.UGenMethodsMixin
when possible and desirable. Otherwise, implement them as plain instance methods.
Some of these operations may already be implemented on synthdeftools.Op
. Port those over as instance methods when found.
See #14 for more details.
It's often more convenient to write:
server.send_message(['/n_set', 1001, 'gate', 0])
than to write:
server.send_message(OscMessage('/n_set', 1001, 'gate', 0))
even though their ultimately identical actions.
Setting a bus map symbol tends to be problematic.
We should provide map()
and unmap()
methods on nonrealtimetools.Node
.
Users should specify that they want to map instead of use a bus's ID, rather than implicitly mapping.
The default should be to use the integer value of the Bus, not its map symbol.
This may require implement first-class node controls like we already have in servertools
.
UGens should support all mathematical operators available in Python via special methods.
Implement these special methods on synthdeftools.UGenMethodMixin
, using the methods already defined there as a template (e.g. UGenMethodMixin.__add__(...)
).
Some of these methods may already be implemented on the synthdeftools.Op
class. When available, port those methods over from the staticmethods
implemented on Op
to bound instance methods on UGenMethodMixin
. Remove the ported method from Op
. Eventually, Op
should be removed entirely.
It is not guaranteed that all Python operators will translate into SuperCollider UGen operators, or vice-versa. Use good judgement, and go with whatever is least surprising.
Consult the synthdeftools.UnaryOperator
and synthdeftools.BinaryOperator
enumerations for the names to use when building new operator methods.
object.__lt__(self, other)
object.__le__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)
Do not implement __eq__
or __ne__
. Implementing equality operators will cause other crucial functionality to break. Equality is already implemented via Op.is_equal(...)
and Op.is_not_equal(...)
.
See below for more methods to not implement.
object.__add__(self, other)
object.__and__(self, other)
object.__floordiv__(self, other)
object.__lshift__(self, other)
object.__mod__(self, other)
object.__mul__(self, other)
object.__or__(self, other)
object.__pow__(self, other[, modulo])
object.__rshift__(self, other)
object.__sub__(self, other)
object.__truediv__(self, other)
object.__xor__(self, other)
object.__radd__(self, other)
object.__rand__(self, other)
object.__rfloordiv__(self, other)
object.__rlshift__(self, other)
object.__rmod__(self, other)
object.__rmul__(self, other)
object.__ror__(self, other)
object.__rpow__(self, other)
object.__rrshift__(self, other)
object.__rsub__(self, other)
object.__rtruediv__(self, other)
object.__rxor__(self, other)
object.__iadd__(self, other)
object.__iand__(self, other)
object.__ifloordiv__(self, other)
object.__ilshift__(self, other)
object.__imod__(self, other)
object.__imul__(self, other)
object.__ior__(self, other)
object.__ipow__(self, other[, modulo])
object.__irshift__(self, other)
object.__isub__(self, other)
object.__itruediv__(self, other)
object.__ixor__(self, other)
object.__abs__(self)
object.__invert__(self)
object.__neg__(self)
object.__pos__(self)
object.__float__(self)
object.__int__(self)
object.__round__(self[, n])
object.__divmod__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__matmul__(self, other)
object.__rdivmod__(self, other)
object.__imatmul__(self, other)
object.__rmatmul__(self, other)
This is now feasible because of our custom doctesting script, which handles shutting down active servers after each file's test run.
Using a single boot per file means a slightly faster test battery and generally cleaner documentation.
Should be as simple as:
my_synth.controls['control_name'] = Bus(0, 'kr') # mapped
my_synth.controls['control_name'] = None # unmapped
Small concern: once unmapped, the resting value of the synth control is unknown. Do we want to query for the new value?
Affordances for channels, mixers, faders, sends (pre-fader, post-fader), channel inputs and outputs, multi-channel synth containers for expanding monophonic fx synths.
Implement both absolute and tempo-locked clocks, with pausing.
We need some basic developer documentation:
Test TimespanCollection.find_timespans_intersecting_timespan()
.
It may possibly not return results when it actually should.
Construct a thorough battery to test.
Move logic for modifying nodes, buffers and busses into each Request class. Requests would then control both client-side and server-side behavior. Account for realtime and non-realtime circumstances.
Convert all unit test modules to use unittest.TestCase
or a subclass thereof. Abjad's systemtools
provides a TestCase
class with many convenience methods built-in. Supriya's tests should use either that class, or a custom subclass.
There are not enough methods to justify the mixins, and they make documentation more difficult.
All of the methods implemented on UGenMethodMixin should have corresponding unit tests, handing UGen, OutputProxy, MultiOutUGen and UGenArray.
Is it necessary? Is it implemented properly?
Continuous-integration testing would help a lot, especially with isolating the build environment, and allowing contributors to run the test-suite. Unfortunately, sound on Travis-CI is a no-go. There's no way to modify the build environment there to support even using dummy sound cards via modprobe
.
What are our options?
Study Max's [poly] object and the ddw Voicer and VoicerProxy classes for inspiration.
Any request that can generate a response - either valid or an error - should have a response_specification
property other than None
.
The tox.ini
configuration hasn't been updated to reflect that Python 2.7 is no longer supported.
Every UGen input should be represented by a documented, read-only property.
For example, SinOsc has two input names: "frequency" and "phase". Both of these inputs should have their own property which returns whatever the UGen was instantiated with.
Remaining UGens to implement:
Currently RealtimeEventPlayer exhibits incorrect delta behavior when the pattern it plays defines custom deltas for its events. Fix this.
See test_manual_incommunicado_pbind_03
in patterntools/test/test_Pbind.py
in the patterns
branch for an example of expected (but unfulfilled) behavior.
For storing information for configuring server-launches, and stashing synthdef files.
Create a SynthDefFactory class to handle the creation of immutable SynthDefs.
RealtimeEventPlayer believes the nodes have been allocated on the server, but the commands to allocate the nodes have not yet been sent.
When I try to run the code example in your readme file it throws this error:
Traceback (most recent call last):
File "/Users/kureta/Documents/Python/supriya-sandbox/main.py", line 24, in <module>
source = source * builder['amplitude']
File "/Users/kureta/Documents/Python/supriya/supriya/tools/synthdeftools/UGenMethodMixin.py", line 898, in __mul__
synthdeftools.BinaryOperator.MULTIPLICATION,
File "/Users/kureta/Documents/Python/supriya/supriya/tools/synthdeftools/UGenMethodMixin.py", line 1676, in _compute_binary_op
special_index=special_index,
File "/Users/kureta/Documents/Python/supriya/supriya/tools/ugentools/BinaryOpUGen.py", line 67, in _new_single
if b == 0:
File "/Users/kureta/Documents/Python/supriya/supriya/tools/synthdeftools/Parameter.py", line 58, in __eq__
return systemtools.TestManager.compare_objects(self, expr)
AttributeError: type object 'TestManager' has no attribute 'compare_objects'
This will generalize a lot of our Dispatcher code.
Prove that demand UGens repeat as expected. Use str(server)
to test the state of a demand-based synth.
The DUGen
setting repeats=None
should be equivalent to repeats=float('inf')
, but repeats=float('inf')
should be supported.
Verify how SC byte-compiles demand UGens. How is repeats: inf
stored in SC?
When I do an import I have the following error
ImportError: No module named 'abjad.tools.commandlinetools.DirectoryScript'
I installed abjad from the git repo. What am I doing wrong?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.