Ejemplo n.º 1
0
    def __init__(self, setting, notePerBar_n = 16, bpm = 120):
        self._notePerBar_n = notePerBar_n
        self._bpm = bpm
        self._noteMinLen_sec = func.a16beatToSec(self._bpm)
        self.setting = setting

        self.sampler = samp.Synthesizer(self.setting["file"], self.setting["freqFilterName"], self.setting["freqFilterRange"], self.setting["adsr"], self.setting["rate"])
Ejemplo n.º 2
0
    def __init__(self, instName, notePerBar_n=16, bpm=120):
        self._notePerBar_n = notePerBar_n
        self._bpm = bpm
        self._noteMinLen_sec = func.a16beatToSec(self._bpm)

        if instName == 'kick':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/box_proc_20180628_174821.wav",
                samp.FilterName.lowpass, [100], [0.001, 0.02, 0.6, 0.02],
                44100)
        elif instName == 'snare':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/keyboard_proc_20180628_175123.wav",
                samp.FilterName.bandcut, [300, 8000], [0.001, 0.02, 0.6, 0.02],
                44100)
        elif instName == 'hihat':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/eSkateBoard_proc_20180628_175042.wav",
                samp.FilterName.bandpass, [1600, 8000],
                [0.001, 0.02, 0.1, 0.02], 44100)
        #elif instName == 'snare3':
        #    self.sampler = samp.Synthesizer("C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/rindarinda_proc_20180628_175248.wav", samp.FilterName.bandpass, [300,8000], [0.3, 0.02, 0.3, 0.02], 44100)
        elif instName == 'fx1':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/venova_proc_20180628_175220.wav",
                samp.FilterName.bandpass, [10, 8000], [0.3, 0.02, 0.8, 0.02],
                44100)
        elif instName == 'fx2':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/eSkateBoard_proc_20180628_175042.wav",
                samp.FilterName.bandpass, [1600, 8000],
                [0.001, 0.02, 0.1, 0.02], 44100)
        elif instName == 'fx3':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/rindarinda_proc_20180628_180349.wav",
                samp.FilterName.bandpass, [300, 8000], [0.3, 0.02, 0.3, 0.02],
                44100)
        elif instName == 'fx4':
            return None
Ejemplo n.º 3
0
    def __init__(self, instName, notePerBar_n=16, bpm=120):
        self._notePerBar_n = notePerBar_n
        self._bpm = bpm
        self._noteMinLen_sec = func.a16beatToSec(self._bpm)

        if instName == 'bass':
            self.synthesizer = aSynthe.Synthesizer(
                [aSynthe.Waveform.sine, aSynthe.Waveform.sine], [1.0, 0.1],
                [1.0, 2.0], aSynthe.FilterName.lowpass, [6000],
                [0.03, 0.02, 0.9, 0.01], 44100)
        elif instName == 'lead':
            #self.synthesizer = aSynthe.Synthesizer([aSynthe.Waveform.sawtooth, aSynthe.Waveform.square], [1.0, 0.8], [1.0, 1.02], aSynthe.FilterName.bandpass, [1000,12000], [0.05, 0.01, 0.4, 0.01], 44100)
            self.synthesizer = aSynthe.Synthesizer(
                [aSynthe.Waveform.sine, aSynthe.Waveform.square], [1.0, 0.8],
                [1.0, 1.02], aSynthe.FilterName.lowpass, [500],
                [0.01, 0.01, 0.1, 0.01], 44100)
        elif instName == 'lead2':
            self.synthesizer = aSynthe.Synthesizer(
                [aSynthe.Waveform.sine, aSynthe.Waveform.square], [1.0, 0.8],
                [1.02, 1.02], aSynthe.FilterName.bandpass, [10000, 12000],
                [0.05, 0.01, 0.4, 0.01], 44100)
            #self.synthesizer = aSynthe.Synthesizer([aSynthe.Waveform.sawtooth, aSynthe.Waveform.sine], [1.0, 0.8], [1.0, 1.02], aSynthe.FilterName.bandcut, [5000,12000], [0.03, 0.2, 0.1, 0.01], 44100)
        #elif instName == 'voice':
        #    self.synthesizer = aSynthe.Synthesizer([aSynthe.Waveform.sine, aSynthe.Waveform.sawtooth], [1.0, 0.05], [1.0, 0.01], aSynthe.FilterName.bandpass, [10,10000], [0.001, 0.02, 0.6, 0.2], 44100)
        elif instName == 'voice':
            self.synthesizer = aSynthe.Synthesizer(
                [aSynthe.Waveform.sine, aSynthe.Waveform.square], [1.0, 0.8],
                [1.0, 2.02], aSynthe.FilterName.bandpass, [50, 1200],
                [0.01, 0.1, 0.8, 0.1], 44100)
        elif instName == 'fx1':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/venova_proc_20180628_175220.wav",
                samp.FilterName.bandpass, [10, 8000], [0.3, 0.02, 0.8, 0.02],
                44100)
        elif instName == 'kick':
            self.sampler = samp.Synthesizer("C:/work/python/kick.wav",
                                            samp.FilterName.lowpass, [100],
                                            [0.001, 0.02, 0.6, 0.02], 44100)
        elif instName == 'kick2':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/box_proc_20180628_174821.wav",
                samp.FilterName.lowpass, [100], [0.001, 0.02, 0.6, 0.02],
                44100)
        elif instName == 'snare':
            self.sampler = samp.Synthesizer("C:/work/python/snare.wav",
                                            samp.FilterName.bandcut,
                                            [100, 2000],
                                            [0.001, 0.02, 0.6, 0.02], 44100)
            #self.synthesizer = aSynthe.Synthesizer([aSynthe.Waveform.whitenoise, aSynthe.Waveform.sawtooth], [1.0, 1.0], [1.0, 0.5], aSynthe.FilterName.bandcut, [500,20000], [0.0001, 0.02, 0.02, 0.1], 44100)
        elif instName == 'snare2':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/keyboard_proc_20180628_175123.wav",
                samp.FilterName.bandcut, [300, 8000], [0.001, 0.02, 0.6, 0.02],
                44100)
        elif instName == 'snare3':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/rindarinda_proc_20180628_175248.wav",
                samp.FilterName.bandpass, [300, 8000], [0.3, 0.02, 0.3, 0.02],
                44100)
        elif instName == 'fx4':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/rindarinda_proc_20180628_180349.wav",
                samp.FilterName.bandpass, [300, 8000], [0.3, 0.02, 0.3, 0.02],
                44100)
        elif instName == 'hihat':
            self.synthesizer = aSynthe.Synthesizer(
                [aSynthe.Waveform.whitenoise, aSynthe.Waveform.sawtooth],
                [1.0, 0.2], [1.0, 0.0], aSynthe.FilterName.bandpass,
                [8000, 16000], [0.0001, 0.01, 0.001, 0.01], 44100)
        elif instName == 'hihat2':
            self.sampler = samp.Synthesizer(
                "C:/Users/hikari.kubota/Documents/GitHub/auto_music/SongGenerator/mikakunin/wav/sample/eSkateBoard_proc_20180628_175042.wav",
                samp.FilterName.bandpass, [1600, 8000],
                [0.001, 0.02, 0.1, 0.02], 44100)