def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='noise oscillator',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        # One Iso output for the noise
        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, True, names='audio output')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.osc = synth_noise.noise(self.output.cookie(), self.domain)

        # Two Iso inputs, volume, and filter freq
        self.input = bundles.VectorInput(self.osc.cookie(),
                                         self.domain,
                                         signals=(1, 2))
        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names="volume input",
                               policy=self.input.local_policy(
                                   1, policy.IsoStreamPolicy(1, 0, 0)))
        self[2][2] = atom.Atom(domain=domain.BoundedFloat(0, 20000),
                               names="filter frequency input",
                               policy=self.input.merge_policy(2, True))
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='sawtooth oscillator',
                             ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self[1] = bundles.Output(1, True, names='audio output')

        self.output = bundles.Splitter(self.domain, self[1])
        self.osc = synth_native.sawtooth(self.output.cookie(), self.domain)
        self.input = bundles.VectorInput(self.osc.cookie(),
                                         self.domain,
                                         signals=(1, 2, 4))

        self[2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            init=0,
                            names='volume input',
                            policy=self.input.local_policy(
                                1, policy.IsoStreamPolicy(1, 0, 0)))
        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 96000, rest=440),
                            names='frequency input',
                            policy=self.input.merge_policy(2, False))
        self[4] = atom.Atom(init=0.0,
                            domain=domain.BoundedFloat(-1200, 1200),
                            names='detune input',
                            policy=self.input.merge_policy(4, False))
Esempio n. 3
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='rectangle oscillator',
                             ordinal=ordinal)
        self.domain = piw.clockdomain_ctl()

        self[1] = bundles.Output(1, True, names="audio output")

        self.output = bundles.Splitter(self.domain, self[1])
        self.osc = synth_native.rect(self.output.cookie(), self.domain)
        self.input = bundles.VectorInput(self.osc.cookie(),
                                         self.domain,
                                         signals=(1, 2, 3, 4))

        self[2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            names="volume input",
                            policy=self.input.local_policy(
                                1, policy.IsoStreamPolicy(1, 0, 0)))
        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 96000),
                            names="frequency input",
                            policy=self.input.merge_policy(2, False))
        self[4] = atom.Atom(domain=domain.BoundedFloat(0.1, 0.9, rest=0.5),
                            names="pulse width input",
                            policy=self.input.merge_policy(3, False))
        self[5] = atom.Atom(domain=domain.BoundedFloat(-1200, 1200),
                            names='detune input',
                            policy=self.input.merge_policy(4, False))
Esempio n. 4
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='envelope',
                             ordinal=ordinal)

        self[2] = atom.Atom()
        self[2][2] = bundles.Output(2, False, names='pressure output')
        self[2][100] = bundles.Output(1, True, names='volume output')

        self.domain = piw.clockdomain_ctl()
        self.output = bundles.Splitter(self.domain, *self[2].values())
        self.adsr = synth_native.adsr(self.output.cookie(), self.domain)
        self.vel = piw.velocitydetect(self.adsr.cookie(), 2, 1)
        self.input = bundles.VectorInput(self.vel.cookie(),
                                         self.domain,
                                         signals=(1, 2, 8, 9, 10, 11),
                                         threshold=5)

        time = (T('inc', 0.01), T('biginc', 0.2), T('control', 'updown'))
        self[1] = atom.Atom()

        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               names='activation input',
                               policy=self.input.merge_policy(1, False))
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=0,
                               policy=self.input.vector_policy(2, False),
                               names='pressure input')
        self[1][8] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0.01,
                               names="attack input",
                               policy=self.input.merge_policy(8, False))
        self[1][9] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0.05,
                               names="decay input",
                               policy=self.input.merge_policy(9, False))
        self[1][10] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                                init=0,
                                policy=self.input.merge_policy(
                                    10, policy.IsoStreamPolicy(1, 0, 0)),
                                names='sustain input',
                                fuzzy='++++pressure')
        self[1][11] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                                init=0.25,
                                names="release input",
                                policy=self.input.merge_policy(11, False))

        self[3] = atom.Atom(domain=domain.BoundedInt(1, 1000),
                            init=4,
                            names="velocity sample",
                            policy=atom.default_policy(self.__set_samples))
        self[4] = atom.Atom(domain=domain.BoundedFloat(0.1, 10),
                            init=4,
                            names="velocity curve",
                            policy=atom.default_policy(self.__set_curve))
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.1, 10),
                            init=4,
                            names="velocity scale",
                            policy=atom.default_policy(self.__set_scale))
Esempio n. 5
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='vu meter',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(OUT_LIGHT,
                                    True,
                                    names='light output',
                                    protocols='revconnect')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.native = vu_meter_native.vu_meter(self.output.cookie(),
                                               self.domain)

        self.input = bundles.VectorInput(self.native.cookie(),
                                         self.domain,
                                         signals=(IN_AUDIO, ))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                               names="audio input",
                               policy=self.input.vector_policy(
                                   IN_AUDIO, policy.IsoStreamPolicy(1, -1, 0)))

        self[3] = atom.Atom(names='thresholds')
        self[3][1] = atom.Atom(domain=domain.BoundedFloat(-90, 0),
                               init=-40.0,
                               policy=atom.default_policy(self.__signal_level),
                               names='signal threshold')
        self[3][2] = atom.Atom(domain=domain.BoundedFloat(-90, 0),
                               init=-6.0,
                               policy=atom.default_policy(self.__high_level),
                               names='high threshold')
        self[3][3] = atom.Atom(domain=domain.BoundedFloat(-90, 0),
                               init=-1,
                               policy=atom.default_policy(self.__clip_level),
                               names='clip threshold')

        self[4] = atom.Atom(domain=domain.BoundedInt(1, 100),
                            init=5,
                            policy=atom.default_policy(self.__size),
                            names='size')
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.0, 30),
                            init=5,
                            policy=atom.default_policy(self.__clip_hold),
                            names='clip hold')

        self.__send_parameters()
Esempio n. 6
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='gain',
                             ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()
        self.output = bundles.Splitter(self.domain)
        self.gain = piw.linear_gain(self.output.cookie(), self.domain)
        self.input = bundles.VectorInput(self.gain.cookie(),
                                         self.domain,
                                         signals=(1, 2, 3, 4, 5, 6, 7, 8, 9,
                                                  10))

        self[1] = audio.AudioOutput(self.output, 2, 1)
        self[2] = audio.AudioInput(self.input, 2, 1)
        self[4] = audio.AudioChannels(self[1], self[2])

        self[3] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                            names="volume input",
                            policy=self.input.merge_policy(
                                1, policy.IsoStreamPolicy(1, 0, 0)))
Esempio n. 7
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='panner',
                             ordinal=ordinal)

        self.pan = piw.make_f2f_table(-1, 1, 1000,
                                      picross.make_f2f_functor(pan_function))

        self.domain = piw.clockdomain_ctl()
        self.output = bundles.Splitter(self.domain)
        self.panner = piw.panner(self.pan, self.output.cookie(), self.domain)
        self.input = bundles.VectorInput(self.panner.cookie(),
                                         self.domain,
                                         signals=(1, 2, 3))

        self[1] = audio.AudioOutput(self.output, 1, 2)
        self[2] = audio.AudioInput(self.input, 2, 2)

        self[3] = atom.Atom(domain=domain.BoundedFloat(-1, 1),
                            names="pan input",
                            policy=self.input.merge_policy(
                                1, policy.IsoStreamPolicy(1, -1, 0)))
Esempio n. 8
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self,
                             signature=version,
                             names='ahdsr',
                             ordinal=ordinal)

        self[2] = atom.Atom()
        self[2][1] = bundles.Output(1, True, names='volume output')
        self[2][2] = bundles.Output(2, False, names='activation output')
        self[2][3] = bundles.Output(8, False, names='pressure output')

        self.domain = piw.clockdomain_ctl()
        self.output = bundles.Splitter(self.domain, self[2][1], self[2][2],
                                       self[2][3])
        self.adsr = synth_native.adsr2(self.output.cookie(), self.domain)
        self.vdetect = piw.velocitydetect(self.adsr.cookie(), 8, 1)

        self[3] = atom.Atom(domain=domain.BoundedInt(1, 1000),
                            init=4,
                            names="velocity sample",
                            policy=atom.default_policy(self.__set_samples))
        self[4] = atom.Atom(domain=domain.BoundedFloat(0.1, 10),
                            init=4,
                            names="velocity curve",
                            policy=atom.default_policy(self.__set_curve))
        self[5] = atom.Atom(domain=domain.BoundedFloat(0.1, 10),
                            init=4,
                            names="velocity scale",
                            policy=atom.default_policy(self.__set_scale))
        self.input = bundles.VectorInput(self.vdetect.cookie(),
                                         self.domain,
                                         signals=(2, 3, 4, 5, 6, 7, 8, 9, 10,
                                                  11, 12, 13, 14),
                                         threshold=5)

        time = (T('inc', 0.01), T('biginc', 0.2), T('control', 'updown'))
        self[1] = atom.Atom()
        self[1][1] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=1.0,
                               names="activation input",
                               policy=self.input.merge_policy(13, False),
                               protocols="nostage")
        self[1][2] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0,
                               names="delay input",
                               policy=self.input.merge_policy(2, False))
        self[1][3] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0.01,
                               names="attack input",
                               policy=self.input.merge_policy(3, False))
        self[1][4] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0,
                               names="hold input",
                               policy=self.input.merge_policy(4, False))
        self[1][5] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0.05,
                               names="decay input",
                               policy=self.input.merge_policy(5, False))
        self[1][6] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=1.0,
                               names="sustain input",
                               policy=self.input.merge_policy(6, False))
        self[1][7] = atom.Atom(domain=domain.BoundedFloat(0, 60, hints=time),
                               init=0.5,
                               names="release input",
                               policy=self.input.merge_policy(7, False))
        self[1][8] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=0,
                               names="pressure input",
                               ordinal=1,
                               policy=self.input.vector_policy(8, False))
        self[1][9] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                               init=0,
                               names="pressure input",
                               ordinal=2,
                               policy=self.input.vector_policy(
                                   9, policy.IsoStreamPolicy(1, 0, 0)))
        self[1][10] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                                init=0,
                                names="velocity sensitivity input",
                                policy=self.input.merge_policy(10, False))
        self[1][11] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                                init=0,
                                names="aftertouch input",
                                policy=self.input.merge_policy(11, False))
        self[1][12] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                                init=0,
                                names="pedal input",
                                policy=self.input.latch_policy(12, False))
        self[1][13] = atom.Atom(domain=domain.BoundedFloat(0, 1),
                                init=0.5,
                                names="damper input",
                                policy=self.input.linger_policy(14, False))

        self.__set_samples(4)
        self.__set_curve(4)
        self.__set_scale(4)
Esempio n. 9
0
    def __init__(self, agent, index):
        
        self.__agent = agent
        self.__index = index

        atom.Atom.__init__(self,names='channel',ordinal=index,protocols='remove nostage')

        self[1] = atom.Atom(domain=domain.BoundedFloat(-1,1),names='audio input',policy=self.__agent.input.vector_policy(index,True),protocols='nostage')
        self[2] = atom.Atom(domain=domain.BoundedFloat(0,1),names="volume input",policy=self.__agent.input.merge_policy(index+MAX_CHANNEL,policy.IsoStreamPolicy(1,0,0)))
Esempio n. 10
0
    def __init__(self, address, ordinal):
        agent.Agent.__init__(self, signature=version, names='example', ordinal=ordinal)

        self.domain = piw.clockdomain_ctl()

        self[1] = atom.Atom(names='outputs')
        self[1][1] = bundles.Output(1, True, names='audio output')
        self.output = bundles.Splitter(self.domain, self[1][1])

        self.example = cfiltertemplate_native.example(self.output.cookie(), self.domain)

        self.input = bundles.VectorInput(self.example.cookie(), self.domain, signals=(1, 2))

        self[2] = atom.Atom(names='inputs')
        self[2][1] = atom.Atom(domain=domain.BoundedFloat(0,1), names="volume input", policy=self.input.local_policy(1,policy.IsoStreamPolicy(1,0,0)))
        self[2][2] = atom.Atom(domain=domain.BoundedFloat(0,96000, rest=440), names="frequency input", policy=self.input.merge_policy(2,False))