from soundwork.notes import * from soundwork.wavefile import open from soundwork import waveforms new = open('new-notes.wav', 'w') new.set(8, 44100) ladder = 'C0 C#0 D0 D#0 E0 F0 F#0 G0 G#0 A0 A#0 B0' for i in range(7): for note, length in parser('1/4 ' + ladder, bpm=70): note.up(OCTAVE * i) new.gen(waveforms.square(note.freq), length) new.close()
from soundwork.notes import * from soundwork.wavefile import open from soundwork.waveforms import * new = open("new-notes.wav", "w") new.set(8, 44100) classic = """1/8 E6 D#6 E6 D#6 E6 B5 D6 C6 3/8 A5 1/8 _ E5 A5 3/8 B5 1/8 E5 G#5 B5 3/8 C6""" x = Sequence(classic) print x x.reverse() print x ladder = "C0 C#0 D0 D#0 E0 F0 F#0 G0 G#0 A0 A#0 B0" melody = Sequence("1/4 " + ladder) instr = [sine, 1], [square, 4] for i in range(7): melody.up(OCTAVE) print melody # new.fromnotes(melody, instr, bpm=70) new.close()
from soundwork import wavefile from soundwork.waveforms import * melody = """1/8 E6 D#6 E6 D#6 E6 B5 D6 C6 3/8 A5 1/8 _ E5 A5 3/8 B5 1/8 E5 G#5 B5 3/8 C6""" new = wavefile.open('build-merg.wav', 'w') new.set(8, 44100) zigzag = [sine, 0.5], [square, 16] new.fromnotes(melody, zigzag, bpm=50) new.fromnotes(melody, [sine, 1], bpm=70) new.fromnotes(melody, zigzag, bpm=60) new.fromnotes(melody, [sine, 1], bpm=80) new.close()
from soundwork import wavefile, waveforms, notes melody2 = "1/4 C#4 _ C#4 _ C4 _ _ B3 _ E4 _ A3 _ C4 C4 _ " msec_notation = """100.C#.4 100.P 100.C#.4 100.P 100.C.4 200.P 100.B.3 100.P 100.E.4 100.P 100.A.3 100.P 200.C.4 100.P """ new = wavefile.open('buildy.wav', 'w') new.set(8, 44100) for freq, leng in notes.parser(melody2 * 4, bpm=130): new.gen(waveforms.square(freq), leng) new.close()
from soundwork.notes import * from soundwork.wavefile import open from soundwork.waveforms import * new = open('new-notes.wav', 'w') new.set(8, 44100) classic = """1/8 E6 D#6 E6 D#6 E6 B5 D6 C6 3/8 A5 1/8 _ E5 A5 3/8 B5 1/8 E5 G#5 B5 3/8 C6""" x = Sequence(classic) print x x.reverse() print x ladder = 'C0 C#0 D0 D#0 E0 F0 F#0 G0 G#0 A0 A#0 B0' melody = Sequence('1/4 ' + ladder) instr = [sine, 1], [square, 4] for i in range(7): melody.up(OCTAVE) print melody #new.fromnotes(melody, instr, bpm=70) new.close()
from soundwork import wavefile from soundwork.waveforms import * melody = """1/8 E6 D#6 E6 D#6 E6 B5 D6 C6 3/8 A5 1/8 _ E5 A5 3/8 B5 1/8 E5 G#5 B5 3/8 C6""" new = wavefile.open("build-merg.wav", "w") new.set(8, 44100) zigzag = [sine, 0.5], [square, 16] new.fromnotes(melody, zigzag, bpm=50) new.fromnotes(melody, [sine, 1], bpm=70) new.fromnotes(melody, zigzag, bpm=60) new.fromnotes(melody, [sine, 1], bpm=80) new.close()
from soundwork import wavefile from soundwork.waveforms import * #melody = """100.C#.4 100.P 100.C#.4 100.P 100.C.4 #200.P 100.B.3 100.P 100.E.4 100.P 100.A.3 100.P 200.C.4 100.P """ melody = """1/8 E6 D#6 E6 D#6 E6 B5 D6 C6 3/8 A5 1/8 _ E5 A5 3/8 B5 1/8 E5 G#5 B5 3/8 C6 _""" new = wavefile.open('build-merg.wav', 'w') new.set(8, 44100) # def merging(): # for freq, length in notes.parser(melody, bpm=50): # merged = merge(sine(freq), square(freq*4)) # new.gen(merged, length) # def simple(): # for freq, length in notes.parser(melody, bpm=50): # new.gen(sine(freq), length) # merging() # simple() # merging() # simple() zigzag = [sine, 1], [square, 4] new.fromnotes(melody, zigzag, bpm=50) new.fromnotes(melody, [sine, 1], bpm=70) new.fromnotes(melody, zigzag, bpm=60) new.fromnotes(melody, [sine, 1], bpm=80)