示例#1
0
 def __init__(
     self,
     ugens,
     name=None,
     optimize=True,
     parameter_names=None
     ):
     from supriya.tools import synthdeftools
     from supriya.tools import ugentools
     ServerObjectProxy.__init__(self)
     compiler = synthdeftools.SynthDefCompiler
     self._name = name
     ugens = copy.deepcopy(ugens)
     ugens = self._flatten_ugens(ugens)
     assert all(isinstance(_, ugentools.UGen) for _ in ugens)
     ugens = self._cleanup_pv_chains(ugens)
     ugens = self._cleanup_local_bufs(ugens)
     if optimize:
         ugens = self._optimize_ugen_graph(ugens)
     ugens = self._sort_ugens_topologically(ugens)
     self._ugens = tuple(ugens)
     self._constants = self._collect_constants(self._ugens)
     self._control_ugens = self._collect_control_ugens(self._ugens)
     self._indexed_parameters = self._collect_indexed_parameters(
         self._control_ugens,
         parameter_names=parameter_names,
         )
     self._compiled_ugen_graph = compiler.compile_ugen_graph(self)
示例#2
0
 def __init__(self, name=None):
     ServerObjectProxy.__init__(self)
     self._is_paused = False
     self._name = name
     self._node_id = None
     self._node_id_is_permanent = None
     self._parent = None
示例#3
0
 def __init__(
     self,
     bus_count=1,
     calculation_rate=None,
     bus_id=None,
     ):
     from supriya.tools import servertools
     from supriya.tools import synthdeftools
     BindingTarget.__init__(self)
     ServerObjectProxy.__init__(self)
     calculation_rate = synthdeftools.CalculationRate.from_expr(
         calculation_rate)
     assert calculation_rate in (
         synthdeftools.CalculationRate.AUDIO,
         synthdeftools.CalculationRate.CONTROL,
         )
     self._calculation_rate = calculation_rate
     bus_count = int(bus_count)
     assert 0 < bus_count
     self._buses = tuple(
         servertools.Bus(
             bus_group_or_index=self,
             calculation_rate=self.calculation_rate,
             )
         for _ in range(bus_count)
         )
     assert isinstance(bus_id, (type(None), int))
     self._bus_id = bus_id
示例#4
0
 def __init__(
     self,
     buffer_count=1,
 ):
     from supriya.tools import servertools
     ServerObjectProxy.__init__(self)
     self._buffer_id = None
     buffer_count = int(buffer_count)
     assert 0 < buffer_count
     self._buffers = tuple(
         servertools.Buffer(buffer_group_or_index=self)
         for _ in range(buffer_count))
示例#5
0
 def __init__(
     self,
     buffer_count=1,
     ):
     from supriya.tools import servertools
     ServerObjectProxy.__init__(self)
     self._buffer_id = None
     buffer_count = int(buffer_count)
     assert 0 < buffer_count
     self._buffers = tuple(
         servertools.Buffer(buffer_group_or_index=self)
         for _ in range(buffer_count)
         )
示例#6
0
 def __init__(
     self,
     buffer_group_or_index=None,
     ):
     from supriya.tools import servertools
     ServerObjectProxy.__init__(self)
     buffer_group = None
     buffer_id = None
     self._buffer_id_was_set_manually = False
     if buffer_group_or_index is not None:
         self._buffer_id_was_set_manually = True
         if isinstance(buffer_group_or_index, servertools.BufferGroup):
             buffer_group = buffer_group_or_index
         elif isinstance(buffer_group_or_index, int):
             buffer_id = int(buffer_group_or_index)
     self._buffer_group = buffer_group
     self._buffer_id = buffer_id
示例#7
0
 def __init__(
     self,
     buffer_group_or_index=None,
 ):
     from supriya.tools import servertools
     ServerObjectProxy.__init__(self)
     buffer_group = None
     buffer_id = None
     self._buffer_id_was_set_manually = False
     if buffer_group_or_index is not None:
         self._buffer_id_was_set_manually = True
         if isinstance(buffer_group_or_index, servertools.BufferGroup):
             buffer_group = buffer_group_or_index
         elif isinstance(buffer_group_or_index, int):
             buffer_id = int(buffer_group_or_index)
     self._buffer_group = buffer_group
     self._buffer_id = buffer_id
示例#8
0
 def __init__(self, ugens, name=None, optimize=True, parameter_names=None):
     from supriya.tools import synthdeftools
     from supriya.tools import ugentools
     ServerObjectProxy.__init__(self)
     compiler = synthdeftools.SynthDefCompiler
     self._name = name
     ugens = copy.deepcopy(ugens)
     ugens = self._flatten_ugens(ugens)
     assert all(isinstance(_, ugentools.UGen) for _ in ugens)
     ugens = self._cleanup_pv_chains(ugens)
     ugens = self._cleanup_local_bufs(ugens)
     if optimize:
         ugens = self._optimize_ugen_graph(ugens)
     ugens = self._sort_ugens_topologically(ugens)
     self._ugens = tuple(ugens)
     self._constants = self._collect_constants(self._ugens)
     self._control_ugens = self._collect_control_ugens(self._ugens)
     self._indexed_parameters = self._collect_indexed_parameters(
         self._control_ugens,
         parameter_names=parameter_names,
     )
     self._compiled_ugen_graph = compiler.compile_ugen_graph(self)
示例#9
0
 def __init__(
     self,
     bus_group_or_index=None,
     calculation_rate=None,
     ):
     from supriya.tools import servertools
     from supriya.tools import synthdeftools
     BindingTarget.__init__(self)
     ServerObjectProxy.__init__(self)
     bus_group = None
     bus_id = None
     self._bus_id_was_set_manually = False
     if bus_group_or_index is not None:
         self._bus_id_was_set_manually = True
         if isinstance(bus_group_or_index, servertools.BusGroup):
             bus_group = bus_group_or_index
         elif isinstance(bus_group_or_index, int):
             bus_id = int(bus_group_or_index)
     self._bus_group = bus_group
     self._bus_id = bus_id
     assert calculation_rate is not None
     calculation_rate = synthdeftools.CalculationRate.from_expr(calculation_rate)
     self._calculation_rate = calculation_rate
示例#10
0
文件: Bus.py 项目: lisongx/supriya
 def __init__(
     self,
     bus_group_or_index=None,
     calculation_rate=None,
     ):
     from supriya.tools import servertools
     from supriya.tools import synthdeftools
     BindingTarget.__init__(self)
     ServerObjectProxy.__init__(self)
     bus_group = None
     bus_id = None
     self._bus_id_was_set_manually = False
     if bus_group_or_index is not None:
         self._bus_id_was_set_manually = True
         if isinstance(bus_group_or_index, servertools.BusGroup):
             bus_group = bus_group_or_index
         elif isinstance(bus_group_or_index, int):
             bus_id = int(bus_group_or_index)
     self._bus_group = bus_group
     self._bus_id = bus_id
     assert calculation_rate is not None
     calculation_rate = synthdeftools.CalculationRate.from_expr(
         calculation_rate)
     self._calculation_rate = calculation_rate
示例#11
0
 def __init__(self, name=None):
     ServerObjectProxy.__init__(self)
     TreeNode.__init__(self, name=name)
     self._is_paused = False
     self._node_id = None
     self._node_id_is_permanent = None