Exemplo n.º 1
0
 def confirm_tone(self, *args):
     # TODO: add validation
     startNote = str(self.ids.startNote.text)
     octave = int(self.ids.octaveSlider.value)
     duration = float(self.ids.duration.text)
     endNote = str(self.ids.endNote.text)
     AudioManager.instance().ee.emit("add_tone", int(self.track_id),
                                     startNote, octave, duration, endNote)
     self.dismiss()
Exemplo n.º 2
0
 def confirm_track(self, *args):
     track_type = get_track_type(self.ids.trackType.text)
     vibrato_freq = float(self.ids.vibratoFrequencySlider.value)
     vibrato_var = float(self.ids.vibratoVarianceSlider.value)
     attack = float(self.ids.attackSlider.value)
     decay = float(self.ids.decaySlider.value)
     # Emit add track event
     AudioManager.instance().ee.emit("add_track", track_type, vibrato_freq,
                                     vibrato_var, attack, decay)
     print("track confirm")
     self.dismiss()
Exemplo n.º 3
0
    def confirm(self, instance):
        # Create a Mixer
        try:
            sampleRate = int(self.ids.sampleRate.text)
            amplitude = float(self.ids.amplitude.text)
            if sampleRate > 0 and amplitude > 0:
                mixer = AudioManager.instance().create_mixer(
                    sampleRate, amplitude)
                print(AudioManager.instance().mixer)
        except:
            print("Failed to create Mixer, please provide valid inputs")
            return

        self.dismiss()
        app = App.get_running_app()
        app.root.change_screen("MixerScreen")
Exemplo n.º 4
0
 def on_add_track(self, track_type, vibrato_freq, vibrato_var, attack,
                  decay):
     print(track_type)
     tracK_id = AudioManager.instance().create_track(
         track_type, vibrato_freq, vibrato_var, attack, decay)
     # self.ids.scroll.add_widget(Label(text="Track id: " + str(tracK_id)))
     # print(self.ids.scroll)
     self.data.append({'id': str(tracK_id)})
Exemplo n.º 5
0
 def on_add_tone(self, track_id, startNote, octave, duration, endNote):
     if int(self.parent.id) == track_id:
         tone = AudioManager.instance().add_tone(track_id, startNote,
                                                 octave, duration, endNote)
         self.data.append({
             'text':
             startNote + ' - ' + endNote + '\n' + str(duration) + 's'
         })
     pass
Exemplo n.º 6
0
 def __init__(self, **kwargs):
     super().__init__(**kwargs)
     self.data = []
     AudioManager.instance().ee.on("add_tone", self.on_add_tone)
Exemplo n.º 7
0
 def preview_audio(self, instance):
     AudioManager.instance().preview_audio()
     pass