def remove_control_point( node_id: str, id: int # pylint: disable=redefined-builtin ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[processor_message_registry_pb2.cvgenerator_remove_control_point] pb.id = id return msg
def remove_sample( node_id: str, id: int # pylint: disable=redefined-builtin ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.sample_script_remove_sample] pb.id = id return msg
def remove_segment( node_id: str, segment_id: int, ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.pianoroll_mutation].remove_segment pb.id = segment_id return msg
def remove_interval( node_id: str, id: int # pylint: disable=redefined-builtin ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.pianoroll_remove_interval] pb.id = id return msg
def update( node_id: str, device_uri: str = None, channel_filter: int = None ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[processor_message_registry_pb2.midi_source_update] if device_uri is not None: pb.device_uri = device_uri if channel_filter is not None: pb.channel_filter = channel_filter return msg
def add_segment( node_id: str, segment_id: int, duration: audioproc.MusicalDuration, ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.pianoroll_mutation].add_segment pb.id = segment_id pb.duration.CopyFrom(duration.to_proto()) return msg
def add_control_point( node_id: str, id: int, # pylint: disable=redefined-builtin time: audioproc.MusicalTime, value: float ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[processor_message_registry_pb2.cvgenerator_add_control_point] pb.id = id pb.time.CopyFrom(time.to_proto()) pb.value = value return msg
def update_segment_ref( node_id: str, segment_ref_id: int, time: audioproc.MusicalTime = None, ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.pianoroll_mutation].update_segment_ref pb.id = segment_ref_id if time is not None: pb.time.CopyFrom(time.to_proto()) return msg
def add_segment_ref( node_id: str, segment_ref_id: int, time: audioproc.MusicalTime, segment_id: int, ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.pianoroll_mutation].add_segment_ref pb.id = segment_ref_id pb.time.CopyFrom(time.to_proto()) pb.segment_id = segment_id return msg
def add_interval( node_id: str, id: int, # pylint: disable=redefined-builtin start_time: audioproc.MusicalTime, end_time: audioproc.MusicalTime, pitch: int, velocity: int, ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[processor_message_registry_pb2.pianoroll_add_interval] pb.id = id pb.start_time.CopyFrom(start_time.to_proto()) pb.end_time.CopyFrom(end_time.to_proto()) pb.pitch = pitch pb.velocity = velocity return msg
def add_sample( node_id: str, id: int, # pylint: disable=redefined-builtin time: audioproc.MusicalTime, sample_rate: int, num_samples: int, channel_paths: List[str], ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.sample_script_add_sample] pb.id = id pb.time.CopyFrom(time.to_proto()) pb.sample_rate = sample_rate pb.num_samples = num_samples pb.channel_paths.extend(channel_paths) return msg
def add_event( node_id: str, segment_id: int, event_id: int, time: audioproc.MusicalTime, type: processor_messages_pb2.PianoRollMutation.AddEvent.Type, # pylint: disable=redefined-builtin channel: int, pitch: int, velocity: int, ) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[ processor_message_registry_pb2.pianoroll_mutation].add_event pb.segment_id = segment_id pb.id = event_id pb.time.CopyFrom(time.to_proto()) pb.type = type pb.channel = channel pb.pitch = pitch pb.velocity = velocity return msg
def learn(node: model.MidiCCtoCV, enable: bool) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node.pipeline_node_id) pb = msg.Extensions[processor_message_registry_pb2.midi_cc_to_cv_learn] pb.enable = enable return msg
def __recordClicked(self) -> None: msg = audioproc.ProcessorMessage(node_id=self.__node.pipeline_node_id) pb = msg.Extensions[processor_message_registry_pb2.midi_looper_record] pb.start = 1 self.call_async(self.project_view.sendNodeMessage(msg))
def change_instrument( node_id: str, instrument_spec: audioproc.InstrumentSpec) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) (msg.Extensions[processor_message_registry_pb2.change_instrument] .instrument_spec.CopyFrom(instrument_spec)) return msg
def event(node_id: str, midi: bytes) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[processor_message_registry_pb2.midi_source_event] pb.midi = midi return msg
def emit_events(node_id: str, midi: Iterable[bytes]) -> audioproc.ProcessorMessage: msg = audioproc.ProcessorMessage(node_id=node_id) pb = msg.Extensions[processor_message_registry_pb2.pianoroll_emit_events] pb.midi.extend(midi) return msg