We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I have an audio clip with a pretty clear synth based melody but the melodia is unable to track it.
Here is my code
from mir_eval.sonify import pitch_contour import numpy import essentia.standard as es import matplotlib.pyplot as plt sample_rate = 44100 loader = es.MonoLoader(filename="better_off_alone_segment.mp3") audio = loader() print(f"Duration of the audio sample [sec]: {len(audio) / sample_rate:.3f}") # PitchMelodia takes the entire audio signal as input - no frame-wise processing is required here... pExt = es.PitchMelodia(frameSize=2048, hopSize=128) pitch, pitchConf = pExt(audio) time = numpy.linspace(0.0, len(audio) / sample_rate, len(pitch)) ## plot the pitch contour and confidence over time f, axarr = plt.subplots(2, sharex=True) axarr[0].plot(time,pitch) axarr[0].set_title('estimated pitch[Hz]') axarr[1].plot(time,pitchConf) axarr[1].set_title('pitch confidence') plt.show() from tempfile import TemporaryDirectory temp_dir = TemporaryDirectory() synthesized_melody = pitch_contour(time, pitch, 44100).astype(numpy.float32)[:len(audio)] es.AudioWriter(filename = temp_dir.name + 'melody.wav', format='wav')(es.StereoMuxer()(audio, synthesized_melody)) print(temp_dir.name + 'melody.wav')
better_off_alone_segment.mp3.zip
Any ideas what I can do to improve performance?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I have an audio clip with a pretty clear synth based melody but the melodia is unable to track it.
Here is my code
better_off_alone_segment.mp3.zip
Any ideas what I can do to improve performance?
The text was updated successfully, but these errors were encountered: