MIDI delay when placing tokens. Timing issue.
Love, love, love this program.
But, it's not stable. It seems the whole program hangs for a ms or two when dropping tokens while the sequence is running. This is bad. I imagine you have everything running in separate threads, so I'm not sure why dropping a token in live play causes a brief delay in the midi timing.
But, it's not stable. It seems the whole program hangs for a ms or two when dropping tokens while the sequence is running. This is bad. I imagine you have everything running in separate threads, so I'm not sure why dropping a token in live play causes a brief delay in the midi timing.
2
people have this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
The company has a solution in progress.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Hi Octatone.
Thanks for the nice comment, I'm glad you're enjoying using Elysium.
Unfortunately timing is a weak area. As you have identified each layer runs on a separate thread. Accurate timing of threads is not easy to achieve (and I don't claim to have achieved it). There is also the UI running on the main thread.
An issue which needs to be solved at some point is that the MIDI timing is only loosely related to the beat. What I mean by this is that each layer thread basically sleeps to some point before the next beat, wakes up does it's thing and MIDI gets sent out along the way.
This is pretty fuzzy but, on a fast computer (and I didn't ask you what you were using), it works well enough for most purposes. But, as you start hitting your CPU limits, the threads don't have enough time to run and things get out of sync.
There are, broadly, two things that need to happen:
* Clean up/optimize the timing code
* Schedule MIDI to go out on the beat, across all layers
Both are on the list of things to do but I'm one person working in my spare time and it's a *big* list.
With respect to your specific problem of dropping tokens during play. Well in general it's an interaction between the high priority main thread that runs the UI and the background threads running the layers. If the layer thread wakes up a bit late it's MIDI goes out a bit late.
When I come to cleaning up the timing code I might look at using high priority threads for the layers. But I am afraid this would so starve the UI that we'd be mired in other problems.
All of which is a roundabout way of saying I have no answer for you. I agree it sucks that it doesn't work better. I hope in due course to fix it. But right now I don't know of any quick fix to make it better.
Matt.
I’m sad
-
Inappropriate?Thanks for the great reply!
I think you should consider reversing thread priorities -- in that timing should be the highest priority and should be the foundation for everything. The UI is fantastic and the hexagonal layers are great to just watch, but ultimately you are building a sequencer.
Most DAWs and commercial sequencers drop UI elements and animations over compromising timing.
I’m thankful
-
Inappropriate?totally agree with Octatone,
can also confirm for myself that its when CPU cycle saturate that the offsync occurs.
Its a close to be forgotten paradigm that audio/midi needs to have thread priority over UI, now that machines almost touch the sky with their gazillionHertz speed. Any Audio/Midi developper can tell you, ten years ago everybody knew that fact, because you had no choice, but now if you develop on a fast enough machine you usually don't notice it during development because you do not usually test the software has hard as a musician will do, because usually musicians will always push their CPU till the last drop of processing power because computer are still not fast enough for their needs. Software synth and Effect ARE processor hungry, you can certainly top ANY machine's processing power by loading a few instances of a convolution reverb, and this is what musician WILL do.
So, understand me, I really do not mean to bash anything Elysium do here, Elysium is a very refresing musical paradigm and really ROCKS!
I only mean to put a bit of historic perspective on the problem.
So,
In my opinion, the safest way to get timing right, would be like octane said, to put UI behind midi in terms of priority, but also, the problem here is that notes play late, then everything behind gets delayed and detailed rythmic figures go out the window... so if you had a SAFETY kinda jump FUSE mechanism, where events are played ONLY IF they can play in time, OR skip and play on next iteration, the end result would then have missing notes, but at least all played notes would have the right timing. Many say that music is not what you play, but when you play it, so based on this, there is no use to play 100 out of tempo notes, while playing half of them on time would yield better musical results.
Please take my comments lightly ;)
But please also take into account I have been doing professionnal sound design, as my day to day job for the past 12 years, so I have seen many hardware and software and most of the evolution of computer music happen, and as a result, I have a very opiniated professionnal perspective on the subject.
Thanks For Your time,
I really appreciate the work you are doing,
and understand the kind of work all those issue involves as I also happen to do some programming in my spare time.
regards,
L-P -
Inappropriate?Okay guys I am persuaded that this should be a higher priority. At least to experiment with some of the more obvious possibilities.
There is already a "performance mode" setting in the player menu. Right now this just turns off the note-on-click functionality that can be annoying when you're working. I'll look at using it to also boost the layer thread priorities.
This would mean that, while you're experimenting, you could keep the UI prioritized but when you want to start recording you could turn performance mode on and the layers would get priority.
I don't know if this will work but we can try it out.
See this ticket for more details.
And thanks for all the feedback. It's very handy to get perspective from people who've been involved in music production for some time. I have about 5 months... still a neophyte :-)
Matt
I’m confident
-
Inappropriate?Thanks, I will follow how it evolves in next releases and will keep the feedback coming.
I’m thankful
-
Inappropriate?I have no idea about the inner brains of your program, but I want to offer some ideas instead of only leveling criticism.
What if you had I high level thread as your timing clock and a separate high level thread to deal with the collection and sending out of MIDI messages. Right now, it sounds like you are saying the layers themselves send out the MIDI messages. What if on each beat a MIDI thread is notified to release all current MIDI messages first before notifying the layer threads to calculate all the business of playhead movement, tokens, and notes for the next beat -- that the layer threads only deal with calculating the next notes and sending them to the MIDI thread's queue.
If the layer threads send notes to the MIDI queue late, you could have a timing option to either flush late messages or to send them out on the next beat.
Procedural pseudo code:
Main(
While running
If (beatThread.isBeat){
notify midiThread.releaseQueue()
notify all Layers.calculateNext()
notify UI.update()
}
)
In my mind, at least, that seems like a quick solution to getting rid of MIDI delay from waiting on the layers to send out MIDI messages.
I’m excited
-
Inappropriate?The next release will include a preferences pane where you will be able to alter the layer thread priority and boost it to maximum. If you're already hitting CPU issues I am not confident this will solve your problems but it's a fairly easy place to start.
Octatone correctly identifies that each layer is sending MIDI independent of the others and this is not ideal. However the correct solution is to use CoreMIDI's forward scheduling linked to the tempo. If I can get the timing code into better shape and optimize the run loop this should work very nicely.
One issue is that boosting the priority of the layer threads might, in a worst case scenario, mess with the high priority thread driving the CoreMIDI server. So we might solve one problem and gain another.
We'll see :)
Regards,
Matt
p.s. Expect 0.9.4 in a couple of days all being well.
I’m unsure
Loading Profile...



EMPLOYEE
