Comments (11)
Just a quick update - we've updated the version on pypi, and starting from version 0.1.0 this problem should be solved.
from basic-pitch.
Tried all of the following, unsuccessfully:
- Merging with Tools->Implode in Musescore (Does
nothingbarely anything): https://musescore.org/en/node/332630 - This Python script: https://github.com/m13253/midi-track-merge (Converted to 16 tracks, still not what I wanted, repeated uses leads to errors)
- Miditocsv, edit first column, csvtomidi: https://www.fourmilab.ch/webtools/midicsv (Didn't change anything, strangely)
- My own script to turn Basic Pitch's csv into a MIDI. Sounds decent, but timing is obviously off and I'm not sure how to calculate the proper time in beats from the given time in seconds. https://streamable.com/vkmahx
- This library and this code (does nothing)
- Pretty midi doesn't even seem to mention track anywhere
from basic-pitch.
I ended up getting to merge by modifying mido, the package behind pretty midi - still didn't look pretty, but it was on one track at least.
import os
import mido
mid = mido.MidiFile(os.path.join("outputs", "bakamitai_basic_pitch.mid"))
merged_track = mido.merge_tracks(mid.tracks)
new_midi= mido.MidiFile()
new_midi.tracks=[merged_track]
new_midi.save("merged.mid")
mido/midifiles/tracks.py:
def _to_abstime(messages):
"""Convert messages to absolute time."""
now = 0
for msg in messages:
now += msg.time
try:
msg.channel = 1
except:
pass
yield msg.copy(time=now)
The remaining problem is that MIDI -> sheet music has not come far enough yet. Not really anything can be done about that, unless I do grad school for machine learning. For this issue though, I'm still curious about if/how basic pitch could yield 1track.
from basic-pitch.
Hi @kevinlinxc ,
The short answer - on master the generated MIDI will be one single track, but we haven't pushed a new version to PyPi yet. We should have a new release in the next couple of days, but in the meantime, running the code from master should solve your problem.
The longer answer - basic pitch supports pitch bends per note, however MIDI 1.0 does not. We originally purposely generated midi with one "track" per unique frequency transcribed, so that each track could get note-level MIDI. However, as you've seen it's not very convenient for use in a DAW, so we've updated the default behavior to put all the MIDI in a single track, with an aggregated per-track pitch bend over time, rather than a per-note pitch bend. There's instead now an option to still export the note-level pitch bend data.
Hope this clears things up!
from basic-pitch.
Hi, I just tried using main (no master branch). I downloaded the zip, unzipped it, and then called my venv/Scripts/python setup.py install to install it. The output is still the same. The version number also still seems to be 0.0.1. Am I doing anything wrong?
from basic-pitch.
Thanks for this information, update and everyone's work on basic pitch. I had come to ask about the same topic and found this thread. Your web based version at spotify produced a very accurate sounding single track, while the command line version split the same audio sample out to about 30 tracks. I manually combined all those in to one within my daw, but the result didn't sound as accurate as the web based tool . I considered trying the repository, but in reading kevinglinxc's last message, I think I'll just look forward to the next version on PyPi if it will be coming soon.
from basic-pitch.
I tried installing directly from GitHub and I'm facing the same issue. Dragging and dropping the MIDI file into Ableton Live creates a lot of MIDI tracks. MIDI output of the webapp only creates one track.
When calling predict_and_save
, I pass multiple_pitch_bends = False, melodia_trick = True
. I assume that multiple_pitch_bends = False
should avoid creating multiple tracks: cf15da3#diff-ce098c38843d8c4c8ad03c2ce0105ed308a6a88dc4c505dff0de6ef4a40e9e24R221
from basic-pitch.
This eve I took a look at the repository diffs and pulled down the latest versions of inference, note_creation, and predict. I directly replaced those files in my module folder and now I'm now generating the same single track midi files that the webtool was providing. yay
from basic-pitch.
@Misfire2 I followed your method, but I'm still getting multiple tracks in the output MIDI. I diffed the files and they're the same as the ones in the repo. Can you please share your command/function call?
I noticed something just now. If I run basic-pitch via the terminal with command basic-pitch output_folder input.wav
, I get a MIDI file with a single track. However, if I import and call the predict_and_save
function in a python script, I get a MIDI file back with multiple tracks. I compared the arguments and they are the same and mostly just the defaults. Any clue?
from basic-pitch.
I'm working from a windows box and have only been using the command line option ...
/>basic-pitch output-folder input-file . From the start, even command line was giving me multiple tracks.
Once I replaced the 3 files, command line produced just the single track.
My setup might be slightly different than your because I originally installed the package from https://pypi.org/project/basic-pitch/ I didn't use the entire repository version, I only replace those 3 files while leaving the rest of the pypi package in place. I'm just a C++ guy and haven't delved deeper in to the code since I was getting the basic function I needed from command line.
from basic-pitch.
Thanks. This is what worked for me. I deleted the conda environment, cleaned the cache, installed the package directly from Github with pip. Then, I called predict_and_save
with multiple_pitch_bends = False
and received a MIDI file with a single track 👍
from basic-pitch.
Related Issues (20)
- Программа завершает работу
- Can't detect vocals? HOT 4
- Crash when evaluating a particular recording HOT 14
- Question: would basic-pitch be capable of being adapted to work on realtime audio input from a mobile device mic? HOT 2
- Transition from setup.py to pyproject.toml HOT 3
- Can I use a converted tensorflow-lite model with basic-pitch? Do I need to adapt the basic_pitch_predict-function in some way? HOT 7
- Piano roll, web demo, tweak nice to have HOT 5
- 'add_slot' failing in Windows 11 installation HOT 7
- LLVM error HOT 1
- Looking forward to suggestions to improve output MIDI quality
- [Bug] AttributeError: module 'scipy.signal' has no attribute 'gaussian' HOT 2
- TypeError: predict() missing 1 required positional argument: 'model_or_model_path' HOT 3
- Review HOT 1
- Why are the running results of my python script and the online demo different? HOT 5
- training with custom data
- Support for stream in/out? HOT 1
- Inconsistent minimum note length HOT 3
- cant produce wav and csv on cli
- nice to have multi instruments supported
- Question regarding evaluation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from basic-pitch.