コード例 #1
0
def getSawSound(freq,beat,subdivison, bpm=60):
    beat_in_mili = (60. / bpm) * 1000. /subdivison *beat
    saw = Sawtooth(freq)
    sound = saw.to_audio_segment(beat_in_mili)
    sound = sound.fade_in(int(beat_in_mili*.05))
    sound = sound.fade_out(int(beat_in_mili*.05))
    return sound
コード例 #2
0
ファイル: audio_generation.py プロジェクト: schmidtluk/slicer
def generate_notes_r():
    track = AudioSegment.empty()

    for i in range(16):
        saw = Sawtooth(NOTES.get(NAMES.get(random.randint(1, 8))))
        track += saw.to_audio_segment(500, VOLUME)

    return track
コード例 #3
0
def sawtoothDot(value, pan, ms=100, factor=1.0, sampleRate=96000, bitDepth=32):
    cNote = 440
    wave = Sawtooth(cNote * ((value + 0.00001) * factor),
                    sample_rate=sampleRate,
                    bit_depth=bitDepth)
    output = wave.to_audio_segment(duration=ms)
    output = output.fade_in(int(ms * 0.2))
    output = output.fade_out(int(ms * 0.2))
    output = output.pan(pan)
    return output
コード例 #4
0
ファイル: audio_generation.py プロジェクト: schmidtluk/slicer
def generate_notes():
    track = AudioSegment.empty()

    print("Please enter notes you want to play, separated by a space.")
    print("Available notes: ")
    print(NOTES.keys())
    notes = input().split(" ")

    for note in notes:
        saw = Sawtooth(NOTES.get(note))
        track += saw.to_audio_segment(500, VOLUME)

    return track