Closed rualark closed 3 years ago
TimingCallbacks is the basis for all that timing - when you start that, it sends callbacks for a lot of useful events - new notes, beats, subdivisions of beats, approaching the end of the line, and the end of the piece. It doesn't have any UI associated with it, so you can just hook into those callbacks and run whatever UI you want. SynthController calls TimingCallbacks so it is basically the same effect. I am trying to onion this so that you can have as much or as little functionality as is convenient.
seek takes percentage of the entire tune.
If you are watching the beats callback, you'll get one last callback at the end of the piece.
You can write your own class that takes the same entry points as CursorControl and pass that in. That was the intention. What I'd do is copy the CursorControl class to your own code and modify it as you want.
Oh - about renderMidi - there were lots of performance problems with that. It would work passably on my fast computer, but just not keep up on a lot of phones. About the sound quality, I think I know what is going on and I plan to make another pass on this code to improve it. I think the sound quality only suffers when you are playing more than one note at a time - have you noticed anything else with it? It's also a little quieter, which I'll also improve.
Currently renderMidi sounds much better than synth, the difference is huge. Here is my analysis of this problem.
Same music played in Chrome by renderMidi (from basic-midi.html example) and synth (from basic-synth.html example): listen
Synth seems to have gaps in audio, phasing and no stable reverb - compared to renderMidi. Let's look at it closer.
Loudness is generally the same, although renderMidi is a little louder (renderMidi on the left):
When you zoom in, you can see that there are abrupt gaps between notes played by synth, which probably kills music quality:
renderMidi does not have this problem:
If you zoom spectrum in more, you can see that even inside the note synth spectrum has severe artifacts, which probably cause this phasing sound:
renderMidi does not have this problem:
In mobile Chrome, both renderMidi and synth have audio artifacts.
I hope this information helps.
That does! I have an idea of what needs to change, but I need to figure out how to do it. This is a high priority issue for me.
Could you look at this issue please? I got it today from user. It seems that user input some notes (clicked note_ci) and then clicked play. All call stack with code is shown. https://sentry.io/share/issue/a2f5715aa8424e23969fd7b3e27d992e
Can you figure out what their abc string was? Or at least the instrument they were using? There is a "missing note". If I can reproduce it I can guard against it.
I am not sure if breadcrumbs are shown at the page that I shared above. Here are they with my annotations marked with bold font. I tried repeating these actions, but could not reproduce the error. I think we can suspend the issue if you also have no ideas.
Also, in the future I will try to send notation with errors.
Analysis of current abcjs synth: Played with abcjs synth:
Played with NI Gentleman:
Sound here: https://audiomack.com/rualark/playlist/abcjs-sound-comparison
Problems:
I am facing the same issue - basically:
renderMidi
sounds way cleaner than synth;[Chrome v83.0.4103.97 on OS X - abcjs v6-beta10]
What is the current status of this? Is there anything I can do in order to help you?
[thank you so much for working on this wonderful library btw!]
I think there are two problems, but when those are solved we'll see if there is more.
First, I'd like to improve the soundfont, at least for piano - that seems to be the one that can naturally sound good with midi. I'm investigating that now. If you can find a sound font where the individual notes can be split into a separate files I will incorporate that.
Second, I have an idea of something I can do when creating the sound buffers to improve it. I will do an experiment this weekend to see if that helps.
What is the problem with buffers?
I am doing a very simple addition to get two notes into a buffer if they are in the same voice. I am going to experiment with not doing any of my own calculations and create as many channels as needed to keep all the notes separate.
Playback is very much improved as of today
Could you please help me choose a straightforward and robust interface for playback with the following requirements? I see that SynthController does that, but I will use my own visualization - should I still use SynthController or there is a more straightforward way?
.init()
, then.prime()
:ok:.start()
:ok:.pause()
,.resume()
:ok:millisecondsPerMeasure
:ok:.playEvent
:ok:.seek()
? Could you please specify this in docs?audioParams.onEnded
?full-synth
example - I see that it can be done withCursorControl
. Is there a simple way to just receiveonEvent
withoutSynthController
orCursorControl
so that I can draw cursor?:warning: renderMidi gives significantly better sound than CreateSynth: sound of basic-midi.html is significantly better than sound of basic-synth.html and full-synth.html (I can create an audio recording to compare if needed). Why is that? Are there problems with renderMidi that forced moving to synth? Can renderMidi be used or is it deprecated? What is the difference between abcjs and abcjs-midi? Can aforementioned requirements be met using renderMidi?