コード例 #1
0
ファイル: model.py プロジェクト: wanderer6994/noisicaa
    def __get_spec_mutation(self) -> audioproc.Mutation:
        params = audioproc.NodeParameters()
        spec = params.Extensions[processor_pb2.oscilloscope_spec]
        spec.foo = 1

        return audioproc.Mutation(
            set_node_parameters=audioproc.SetNodeParameters(
                node_id=self.pipeline_node_id, parameters=params))
コード例 #2
0
ファイル: model.py プロジェクト: wanderer6994/noisicaa
    def __get_spec_mutation(self) -> audioproc.Mutation:
        params = audioproc.NodeParameters()
        spec = params.Extensions[processor_pb2.cv_mapper_spec]
        spec.transfer_function.CopyFrom(self.transfer_function.get_function_spec())

        return audioproc.Mutation(
            set_node_parameters=audioproc.SetNodeParameters(
                node_id=self.pipeline_node_id,
                parameters=params))
コード例 #3
0
ファイル: model.py プロジェクト: wanderer6994/noisicaa
 def __get_code_mutation(self) -> audioproc.Mutation:
     params = audioproc.NodeParameters()
     csound_params = params.Extensions[
         processor_pb2.custom_csound_parameters]
     csound_params.orchestra = self.full_orchestra
     csound_params.score = self.score or ''
     return audioproc.Mutation(
         set_node_parameters=audioproc.SetNodeParameters(
             node_id=self.pipeline_node_id, parameters=params))
コード例 #4
0
    def __get_spec_mutation(self) -> audioproc.Mutation:
        params = audioproc.NodeParameters()
        spec = params.Extensions[processor_pb2.metronome_spec]
        spec.sample_path = self.sample_path
        spec.duration.numerator = 1
        spec.duration.denominator = 4

        return audioproc.Mutation(
            set_node_parameters=audioproc.SetNodeParameters(
                node_id=self.pipeline_node_id,
                parameters=params))
コード例 #5
0
ファイル: model.py プロジェクト: wanderer6994/noisicaa
    def __get_spec_mutation(self) -> audioproc.Mutation:
        params = audioproc.NodeParameters()
        spec = params.Extensions[processor_pb2.midi_looper_spec]
        spec.duration.CopyFrom(self.duration.to_proto())
        for event in self.patches[0].events:
            pb_event = spec.events.add()
            pb_event.CopyFrom(event.to_proto())

        return audioproc.Mutation(
            set_node_parameters=audioproc.SetNodeParameters(
                node_id=self.pipeline_node_id,
                parameters=params))
コード例 #6
0
ファイル: model.py プロジェクト: wanderer6994/noisicaa
    def __get_spec_mutation(self) -> audioproc.Mutation:
        params = audioproc.NodeParameters()
        spec = params.Extensions[processor_pb2.midi_cc_to_cv_spec]
        for channel_idx, channel in enumerate(self.channels):
            channel_spec = spec.channels.add()
            channel_spec.midi_channel = channel.midi_channel
            channel_spec.midi_controller = channel.midi_controller
            channel_spec.initial_value = self.__controller_values.get(
                channel_idx, 0)
            channel_spec.min_value = channel.min_value
            channel_spec.max_value = channel.max_value
            channel_spec.log_scale = channel.log_scale

        return audioproc.Mutation(
            set_node_parameters=audioproc.SetNodeParameters(
                node_id=self.pipeline_node_id, parameters=params))
コード例 #7
0
ファイル: model.py プロジェクト: wanderer6994/noisicaa
    def __get_spec_mutation(self) -> audioproc.Mutation:
        params = audioproc.NodeParameters()
        spec = params.Extensions[processor_pb2.step_sequencer_spec]
        spec.num_steps = self.num_steps
        spec.time_synched = self.time_synched
        for channel in self.channels:
            channel_spec = spec.channels.add()
            channel_spec.type = channel.type
            for step in channel.steps[:self.num_steps]:
                if channel.type in (model_pb2.StepSequencerChannel.GATE,
                                    model_pb2.StepSequencerChannel.TRIGGER):
                    channel_spec.step_enabled.append(step.enabled)
                else:
                    assert channel.type == model_pb2.StepSequencerChannel.VALUE
                    channel_spec.step_value.append(
                        step.value * (channel.max_value - channel.min_value) +
                        channel.min_value)

        return audioproc.Mutation(
            set_node_parameters=audioproc.SetNodeParameters(
                node_id=self.pipeline_node_id, parameters=params))