コード例 #1
0
ファイル: bitcrusher.py プロジェクト: stackp/Gum
def bitcrusher(sound, start, end):
    def process(nbits):
        y = bitcrush(sound.frames[start:end], nbits)
        sound.paste(start, end, y)

    def callback(parameters):
        nbits = parameters["Bit Width"]
        global nbits_last
        nbits_last = nbits
        process(nbits)

    d = EffectDialog("BitCrusher")
    global nbits_last
    d.add_slider("Bit Width", nbits_last, 2, 12)
    d.callback = callback

    return d
コード例 #2
0
def bitcrusher(sound, start, end):

    def process(nbits):
        y = bitcrush(sound.frames[start:end], nbits)
        sound.paste(start, end, y)

    def callback(parameters):
        nbits = parameters['Bit Width']
        global nbits_last
        nbits_last = nbits
        process(nbits)

    d = EffectDialog('BitCrusher')
    global nbits_last
    d.add_slider('Bit Width', nbits_last, 2, 12)
    d.callback = callback

    return d
コード例 #3
0
def volume(sound, start, end):
    def process(volume):
        gain = volume / 100.
        x = sound.frames[start:end]
        y = x * gain
        sound.paste(start, end, y)

    def callback(parameters):
        global volume_last
        volume = parameters['Volume']
        volume_last = volume
        process(volume)

    global volume_last
    d = EffectDialog('Volume')
    d.add_slider('Volume', volume_last, 0, 200, 0)
    d.callback = callback
    return d
コード例 #4
0
ファイル: volume.py プロジェクト: ViktorNova/Gum
def volume(sound, start, end):

    def process(volume):
        gain = volume / 100.
        x = sound.frames[start:end]
        y = x * gain
        sound.paste(start, end, y)

    def callback(parameters):
        global volume_last
        volume = parameters['Volume']
        volume_last = volume
        process(volume)

    global volume_last
    d = EffectDialog('Volume')
    d.add_slider('Volume', volume_last, 0, 200, 0)
    d.callback = callback
    return d
コード例 #5
0
def svf_fx(type, sound, start, end):
    def process(freq, damp):
        def apply(channel):
            filtered = svf(channel, freq, damp, sound.samplerate)
            i = svf_index[type]
            return filtered[i]

        y = process_each_channel(apply, sound.frames[start:end])
        sound.paste(start, end, y)

    def callback(parameters):
        freq = parameters['Frequency']
        damp = parameters['Damping']
        process(freq, damp)

    d = EffectDialog(type + ' State Variable Filter')
    d.add_slider('Frequency', 500, 0, 5000)
    d.add_slider('Damping', 0.5, 0.01, 3, 1)
    d.callback = callback
    return d
コード例 #6
0
ファイル: svf.py プロジェクト: ViktorNova/Gum
def svf_fx(type, sound, start, end):

    def process(freq, damp):
        def apply(channel):
            filtered = svf(channel, freq, damp, sound.samplerate)
            i = svf_index[type]
            return filtered[i]
        y = process_each_channel(apply, sound.frames[start:end])
        sound.paste(start, end, y)

    def callback(parameters):
        freq = parameters['Frequency']
        damp = parameters['Damping']
        process(freq, damp)

    d = EffectDialog(type + ' State Variable Filter')
    d.add_slider('Frequency', 500, 0, 5000)
    d.add_slider('Damping', 0.5, 0.01, 3, 1)
    d.callback = callback
    return d