예제 #1
0
 def __init__(self, as_wavetable=None, buffer_id=None, new_maximum=1.0):
     Request.__init__(self)
     if as_wavetable is not None:
         as_wavetable = bool(as_wavetable)
     self._as_wavetable = as_wavetable
     self._buffer_id = int(buffer_id)
     self._new_maximum = float(new_maximum)
예제 #2
0
    def __init__(
        self,
        buffer_id=None,
        callback=None,
        file_path=None,
        frame_count=None,
        header_format="aiff",
        leave_open=False,
        sample_format="int24",
        starting_frame=None,
    ):
        import supriya.soundfiles

        Request.__init__(self)
        self._buffer_id = int(buffer_id)
        if callback is not None:
            assert isinstance(callback, (Request, RequestBundle))
        self._callback = callback
        self._file_path = str(file_path)
        if frame_count is None:
            frame_count = -1
        frame_count = int(frame_count)
        assert -1 <= frame_count
        self._frame_count = frame_count
        self._header_format = supriya.soundfiles.HeaderFormat.from_expr(
            header_format)
        self._leave_open = bool(leave_open)
        self._sample_format = supriya.soundfiles.SampleFormat.from_expr(
            sample_format)
        if starting_frame is None:
            starting_frame = 0
        starting_frame = int(starting_frame)
        assert 0 <= starting_frame
        self._starting_frame = starting_frame
예제 #3
0
 def __init__(
     self,
     buffer_id=None,
     completion_message=None,
     file_path=None,
     frame_count=None,
     header_format='aiff',
     leave_open=False,
     sample_format='int24',
     starting_frame=None,
     ):
     import supriya.soundfiles
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._completion_message = self._coerce_completion_message_input(
         completion_message)
     self._file_path = str(file_path)
     if frame_count is None:
         frame_count = -1
     frame_count = int(frame_count)
     assert -1 <= frame_count
     self._frame_count = frame_count
     self._header_format = supriya.soundfiles.HeaderFormat.from_expr(
         header_format)
     self._leave_open = bool(leave_open)
     self._sample_format = supriya.soundfiles.SampleFormat.from_expr(
         sample_format)
     if starting_frame is None:
         starting_frame = 0
     starting_frame = int(starting_frame)
     assert 0 <= starting_frame
     self._starting_frame = starting_frame
 def __init__(self, as_wavetable=None, buffer_id=None, new_maximum=1.0):
     Request.__init__(self)
     if as_wavetable is not None:
         as_wavetable = bool(as_wavetable)
     self._as_wavetable = as_wavetable
     self._buffer_id = int(buffer_id)
     self._new_maximum = float(new_maximum)
 def __init__(
     self,
     buffer_id=None,
     callback=None,
     file_path=None,
     frame_count=None,
     header_format="aiff",
     leave_open=False,
     sample_format="int24",
     starting_frame=None,
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     if callback is not None:
         assert isinstance(callback, (Request, RequestBundle))
     self._callback = callback
     self._file_path = str(file_path)
     if frame_count is None:
         frame_count = -1
     frame_count = int(frame_count)
     assert -1 <= frame_count
     self._frame_count = frame_count
     self._header_format = HeaderFormat.from_expr(header_format)
     self._leave_open = bool(leave_open)
     self._sample_format = SampleFormat.from_expr(sample_format)
     if starting_frame is None:
         starting_frame = 0
     starting_frame = int(starting_frame)
     assert 0 <= starting_frame
     self._starting_frame = starting_frame
예제 #6
0
    def __init__(self, synthdef=None):
        import supriya.synthdefs

        Request.__init__(self)
        prototype = (str, supriya.synthdefs.SynthDef)
        assert isinstance(synthdef, prototype)
        self._synthdef = synthdef
    def __init__(self, synthdef=None):
        import supriya.synthdefs

        Request.__init__(self)
        prototype = (str, supriya.synthdefs.SynthDef)
        assert isinstance(synthdef, prototype)
        self._synthdef = synthdef
예제 #8
0
 def __init__(
     self,
     buffer_id=None,
     callback=None,
     file_path=None,
     frame_count=None,
     leave_open=None,
     starting_frame_in_buffer=None,
     starting_frame_in_file=None,
 ):
     import supriya.nonrealtime
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     if callback is not None:
         assert isinstance(callback, (Request, RequestBundle))
     self._callback = callback
     if not supriya.nonrealtime.Session.is_session_like(file_path):
         file_path = str(file_path)
     self._file_path = file_path
     if frame_count is not None:
         frame_count = int(frame_count)
         assert -1 <= frame_count
     self._frame_count = frame_count
     if leave_open is not None:
         leave_open = bool(leave_open)
     self._leave_open = leave_open
     if starting_frame_in_buffer is not None:
         starting_frame_in_buffer = int(starting_frame_in_buffer)
         assert 0 <= starting_frame_in_buffer
     self._starting_frame_in_buffer = starting_frame_in_buffer
     if starting_frame_in_file is not None:
         starting_frame_in_file = int(starting_frame_in_file)
         assert 0 <= starting_frame_in_file
     self._starting_frame_in_file = starting_frame_in_file
예제 #9
0
 def __init__(
     self,
     completion_message=None,
     synthdef_path=None,
 ):
     Request.__init__(self)
     self._completion_message = completion_message
     self._synthdef_path = os.path.abspath(synthdef_path)
예제 #10
0
 def __init__(
     self,
     include_controls=False,
     node_id=None,
 ):
     Request.__init__(self)
     self._node_id = node_id
     self._include_controls = bool(include_controls)
예제 #11
0
 def __init__(
     self,
     buffer_id=None,
     indices=None,
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._indices = tuple(int(index) for index in indices)
예제 #12
0
 def __init__(
     self,
     buffer_ids=None,
 ):
     Request.__init__(self)
     if buffer_ids:
         buffer_ids = tuple(int(buffer_id) for buffer_id in buffer_ids)
     self._buffer_ids = buffer_ids
예제 #13
0
 def __init__(
     self,
     node_id=None,
     **kwargs
     ):
     Request.__init__(self)
     self._node_id = node_id
     self._kwargs = kwargs
예제 #14
0
 def __init__(self, buffer_id=None, index_count_value_triples=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     triples = []
     for index, count, value in index_count_value_triples:
         triple = (int(index), int(count), float(value))
         triples.append(triple)
     triples = tuple(triples)
     self._index_count_value_triples = triples
예제 #15
0
 def __init__(
     self,
     completion_message=None,
     directory_path=None,
 ):
     Request.__init__(self)
     Request.__init__(self)
     self._completion_message = completion_message
     self._directory_path = os.path.abspath(directory_path)
예제 #16
0
 def __init__(
     self,
     buffer_id=None,
     completion_message=None,
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._completion_message = self._coerce_completion_message_input(
         completion_message)
 def __init__(self, buffer_id=None, index_count_value_triples=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     triples = []
     for index, count, value in index_count_value_triples:
         triple = (int(index), int(count), float(value))
         triples.append(triple)
     triples = tuple(triples)
     self._index_count_value_triples = triples
예제 #18
0
 def __init__(
     self,
     buffer_id=None,
     index_count_pairs=None,
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._index_count_pairs = tuple(
         (int(index), int(count)) for index, count in index_count_pairs)
예제 #19
0
 def __init__(
     self,
     indices=None,
 ):
     Request.__init__(self)
     if indices:
         indices = tuple(int(index) for index in indices)
         assert all(0 <= index for index in indices)
     self._indices = indices
예제 #20
0
 def __init__(self, node_id_run_flag_pairs=None):
     Request.__init__(self)
     if node_id_run_flag_pairs:
         pairs = []
         for node_id, run_flag in node_id_run_flag_pairs:
             node_id = node_id
             run_flag = bool(run_flag)
             pairs.append((node_id, run_flag))
         node_id_run_flag_pairs = tuple(pairs)
     self._node_id_run_flag_pairs = node_id_run_flag_pairs
예제 #21
0
 def __init__(
     self,
     buffer_id=None,
     callback=None
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     if callback is not None:
         assert isinstance(callback, (Request, RequestBundle))
     self._callback = callback
 def __init__(self, node_id_run_flag_pairs=None):
     Request.__init__(self)
     if node_id_run_flag_pairs:
         pairs = []
         for node_id, run_flag in node_id_run_flag_pairs:
             node_id = node_id
             run_flag = bool(run_flag)
             pairs.append((node_id, run_flag))
         node_id_run_flag_pairs = tuple(pairs)
     self._node_id_run_flag_pairs = node_id_run_flag_pairs
예제 #23
0
 def __init__(self, node_id_pairs=None):
     Request.__init__(self)
     if node_id_pairs:
         if not isinstance(node_id_pairs, collections.Sequence):
             node_id_pairs = [node_id_pairs]
         node_id_pairs = list(node_id_pairs)
         for i, x in enumerate(node_id_pairs):
             if not isinstance(x, self.NodeIdPair):
                 node_id_pairs[i] = self.NodeIdPair(*x)
         node_id_pairs = tuple(node_id_pairs)
     self._node_id_pairs = node_id_pairs
예제 #24
0
 def __init__(
     self,
     add_action=None,
     node_id=None,
     target_node_id=None,
     ):
     import supriya.realtime
     Request.__init__(self)
     self._add_action = supriya.realtime.AddAction.from_expr(add_action)
     self._node_id = node_id
     self._target_node_id = target_node_id
 def __init__(
     self,
     node_id=None,
     **kwargs
     ):
     Request.__init__(self)
     self._node_id = node_id
     self._kwargs = dict(
         (name, int(value))
         for name, value in kwargs.items()
         )
예제 #26
0
 def __init__(self, node_id_pairs=None):
     Request.__init__(self)
     if node_id_pairs:
         if not isinstance(node_id_pairs, collections.Sequence):
             node_id_pairs = [node_id_pairs]
         node_id_pairs = list(node_id_pairs)
         for i, x in enumerate(node_id_pairs):
             if not isinstance(x, self.NodeIdPair):
                 node_id_pairs[i] = self.NodeIdPair(*x)
         node_id_pairs = tuple(node_id_pairs)
     self._node_id_pairs = node_id_pairs
예제 #27
0
 def __init__(
     self,
     amplitudes=None,
     as_wavetable=None,
     buffer_id=None,
     command_name=None,
     frequencies=None,
     phases=None,
     should_clear_first=None,
     should_normalize=None,
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     assert command_name in (
         'cheby',
         'sine1',
         'sine2',
         'sine3',
     )
     self._command_name = command_name
     if as_wavetable is not None:
         as_wavetable = bool(as_wavetable)
     self._as_wavetable = as_wavetable
     if should_clear_first is not None:
         should_clear_first = bool(should_clear_first)
     self._should_clear_first = should_clear_first
     if should_normalize is not None:
         should_normalize = bool(should_normalize)
     self._should_normalize = should_normalize
     self._frequencies = None
     self._phases = None
     if command_name in ('cheby', 'sine1'):
         if not isinstance(amplitudes, collections.Sequence):
             amplitudes = (amplitudes, )
         amplitudes = tuple(float(_) for _ in amplitudes)
         assert len(amplitudes)
         self._amplitudes = amplitudes
     if command_name == 'sine2':
         amplitudes = tuple(float(_) for _ in amplitudes)
         frequencies = tuple(float(_) for _ in frequencies)
         assert 0 < len(amplitudes)
         assert len(amplitudes) == len(frequencies)
         self._amplitudes = amplitudes
         self._frequencies = frequencies
     if command_name == 'sine3':
         amplitudes = tuple(float(_) for _ in amplitudes)
         frequencies = tuple(float(_) for _ in frequencies)
         phases = tuple(float(_) for _ in phases)
         assert 0 < len(amplitudes)
         assert len(amplitudes) == len(frequencies) == len(phases)
         self._amplitudes = amplitudes
         self._frequencies = frequencies
         self._phases = phases
 def __init__(self, index_value_pairs=None):
     Request.__init__(self)
     if index_value_pairs:
         pairs = []
         for index, value in index_value_pairs:
             index = int(index)
             value = float(value)
             assert 0 <= index
             pair = (index, value)
             pairs.append(pair)
         index_value_pairs = tuple(pairs)
     self._index_value_pairs = index_value_pairs
예제 #29
0
 def __init__(self, buffer_id=None, index_values_pairs=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     if index_values_pairs:
         pairs = []
         for index, values in index_values_pairs:
             index = int(index)
             values = tuple(float(value) for value in values)
             pair = (index, values)
             pairs.append(pair)
         pairs = tuple(pairs)
     self._index_values_pairs = pairs
 def __init__(self, buffer_id=None, index_value_pairs=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     if index_value_pairs:
         pairs = []
         for index, value in index_value_pairs:
             index = int(index)
             value = float(value)
             pair = (index, value)
             pairs.append(pair)
         pairs = tuple(pairs)
     self._index_value_pairs = index_value_pairs
예제 #31
0
 def __init__(self, index_value_pairs=None):
     Request.__init__(self)
     if index_value_pairs:
         pairs = []
         for index, value in index_value_pairs:
             index = int(index)
             value = float(value)
             assert 0 <= index
             pair = (index, value)
             pairs.append(pair)
         index_value_pairs = tuple(pairs)
     self._index_value_pairs = index_value_pairs
 def __init__(self, index_count_pairs=None):
     Request.__init__(self)
     if index_count_pairs:
         pairs = []
         for index, count in index_count_pairs:
             index = int(index)
             count = int(count)
             assert 0 <= index
             assert 0 < count
             pair = (index, count)
             pairs.append(pair)
         index_count_pairs = tuple(pairs)
     self._index_count_pairs = index_count_pairs
 def __init__(
     self, buffer_id=None, frame_count=None, channel_count=None, callback=None
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._frame_count = frame_count
     if channel_count is not None:
         channel_count = int(channel_count)
         assert 0 < channel_count
     self._channel_count = channel_count
     if callback is not None:
         assert isinstance(callback, (Request, RequestBundle))
     self._callback = callback
예제 #34
0
 def __init__(
     self, buffer_id=None, frame_count=None, channel_count=None, callback=None
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._frame_count = frame_count
     if channel_count is not None:
         channel_count = int(channel_count)
         assert 0 < channel_count
     self._channel_count = channel_count
     if callback is not None:
         assert isinstance(callback, (Request, RequestBundle))
     self._callback = callback
예제 #35
0
 def __init__(
     self,
     node_id_pairs=None,
     ):
     import supriya.commands
     Request.__init__(self)
     if node_id_pairs:
         if not isinstance(node_id_pairs, collections.Sequence):
             node_id_pairs = [node_id_pairs]
         prototype = supriya.commands.NodeIdPair
         assert all(isinstance(x, prototype) for x in node_id_pairs)
         node_id_pairs = tuple(node_id_pairs)
     self._node_id_pairs = node_id_pairs
예제 #36
0
 def __init__(self, index_count_value_triples=None):
     Request.__init__(self)
     if index_count_value_triples:
         triples = []
         for index, count, value in index_count_value_triples:
             index = int(index)
             count = int(count)
             value = float(value)
             assert 0 <= index
             assert 0 < count
             triple = (index, count, value)
             triples.append(triple)
         index_count_value_triples = tuple(triples)
     self._index_count_value_triples = index_count_value_triples
 def __init__(self, index_count_value_triples=None):
     Request.__init__(self)
     if index_count_value_triples:
         triples = []
         for index, count, value in index_count_value_triples:
             index = int(index)
             count = int(count)
             value = float(value)
             assert 0 <= index
             assert 0 < count
             triple = (index, count, value)
             triples.append(triple)
         index_count_value_triples = tuple(triples)
     self._index_count_value_triples = index_count_value_triples
 def __init__(self, index_values_pairs=None):
     Request.__init__(self)
     if index_values_pairs:
         pairs = []
         for index, values in index_values_pairs:
             index = int(index)
             values = tuple(float(value) for value in values)
             assert 0 <= index
             assert values
             if not values:
                 continue
             pair = (index, values)
             pairs.append(pair)
         index_values_pairs = tuple(pairs)
     self._index_values_pairs = index_values_pairs
 def __init__(self, index_values_pairs=None):
     Request.__init__(self)
     if index_values_pairs:
         pairs = []
         for index, values in index_values_pairs:
             index = int(index)
             values = tuple(float(value) for value in values)
             assert 0 <= index
             assert values
             if not values:
                 continue
             pair = (index, values)
             pairs.append(pair)
         index_values_pairs = tuple(pairs)
     self._index_values_pairs = index_values_pairs
 def __init__(
     self,
     amplitudes=None,
     as_wavetable=None,
     buffer_id=None,
     command_name=None,
     frequencies=None,
     phases=None,
     should_clear_first=None,
     should_normalize=None,
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     assert command_name in ("cheby", "sine1", "sine2", "sine3")
     self._command_name = command_name
     if as_wavetable is not None:
         as_wavetable = bool(as_wavetable)
     self._as_wavetable = as_wavetable
     if should_clear_first is not None:
         should_clear_first = bool(should_clear_first)
     self._should_clear_first = should_clear_first
     if should_normalize is not None:
         should_normalize = bool(should_normalize)
     self._should_normalize = should_normalize
     self._frequencies = None
     self._phases = None
     if command_name in ("cheby", "sine1"):
         if not isinstance(amplitudes, collections.Sequence):
             amplitudes = (amplitudes,)
         amplitudes = tuple(float(_) for _ in amplitudes)
         assert len(amplitudes)
         self._amplitudes = amplitudes
     if command_name == "sine2":
         amplitudes = tuple(float(_) for _ in amplitudes)
         frequencies = tuple(float(_) for _ in frequencies)
         assert 0 < len(amplitudes)
         assert len(amplitudes) == len(frequencies)
         self._amplitudes = amplitudes
         self._frequencies = frequencies
     if command_name == "sine3":
         amplitudes = tuple(float(_) for _ in amplitudes)
         frequencies = tuple(float(_) for _ in frequencies)
         phases = tuple(float(_) for _ in phases)
         assert 0 < len(amplitudes)
         assert len(amplitudes) == len(frequencies) == len(phases)
         self._amplitudes = amplitudes
         self._frequencies = frequencies
         self._phases = phases
예제 #41
0
 def __init__(
     self,
     buffer_id=None,
     frame_count=None,
     channel_count=None,
     completion_message=None,
 ):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._frame_count = frame_count
     if channel_count is not None:
         channel_count = int(channel_count)
         assert 0 < channel_count
     self._channel_count = channel_count
     self._completion_message = self._coerce_completion_message_input(
         completion_message)
예제 #42
0
 def __init__(self, items=None):
     # TODO: Support multi-group allocation
     import supriya.realtime
     Request.__init__(self)
     if items:
         if not isinstance(items, collections.Sequence):
             items = [items]
         items = list(items)
         for i, (add_action, node_id, target_node_id) in enumerate(items):
             add_action = supriya.AddAction.from_expr(add_action)
             items[i] = self.Item(
                 add_action=add_action,
                 node_id=node_id,
                 target_node_id=target_node_id,
             )
     self._items = items
    def __init__(self, callback=None, synthdefs=None, use_anonymous_names=None):
        import supriya.synthdefs

        Request.__init__(self)
        if callback is not None:
            assert isinstance(callback, (Request, RequestBundle))
        self._callback = callback
        if synthdefs:
            prototype = supriya.synthdefs.SynthDef
            if isinstance(synthdefs, prototype):
                synthdefs = (synthdefs,)
            assert all(isinstance(x, prototype) for x in synthdefs)
            synthdefs = tuple(synthdefs)
        self._synthdefs = synthdefs
        if use_anonymous_names is not None:
            use_anonymous_names = bool(use_anonymous_names)
        self._use_anonymous_names = use_anonymous_names
    def __init__(
        self,
        add_action=None,
        node_id=None,
        synthdef=None,
        target_node_id=None,
        **kwargs,
    ):
        import supriya.realtime
        import supriya.synthdefs

        Request.__init__(self)
        self._add_action = AddAction.from_expr(add_action)
        self._node_id = node_id
        prototype = (str, supriya.synthdefs.SynthDef)
        assert isinstance(synthdef, prototype)
        self._synthdef = synthdef
        self._target_node_id = target_node_id
        self._kwargs = tuple(sorted(kwargs.items()))
 def __init__(
     self,
     frame_count=None,
     source_buffer_id=None,
     source_starting_frame=None,
     target_buffer_id=None,
     target_starting_frame=None,
 ):
     Request.__init__(self)
     self._source_buffer_id = int(source_buffer_id)
     self._target_buffer_id = int(target_buffer_id)
     if frame_count is not None:
         frame_count = int(frame_count)
         assert -1 <= frame_count
     self._frame_count = frame_count
     if source_starting_frame is not None:
         source_starting_frame = int(source_starting_frame)
         assert 0 <= source_starting_frame
     self._source_starting_frame = source_starting_frame
     if target_starting_frame is not None:
         target_starting_frame = int(target_starting_frame)
         assert 0 <= target_starting_frame
     self._target_starting_frame = target_starting_frame
 def __init__(self, buffer_ids=None):
     Request.__init__(self)
     if buffer_ids:
         buffer_ids = tuple(int(buffer_id) for buffer_id in buffer_ids)
     self._buffer_ids = buffer_ids
 def __init__(self, buffer_id=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
 def __init__(self):
     Request.__init__(self)
 def __init__(self, buffer_id=None, index_count_pairs=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._index_count_pairs = tuple(
         (int(index), int(count)) for index, count in index_count_pairs
     )
 def __init__(self, callback=None, synthdef_path=None):
     Request.__init__(self)
     if callback is not None:
         assert isinstance(callback, (Request, RequestBundle))
     self._callback = callback
     self._synthdef_path = pathlib.Path(synthdef_path).absolute()
 def __init__(self):
     Request.__init__(self)
     raise NotImplementedError
 def __init__(self, buffer_id=None, callback=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     if callback is not None:
         assert isinstance(callback, (Request, RequestBundle))
     self._callback = callback
 def __init__(self, indices=None):
     Request.__init__(self)
     if indices:
         indices = tuple(int(index) for index in indices)
         assert all(0 <= index for index in indices)
     self._indices = indices
 def __init__(self, node_ids=None):
     Request.__init__(self)
     if not isinstance(node_ids, collections.Sequence):
         node_ids = (node_ids,)
     node_ids = tuple(int(_) for _ in node_ids)
     self._node_ids = node_ids
 def __init__(self, group_id):
     Request.__init__(self)
     self._group_id = group_id
 def __init__(self, buffer_id=None, indices=None):
     Request.__init__(self)
     self._buffer_id = int(buffer_id)
     self._indices = tuple(int(index) for index in indices)
예제 #57
0
 def __init__(self, sync_id=None):
     Request.__init__(self)
     self._sync_id = int(sync_id)
 def __init__(self, osc_status=None):
     Request.__init__(self)
     self._osc_status = int(osc_status)
 def __init__(self, include_controls=False, node_id=None):
     Request.__init__(self)
     self._node_id = node_id
     self._include_controls = bool(include_controls)
 def __init__(self, node_id=None, **kwargs):
     Request.__init__(self)
     self._node_id = node_id
     self._kwargs = dict((name, value) for name, value in kwargs.items())