-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWav2Fur.py
43 lines (32 loc) · 929 Bytes
/
Wav2Fur.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from NoteClass import Note
from helpers.ReadWav import Get_Data
from helpers.FilterHanning import Filter_Data
from GetRow import Get_Row
from OutputHandler import output_note_data
import scipy.io.wavfile
import numpy
"""
Main
"""
# get input
file_name = input("Please input the file to be read: ")
channel_number = int(input("Input the number of channels: "))
# fetch data
frames, samplerate = Get_Data(file_name)
# filter data
frames = Filter_Data(frames)
# unframes = []
# for frame in frames:
# for value in frame:
# unframes.append(value)
# scipy.io.wavfile.write("unframesTest.wav", samplerate, numpy.copy(unframes))
# exit()
# generate notes from sound data
note_data = []
for i in range(len(frames)):
print("Frame count: " + str(i))
note_data.append(Get_Row(frames[i], samplerate, channel_number))
# notify user
print("Finished processing!\a")
# output result
output_note_data(note_data)