Comments (14)
I'm not sure what do you mean by that.
If you are saying that there is delay between key press and what you see on PC then there is no easy (and cheap) way to do it, there will be always some delay when using bluetooth connection.
from piano-led-visualizer.
When you record midi and audio, then try to sync it together, it doesnt line up, the midi is faster is what i meant
from piano-led-visualizer.
Oh right, I'm aware of that. Unfortunately this is not a problem of my script but because of external library.
I created an issue but no response yet mido/mido#205
If they will add an option to set absolute timing for midi messages I will update the script.
from piano-led-visualizer.
Would a midi splitter work for this? I have a program on my pc that records midis well
from piano-led-visualizer.
Ive found a temporary solution: it seems like after every 10 seconds in a track, the midi gets desynced by .4-.5 seconds. Idk if thereโs anything you can do to fix that in your code or if its due to mido, but you can edit the midi using MidiEditor and adjust the midi every 10 secs to go forward by .4-.5 secs.
from piano-led-visualizer.
Nice catch. On the issue I linked I pasted the code for recording, I don't see anything that might cause the delay.
If the delay is consistent then it would be possible to write a script to fix that just after saving midi to file.
from piano-led-visualizer.
Yeah it seems like .25 second delay per 5 seconds and .50 second delay per 10, i tested it on a 2 minute long track. for perfect alignment, i think the script would have to adjust every 5 seconds for the .25 second delay. Any idea on how to do this in the code? I am not proficient in Python at all lol. If a note is played at the 5 second interval, you would move that note and the notes before the next 5 second interval forward in time by .25 seconds. If a note is hit before the 5 second interval and lasts a little bit after, you would move it up by .25 seconds + the length of the note before it hit the 5 second interval. If there is just silence at the 5 second interval, you would extend the silence by .25 seconds.
from piano-led-visualizer.
Hi, I ended up buying a midi solutions quadra thru device that works really well for recording the midi (a lil bit expensive though lol). I was working on a script to fix the delay but couldnt get it to work, i think the code is too advanced for me. The one thing i was stuck on is what is the variable that holds the time of the midi? I had all the math worked out, I just couldnt figure out how to edit the midi files time, and at a certain time.
from piano-led-visualizer.
This is the line in which the note is saved
saving.add_track("note_on", original_note, velocity, elapsed_time*1000)
https://github.com/onlaj/Piano-LED-Visualizer/blob/master/visualizer.py#L1255
and this is how the method works:
def add_track(self, status, note, velocity, time):
self.track.append(Message(status, note=int(note), velocity=int(velocity), time=int(time)))
https://github.com/onlaj/Piano-LED-Visualizer/blob/master/visualizer.py#L767
I wasn't sure how to understand mido documentation but multiplying time difference between notes in seconds by 1000 seemed to work. Changing it to different values will change the time delay between the notes, but it won't fix the drift between some of them (every 5 seconds as you mentioned).
from piano-led-visualizer.
hi onlaj
i have same problem, what should I do?
from piano-led-visualizer.
@onlaj hi, I have this problem as well. I looked at the mido documentation and there's this line
"The time attribute is used in several different ways:
inside a track, it is delta time in ticks. This must be an integer."
And in your code it is milliseconds, is this the same as ticks? Have you tried converting the seconds to ticks using this function?
mido.second2tick(second, ticks_per_beat, tempo)
Convert absolute time in seconds to ticks.
Returns absolute time in ticks for a chosen MIDI file time resolution (ticks per beat, also called PPQN or pulses per quarter note) and tempo (microseconds per beat).
from piano-led-visualizer.
Anyone struggling with this, I have a relatively cheap solution, I bought a midi USB-USB connector that allows midi connection between two computers, it's this https://compasflamenco.com/midi-usbusb-p-4.html?language=en. I record the midi with pianoteq (any other program that records midi works) and use cantabile and loopbe to pass the midi input to the midi out and pianoteq.
from piano-led-visualizer.
So you can confirm it works, right?
I will add this to readme file and mention you.
The only thing I'm worried about is that this shop is always low on supply, they might run out of products quickly if I recommend it in tutorial.
from piano-led-visualizer.
Yes mine just arrived today, I tested it and works perfectly. The device has 4 inputs and 4 outputs, just make sure to select the same port (from visualizer settings) that outputs midi from your computer.
Also the connector comes with two usb cables.
from piano-led-visualizer.
Related Issues (20)
- Midi interface not recognized
- Recording Midi file HOT 4
- Web Interface access HOT 1
- 3D Case model for the pi zero HOT 8
- Problems editing sequences HOT 1
- No module named "websockets" HOT 2
- Display remains white HOT 4
- Not an Issue but could expand possibilities of PLV
- What does Clean LED Strip do? HOT 1
- from werkzeug.utils import safe_join HOT 1
- Support for 160 leds/m strip HOT 8
- How does the "LED offset settings" work ?? HOT 1
- Gradient mode in sequences crashes LED Visualizer HOT 7
- LCD Display remains white HOT 5
- CPU Usage hovering 100% and input lag between key press and LED strip HOT 6
- There are no hotspot HOT 1
- 144 leds/m strips HOT 4
- Request for sightreading practice HOT 4
- 1.3 SPI LCD small and portrait HOT 2
- Help with IPADTablet Setup 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 piano-led-visualizer.