audio2midi 0.3.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- # Python-generated files
2
- __pycache__/
3
- *.py[oc]
4
- build/
5
- dist/
6
- wheels/
7
- *.egg-info
8
-
9
- # Virtual environments
10
- .venv
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
@@ -1 +1 @@
1
- 3.11
1
+ 3.11
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: audio2midi
3
+ Version: 0.5.0
4
+ Summary: Audio To Midi
5
+ Author-email: dummyjenil <dummyjenil@gmail.com>
6
+ Provides-Extra: all
7
+ Requires-Dist: essentia; extra == 'all'
8
+ Requires-Dist: hmmlearn; extra == 'all'
9
+ Requires-Dist: huggingface-hub; extra == 'all'
10
+ Requires-Dist: keras; extra == 'all'
11
+ Requires-Dist: librosa; extra == 'all'
12
+ Requires-Dist: mir-eval; extra == 'all'
13
+ Requires-Dist: mt3-audio2midi; extra == 'all'
14
+ Requires-Dist: nest-asyncio; extra == 'all'
15
+ Requires-Dist: nnaudio; extra == 'all'
16
+ Requires-Dist: numpy==1.26.4; extra == 'all'
17
+ Requires-Dist: pretty-midi; extra == 'all'
18
+ Requires-Dist: pretty-midi-fix; extra == 'all'
19
+ Requires-Dist: resampy; extra == 'all'
20
+ Requires-Dist: scipy; extra == 'all'
21
+ Requires-Dist: tensorflow; extra == 'all'
22
+ Requires-Dist: torch; extra == 'all'
23
+ Requires-Dist: torchaudio; extra == 'all'
24
+ Requires-Dist: transformers; extra == 'all'
25
+ Requires-Dist: vamp; extra == 'all'
26
+ Provides-Extra: basic-pitch-pitch-detector
27
+ Requires-Dist: huggingface-hub; extra == 'basic-pitch-pitch-detector'
28
+ Requires-Dist: librosa; extra == 'basic-pitch-pitch-detector'
29
+ Requires-Dist: nnaudio; extra == 'basic-pitch-pitch-detector'
30
+ Requires-Dist: numpy; extra == 'basic-pitch-pitch-detector'
31
+ Requires-Dist: pretty-midi-fix; extra == 'basic-pitch-pitch-detector'
32
+ Requires-Dist: scipy; extra == 'basic-pitch-pitch-detector'
33
+ Requires-Dist: torch; extra == 'basic-pitch-pitch-detector'
34
+ Provides-Extra: crepe-pitch-detector
35
+ Requires-Dist: hmmlearn; extra == 'crepe-pitch-detector'
36
+ Requires-Dist: huggingface-hub; extra == 'crepe-pitch-detector'
37
+ Requires-Dist: librosa; extra == 'crepe-pitch-detector'
38
+ Requires-Dist: numpy; extra == 'crepe-pitch-detector'
39
+ Requires-Dist: pretty-midi-fix; extra == 'crepe-pitch-detector'
40
+ Requires-Dist: tensorflow; extra == 'crepe-pitch-detector'
41
+ Requires-Dist: torch; extra == 'crepe-pitch-detector'
42
+ Requires-Dist: tqdm; extra == 'crepe-pitch-detector'
43
+ Provides-Extra: crepe-pitch-detector-tf
44
+ Requires-Dist: hmmlearn; extra == 'crepe-pitch-detector-tf'
45
+ Requires-Dist: huggingface-hub; extra == 'crepe-pitch-detector-tf'
46
+ Requires-Dist: keras; extra == 'crepe-pitch-detector-tf'
47
+ Requires-Dist: librosa; extra == 'crepe-pitch-detector-tf'
48
+ Requires-Dist: numpy; extra == 'crepe-pitch-detector-tf'
49
+ Requires-Dist: pretty-midi-fix; extra == 'crepe-pitch-detector-tf'
50
+ Requires-Dist: tensorflow; extra == 'crepe-pitch-detector-tf'
51
+ Provides-Extra: librosa-pitch-detector
52
+ Requires-Dist: librosa; extra == 'librosa-pitch-detector'
53
+ Requires-Dist: numpy; extra == 'librosa-pitch-detector'
54
+ Requires-Dist: pretty-midi-fix; extra == 'librosa-pitch-detector'
55
+ Provides-Extra: melodia-pitch-detector
56
+ Requires-Dist: huggingface-hub; extra == 'melodia-pitch-detector'
57
+ Requires-Dist: librosa; extra == 'melodia-pitch-detector'
58
+ Requires-Dist: numpy; extra == 'melodia-pitch-detector'
59
+ Requires-Dist: pretty-midi-fix; extra == 'melodia-pitch-detector'
60
+ Requires-Dist: scipy; extra == 'melodia-pitch-detector'
61
+ Requires-Dist: vamp; extra == 'melodia-pitch-detector'
62
+ Provides-Extra: mt3-music-transcription
63
+ Requires-Dist: mt3-audio2midi; extra == 'mt3-music-transcription'
64
+ Requires-Dist: nest-asyncio; extra == 'mt3-music-transcription'
65
+ Provides-Extra: pop2piano
66
+ Requires-Dist: essentia; extra == 'pop2piano'
67
+ Requires-Dist: huggingface-hub; extra == 'pop2piano'
68
+ Requires-Dist: librosa; extra == 'pop2piano'
69
+ Requires-Dist: numpy==1.26.4; extra == 'pop2piano'
70
+ Requires-Dist: pretty-midi; extra == 'pop2piano'
71
+ Requires-Dist: pretty-midi-fix; extra == 'pop2piano'
72
+ Requires-Dist: resampy; extra == 'pop2piano'
73
+ Requires-Dist: scipy; extra == 'pop2piano'
74
+ Requires-Dist: torch; extra == 'pop2piano'
75
+ Requires-Dist: transformers; extra == 'pop2piano'
76
+ Provides-Extra: violin-pitch-detector
77
+ Requires-Dist: huggingface-hub; extra == 'violin-pitch-detector'
78
+ Requires-Dist: librosa; extra == 'violin-pitch-detector'
79
+ Requires-Dist: mir-eval; extra == 'violin-pitch-detector'
80
+ Requires-Dist: numpy; extra == 'violin-pitch-detector'
81
+ Requires-Dist: pretty-midi-fix; extra == 'violin-pitch-detector'
82
+ Requires-Dist: scipy; extra == 'violin-pitch-detector'
83
+ Requires-Dist: torch; extra == 'violin-pitch-detector'
84
+ Requires-Dist: torchaudio; extra == 'violin-pitch-detector'
85
+ Description-Content-Type: text/markdown
86
+
87
+ [Audio2Midi Demo](https://huggingface.co/spaces/shethjenil/Audio2Midi)
88
+ ---
89
+
90
+ [Github](https://github.com/dummyjenil/audio2midi)
91
+ ---
92
+
93
+ ```bash
94
+ pip install audio2midi[all] audio2midi[pop2piano] audio2midi[violin_pitch_detector] audio2midi[crepe_pitch_detector] audio2midi[crepe_pitch_detector_tf] audio2midi[melodia_pitch_detector] audio2midi[basic_pitch_pitch_detector] audio2midi[librosa_pitch_detector]
95
+ ```
96
+ ---
97
+
98
+ violin_model_capacity crepe_model_capacity
99
+
100
+ * tiny
101
+ * small
102
+ * medium
103
+ * large
104
+ * full
105
+ ---
106
+
107
+ ``` python
108
+ from audio2midi.librosa_pitch_detector import Normal_Pitch_Det , Guitar_Pitch_Det
109
+
110
+ audio_path = "audio.mp3"
111
+ Normal_Pitch_Det().predict(audio_path)
112
+ Guitar_Pitch_Det().predict(audio_path)
113
+ ```
114
+
115
+ ---
116
+
117
+ ``` python
118
+ from os import environ
119
+ from huggingface_hub import hf_hub_download
120
+ from shutil import unpack_archive
121
+ from pathlib import Path
122
+ from audio2midi.melodia_pitch_detector import Melodia
123
+ from platform import system as platform_system , architecture as platform_architecture
124
+
125
+ import nest_asyncio
126
+ from audio2midi.mt3_music_transcription import MT3
127
+ nest_asyncio.apply()
128
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models","mt3.zip"),"mt3_model",format="zip")
129
+ MT3("mt3_model").predict(audio_path)
130
+
131
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models",f"melodia_vamp_plugin_{'win' if (system := platform_system()) == 'Windows' else 'mac' if system == 'Darwin' else 'linux64' if (arch := platform_architecture()[0]) == '64bit' else 'linux32' if arch == '32bit' else None}.zip"),"vamp_melodia",format="zip")
132
+ environ['VAMP_PATH'] = str(Path("vamp_melodia").absolute())
133
+ Melodia().predict(audio_path)
134
+ ```
135
+
136
+ ---
137
+
138
+ ```python
139
+ from audio2midi.basic_pitch_pitch_detector import BasicPitch
140
+ from audio2midi.crepe_pitch_detector import Crepe
141
+ from audio2midi.violin_pitch_detector import Violin_Pitch_Det
142
+ from audio2midi.pop2piano import Pop2Piano
143
+ from torch import device as Device
144
+ from torch.cuda import is_available as cuda_is_available
145
+ device = Device("cuda" if cuda_is_available() else "cpu")
146
+ Crepe().predict(audio_path)
147
+ Pop2Piano(device=device).predict(audio_path)
148
+ Violin_Pitch_Det(device=device).predict(audio_path)
149
+ BasicPitch(device=device).predict(audio_path)
150
+ ```
151
+
152
+ ---
153
+
154
+ ```python
155
+ from audio2midi.basic_pitch_pitch_detector import BasicPitch
156
+ from audio2midi.crepe_pitch_detector_tf import CrepeTF
157
+ from audio2midi.crepe_pitch_detector import Crepe
158
+ from audio2midi.librosa_pitch_detector import Normal_Pitch_Det , Guitar_Pitch_Det
159
+ from audio2midi.melodia_pitch_detector import Melodia
160
+ from audio2midi.pop2piano import Pop2Piano
161
+ from audio2midi.violin_pitch_detector import Violin_Pitch_Det
162
+ from audio2midi.mt3_music_transcription import MT3
163
+ from os import environ
164
+ from huggingface_hub import hf_hub_download
165
+ from shutil import unpack_archive
166
+ from pathlib import Path
167
+ from platform import system as platform_system , architecture as platform_architecture
168
+ import nest_asyncio
169
+ nest_asyncio.apply()
170
+
171
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models",f"melodia_vamp_plugin_{'win' if (system := platform_system()) == 'Windows' else 'mac' if system == 'Darwin' else 'linux64' if (arch := platform_architecture()[0]) == '64bit' else 'linux32' if arch == '32bit' else None}.zip"),"vamp_melodia",format="zip")
172
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models","mt3.zip"),"mt3_model",format="zip")
173
+
174
+ environ['VAMP_PATH'] = str(Path("vamp_melodia").absolute())
175
+
176
+ from os import getenv
177
+ from torch import device as Device
178
+ from torch.cuda import is_available as cuda_is_available
179
+ device = Device("cuda" if cuda_is_available() else "cpu")
180
+
181
+ import gradio as gr
182
+ with gr.Blocks() as midi_viz_ui:
183
+ midi = gr.File(label="Upload MIDI")
184
+ sf = gr.File(label="Upload SoundFont")
185
+ output_html = gr.HTML(f'''
186
+ <div style="display: flex; justify-content: center; align-items: center;">
187
+ <iframe style="width: 100%; height: 500px;" src="https://shethjenil-midivizsf2.static.hf.space/index_single_file.html" id="midiviz"></iframe>
188
+ </div>''')
189
+ midi.upload(None, inputs=midi, js="""
190
+ async (file) => {
191
+ if (!file || !file.url || !file.orig_name) return;
192
+ const iframe = document.getElementById("midiviz");
193
+ iframe.contentWindow.postMessage({
194
+ type: "load-midi",
195
+ url: file.url,
196
+ name: file.orig_name
197
+ }, "*");
198
+ }
199
+ """)
200
+ sf.upload(None, inputs=sf, js="""
201
+ async (file) => {
202
+ if (!file || !file.url || !file.orig_name) return;
203
+ const iframe = document.getElementById("midiviz");
204
+ iframe.contentWindow.postMessage({
205
+ type: "load-sf",
206
+ url: file.url,
207
+ name: file.orig_name
208
+ }, "*");
209
+ }
210
+ """)
211
+
212
+ gr.TabbedInterface([
213
+ gr.Interface(Normal_Pitch_Det().predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Number(120,label="BPM"),gr.Number(512,label="HOP Len"),gr.Number(2,label="minimum note length"),gr.Number(0.1,label="threshold")],gr.File(label="Midi File")),
214
+ gr.Interface(Guitar_Pitch_Det().predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Number(4,label="mag_exp"),gr.Number(-61,label="Threshold"),gr.Number(6,label="Pre_post_max"),gr.Checkbox(False,label="backtrack"),gr.Checkbox(False,label="round_to_sixteenth"),gr.Number(1024,label="hop_length"),gr.Number(72,label="n_bins"),gr.Number(12,label="bins_per_octave")],gr.File(label="Midi File")),
215
+ gr.Interface(Melodia().predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Number(120,label="BPM",step=30),gr.Number(0.25,label="smoothness",step=0.05,info="Smooth the pitch sequence with a median filter of the provided duration (in seconds)."),gr.Number(0.1,label="minimum duration",step=0.1,info="Minimum allowed duration for note (in seconds). Shorter notes will be removed."),gr.Number(128,label="HOP")],gr.File(label="Midi File")),
216
+ gr.Interface(BasicPitch(device=device).predict,[gr.Audio(type="filepath", label="Upload Audio"),gr.Number(0.5,label="onset_thresh",info="Minimum amplitude of an onset activation to be considered an onset."),gr.Number(0.3,label="frame_thresh",info="Minimum energy requirement for a frame to be considered present."),gr.Number(127.70,label="min_note_len",info="The minimum allowed note length in milliseconds."),gr.Number(120,label="midi_tempo"),gr.Checkbox(True,label="infer_onsets",info="add additional onsets when there are large differences in frame amplitudes."),gr.Checkbox(True,label="include_pitch_bends",info="include pitch bends."),gr.Checkbox(False,label="multiple_pitch_bends",info="allow overlapping notes in midi file to have pitch bends."),gr.Checkbox(True,label="melodia_trick",info="Use the melodia post-processing step.")],gr.File(label="Download Midi File")),
217
+ gr.Interface(Violin_Pitch_Det(device=device,model_capacity=getenv("violin_model_capacity","full")).predict, [gr.Audio(label="Upload your Audio file",type="filepath"),gr.Number(32,label="Batch size"),gr.Radio(["spotify","tiktok"],value="spotify",label="Post Processing"),gr.Checkbox(True,label="include_pitch_bends")],gr.File(label="Download MIDI file")),
218
+ gr.Interface(Crepe(getenv("crepe_model_capacity","full")).predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Checkbox(False,label="viterbi",info="Apply viterbi smoothing to the estimated pitch curve"),gr.Checkbox(True,label="center"),gr.Number(10,label="step size",info="The step size in milliseconds for running pitch estimation."),gr.Number(0.8,label="minimum confidence"),gr.Number(32,label="batch size")],gr.File(label="Midi File")),
219
+ gr.Interface(CrepeTF(getenv("crepe_model_capacity","full")).predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Checkbox(False,label="viterbi",info="Apply viterbi smoothing to the estimated pitch curve"),gr.Checkbox(True,label="center"),gr.Number(10,label="step size",info="The step size in milliseconds for running pitch estimation."),gr.Number(0.8,label="minimum confidence"),gr.Number(32,label="batch size")],gr.File(label="Midi File")),
220
+ gr.Interface(Pop2Piano(device).predict,[gr.Audio(label="Input Audio",type="filepath"),gr.Number(1, minimum=1, maximum=21, label="Composer"),gr.Number(2,label="Details in Piano"),gr.Number(1,label="Efficiency of Piano"),gr.Radio([1,2,4],label="steps per beat",value=2)],gr.File(label="MIDI File")),
221
+ gr.Interface(MT3(str(Path("mt3_model").absolute())).predict,[gr.Audio(label="Input Audio",type="filepath"),gr.Number(0,label="seed")],gr.File(label="MIDI File")),
222
+ midi_viz_ui
223
+ ],["Normal Pitch Detection","Guitar Based Pitch Detection","Melodia","Spotify Pitch Detection","Violin Based Pitch Detection","Crepe Pitch Detection","Crepe Pitch Detection TF","Pop2Piano","MT3","Midi Vizulizer"]).launch()
224
+ ```
@@ -0,0 +1,138 @@
1
+ [Audio2Midi Demo](https://huggingface.co/spaces/shethjenil/Audio2Midi)
2
+ ---
3
+
4
+ [Github](https://github.com/dummyjenil/audio2midi)
5
+ ---
6
+
7
+ ```bash
8
+ pip install audio2midi[all] audio2midi[pop2piano] audio2midi[violin_pitch_detector] audio2midi[crepe_pitch_detector] audio2midi[crepe_pitch_detector_tf] audio2midi[melodia_pitch_detector] audio2midi[basic_pitch_pitch_detector] audio2midi[librosa_pitch_detector]
9
+ ```
10
+ ---
11
+
12
+ violin_model_capacity crepe_model_capacity
13
+
14
+ * tiny
15
+ * small
16
+ * medium
17
+ * large
18
+ * full
19
+ ---
20
+
21
+ ``` python
22
+ from audio2midi.librosa_pitch_detector import Normal_Pitch_Det , Guitar_Pitch_Det
23
+
24
+ audio_path = "audio.mp3"
25
+ Normal_Pitch_Det().predict(audio_path)
26
+ Guitar_Pitch_Det().predict(audio_path)
27
+ ```
28
+
29
+ ---
30
+
31
+ ``` python
32
+ from os import environ
33
+ from huggingface_hub import hf_hub_download
34
+ from shutil import unpack_archive
35
+ from pathlib import Path
36
+ from audio2midi.melodia_pitch_detector import Melodia
37
+ from platform import system as platform_system , architecture as platform_architecture
38
+
39
+ import nest_asyncio
40
+ from audio2midi.mt3_music_transcription import MT3
41
+ nest_asyncio.apply()
42
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models","mt3.zip"),"mt3_model",format="zip")
43
+ MT3("mt3_model").predict(audio_path)
44
+
45
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models",f"melodia_vamp_plugin_{'win' if (system := platform_system()) == 'Windows' else 'mac' if system == 'Darwin' else 'linux64' if (arch := platform_architecture()[0]) == '64bit' else 'linux32' if arch == '32bit' else None}.zip"),"vamp_melodia",format="zip")
46
+ environ['VAMP_PATH'] = str(Path("vamp_melodia").absolute())
47
+ Melodia().predict(audio_path)
48
+ ```
49
+
50
+ ---
51
+
52
+ ```python
53
+ from audio2midi.basic_pitch_pitch_detector import BasicPitch
54
+ from audio2midi.crepe_pitch_detector import Crepe
55
+ from audio2midi.violin_pitch_detector import Violin_Pitch_Det
56
+ from audio2midi.pop2piano import Pop2Piano
57
+ from torch import device as Device
58
+ from torch.cuda import is_available as cuda_is_available
59
+ device = Device("cuda" if cuda_is_available() else "cpu")
60
+ Crepe().predict(audio_path)
61
+ Pop2Piano(device=device).predict(audio_path)
62
+ Violin_Pitch_Det(device=device).predict(audio_path)
63
+ BasicPitch(device=device).predict(audio_path)
64
+ ```
65
+
66
+ ---
67
+
68
+ ```python
69
+ from audio2midi.basic_pitch_pitch_detector import BasicPitch
70
+ from audio2midi.crepe_pitch_detector_tf import CrepeTF
71
+ from audio2midi.crepe_pitch_detector import Crepe
72
+ from audio2midi.librosa_pitch_detector import Normal_Pitch_Det , Guitar_Pitch_Det
73
+ from audio2midi.melodia_pitch_detector import Melodia
74
+ from audio2midi.pop2piano import Pop2Piano
75
+ from audio2midi.violin_pitch_detector import Violin_Pitch_Det
76
+ from audio2midi.mt3_music_transcription import MT3
77
+ from os import environ
78
+ from huggingface_hub import hf_hub_download
79
+ from shutil import unpack_archive
80
+ from pathlib import Path
81
+ from platform import system as platform_system , architecture as platform_architecture
82
+ import nest_asyncio
83
+ nest_asyncio.apply()
84
+
85
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models",f"melodia_vamp_plugin_{'win' if (system := platform_system()) == 'Windows' else 'mac' if system == 'Darwin' else 'linux64' if (arch := platform_architecture()[0]) == '64bit' else 'linux32' if arch == '32bit' else None}.zip"),"vamp_melodia",format="zip")
86
+ unpack_archive(hf_hub_download("shethjenil/Audio2Midi_Models","mt3.zip"),"mt3_model",format="zip")
87
+
88
+ environ['VAMP_PATH'] = str(Path("vamp_melodia").absolute())
89
+
90
+ from os import getenv
91
+ from torch import device as Device
92
+ from torch.cuda import is_available as cuda_is_available
93
+ device = Device("cuda" if cuda_is_available() else "cpu")
94
+
95
+ import gradio as gr
96
+ with gr.Blocks() as midi_viz_ui:
97
+ midi = gr.File(label="Upload MIDI")
98
+ sf = gr.File(label="Upload SoundFont")
99
+ output_html = gr.HTML(f'''
100
+ <div style="display: flex; justify-content: center; align-items: center;">
101
+ <iframe style="width: 100%; height: 500px;" src="https://shethjenil-midivizsf2.static.hf.space/index_single_file.html" id="midiviz"></iframe>
102
+ </div>''')
103
+ midi.upload(None, inputs=midi, js="""
104
+ async (file) => {
105
+ if (!file || !file.url || !file.orig_name) return;
106
+ const iframe = document.getElementById("midiviz");
107
+ iframe.contentWindow.postMessage({
108
+ type: "load-midi",
109
+ url: file.url,
110
+ name: file.orig_name
111
+ }, "*");
112
+ }
113
+ """)
114
+ sf.upload(None, inputs=sf, js="""
115
+ async (file) => {
116
+ if (!file || !file.url || !file.orig_name) return;
117
+ const iframe = document.getElementById("midiviz");
118
+ iframe.contentWindow.postMessage({
119
+ type: "load-sf",
120
+ url: file.url,
121
+ name: file.orig_name
122
+ }, "*");
123
+ }
124
+ """)
125
+
126
+ gr.TabbedInterface([
127
+ gr.Interface(Normal_Pitch_Det().predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Number(120,label="BPM"),gr.Number(512,label="HOP Len"),gr.Number(2,label="minimum note length"),gr.Number(0.1,label="threshold")],gr.File(label="Midi File")),
128
+ gr.Interface(Guitar_Pitch_Det().predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Number(4,label="mag_exp"),gr.Number(-61,label="Threshold"),gr.Number(6,label="Pre_post_max"),gr.Checkbox(False,label="backtrack"),gr.Checkbox(False,label="round_to_sixteenth"),gr.Number(1024,label="hop_length"),gr.Number(72,label="n_bins"),gr.Number(12,label="bins_per_octave")],gr.File(label="Midi File")),
129
+ gr.Interface(Melodia().predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Number(120,label="BPM",step=30),gr.Number(0.25,label="smoothness",step=0.05,info="Smooth the pitch sequence with a median filter of the provided duration (in seconds)."),gr.Number(0.1,label="minimum duration",step=0.1,info="Minimum allowed duration for note (in seconds). Shorter notes will be removed."),gr.Number(128,label="HOP")],gr.File(label="Midi File")),
130
+ gr.Interface(BasicPitch(device=device).predict,[gr.Audio(type="filepath", label="Upload Audio"),gr.Number(0.5,label="onset_thresh",info="Minimum amplitude of an onset activation to be considered an onset."),gr.Number(0.3,label="frame_thresh",info="Minimum energy requirement for a frame to be considered present."),gr.Number(127.70,label="min_note_len",info="The minimum allowed note length in milliseconds."),gr.Number(120,label="midi_tempo"),gr.Checkbox(True,label="infer_onsets",info="add additional onsets when there are large differences in frame amplitudes."),gr.Checkbox(True,label="include_pitch_bends",info="include pitch bends."),gr.Checkbox(False,label="multiple_pitch_bends",info="allow overlapping notes in midi file to have pitch bends."),gr.Checkbox(True,label="melodia_trick",info="Use the melodia post-processing step.")],gr.File(label="Download Midi File")),
131
+ gr.Interface(Violin_Pitch_Det(device=device,model_capacity=getenv("violin_model_capacity","full")).predict, [gr.Audio(label="Upload your Audio file",type="filepath"),gr.Number(32,label="Batch size"),gr.Radio(["spotify","tiktok"],value="spotify",label="Post Processing"),gr.Checkbox(True,label="include_pitch_bends")],gr.File(label="Download MIDI file")),
132
+ gr.Interface(Crepe(getenv("crepe_model_capacity","full")).predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Checkbox(False,label="viterbi",info="Apply viterbi smoothing to the estimated pitch curve"),gr.Checkbox(True,label="center"),gr.Number(10,label="step size",info="The step size in milliseconds for running pitch estimation."),gr.Number(0.8,label="minimum confidence"),gr.Number(32,label="batch size")],gr.File(label="Midi File")),
133
+ gr.Interface(CrepeTF(getenv("crepe_model_capacity","full")).predict,[gr.Audio(type="filepath",label="Input Audio"),gr.Checkbox(False,label="viterbi",info="Apply viterbi smoothing to the estimated pitch curve"),gr.Checkbox(True,label="center"),gr.Number(10,label="step size",info="The step size in milliseconds for running pitch estimation."),gr.Number(0.8,label="minimum confidence"),gr.Number(32,label="batch size")],gr.File(label="Midi File")),
134
+ gr.Interface(Pop2Piano(device).predict,[gr.Audio(label="Input Audio",type="filepath"),gr.Number(1, minimum=1, maximum=21, label="Composer"),gr.Number(2,label="Details in Piano"),gr.Number(1,label="Efficiency of Piano"),gr.Radio([1,2,4],label="steps per beat",value=2)],gr.File(label="MIDI File")),
135
+ gr.Interface(MT3(str(Path("mt3_model").absolute())).predict,[gr.Audio(label="Input Audio",type="filepath"),gr.Number(0,label="seed")],gr.File(label="MIDI File")),
136
+ midi_viz_ui
137
+ ],["Normal Pitch Detection","Guitar Based Pitch Detection","Melodia","Spotify Pitch Detection","Violin Based Pitch Detection","Crepe Pitch Detection","Crepe Pitch Detection TF","Pop2Piano","MT3","Midi Vizulizer"]).launch()
138
+ ```
@@ -1,23 +1,25 @@
1
- [project]
2
- name = "audio2midi"
3
- version = "0.3.0"
4
- description = "Audio To Midi"
5
- readme = "README.md"
6
- authors = [
7
- { name = "dummyjenil", email = "dummyjenil@gmail.com" }
8
- ]
9
-
10
- dependencies = []
11
-
12
- [project.optional-dependencies]
13
- librosa_pitch_detector = ["librosa", "numpy","pretty_midi_fix"]
14
- basic_pitch_pitch_detector = ["librosa", "numpy","pretty_midi_fix","scipy","torch","nnAudio","huggingface_hub"]
15
- melodia_pitch_detector = ["librosa", "numpy","pretty_midi_fix","scipy","vamp","huggingface_hub"]
16
- crepe_pitch_detector = ["librosa", "numpy","pretty_midi_fix","hmmlearn","tensorflow","keras","huggingface_hub"]
17
- violin_pitch_detector = ["librosa", "numpy","pretty_midi_fix","scipy","torchaudio","torch","mir_eval","huggingface_hub"]
18
- pop2piano = ["librosa", "numpy==1.26.4","pretty_midi_fix","transformers","essentia","torch","scipy","resampy","pretty_midi","huggingface_hub"]
19
- all = ["librosa", "numpy==1.26.4","pretty_midi_fix","transformers","essentia","torch","scipy","torchaudio","torch","mir_eval","hmmlearn","tensorflow","keras","vamp","nnAudio","resampy","pretty_midi","huggingface_hub"]
20
-
21
- [build-system]
22
- requires = ["hatchling"]
23
- build-backend = "hatchling.build"
1
+ [project]
2
+ name = "audio2midi"
3
+ version = "0.5.0"
4
+ description = "Audio To Midi"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "dummyjenil", email = "dummyjenil@gmail.com" }
8
+ ]
9
+
10
+ dependencies = []
11
+
12
+ [project.optional-dependencies]
13
+ librosa_pitch_detector = ["librosa", "numpy","pretty_midi_fix"]
14
+ basic_pitch_pitch_detector = ["librosa", "numpy","pretty_midi_fix","scipy","torch","nnAudio","huggingface_hub"]
15
+ melodia_pitch_detector = ["librosa", "numpy","pretty_midi_fix","scipy","vamp","huggingface_hub"]
16
+ crepe_pitch_detector_tf = ["librosa", "numpy","pretty_midi_fix","hmmlearn","tensorflow","keras","huggingface_hub"]
17
+ crepe_pitch_detector = ["librosa", "numpy","pretty_midi_fix","hmmlearn","tensorflow","torch","huggingface_hub","tqdm"]
18
+ violin_pitch_detector = ["librosa", "numpy","pretty_midi_fix","scipy","torchaudio","torch","mir_eval","huggingface_hub"]
19
+ pop2piano = ["librosa", "numpy==1.26.4","pretty_midi_fix","transformers","essentia","torch","scipy","resampy","pretty_midi","huggingface_hub"]
20
+ mt3_music_transcription = ["nest_asyncio", "mt3-audio2midi"]
21
+ all = ["librosa", "numpy==1.26.4","pretty_midi_fix","transformers","essentia","torch","scipy","torchaudio","torch","mir_eval","hmmlearn","tensorflow","keras","vamp","nnAudio","resampy","pretty_midi","huggingface_hub","nest_asyncio", "mt3-audio2midi"]
22
+
23
+ [build-system]
24
+ requires = ["hatchling"]
25
+ build-backend = "hatchling.build"