The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
No amount of caffeine is getting me through my morning,
Have you tried with bacon?
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
Why not just find the first previous non-muted object, storing its 'this', as well as the current offset tick, then recreating the vector without shuffling, finding that 'this', setting the container's location to 'that', and then playing the next object in the list at the appropriate time?
It's more complicated than it sounds because i'm not working on the merged tracks. I only see the individual tracks separated at that point.
They get merged only at the last second.
I'd have to show you the code, but putting in dummy messages is the easiest, if not the cleanest solution. It's far easier than recomputing all the delta times in each of the events in each of the tracks.
If you are creating a pure MIDI stream and sending it to some process that only works in MIDI diff-times, then you will have to do something like you are stating. If not, you can just add a check to the C# object in the container when it reaches play time, and if it's track is muted simply don't play it.
It doesn't work they way, because the driver takes events with deltas attached to them. You queue them up with the deltas attached and it plays them when the time indicated by the delta comes up. It does this in the background. All the deltas are relative to each other, so if you remove an event, it shifts all the notes that follow it back by whatever it's delta was. So I'd have to recompute all the deltas any time i remove an event.
I should add, I do actually, use the absolute time technique when I'm doing non-streaming playback, but that doesn't do background playback. It blocks the thread and just chews up CPU. It uses no waits, no timers, nothing, except querying the current system ticks and playing the event stream in a tight loop.
If you can't do as Greg says, then it is a matter of going through each non-muted track individually, and finding the last non-muted event played. Recreate the new container without the muted events, find that last event played, and do the corresponding finagling. Unless I'm missing something.
OK - I have a garden that is mainly Eggplant and Hot peppers. All sorts of hot peppers. The point of all this, of course, is to get as much fruit as possible (otherwise I'd just look at pictures of them in seed catalogs).
Well - it started with some indoor hot banana peppers that survived well over a year in a sunny window at work. To get peppers from them, since there was a shortage of bees and other pollinators, I took upon myself the task of giving them the finger - or more precisely, the back of my thumbnail. For peppers, even without other pepper flowers available, this was enough to cause fruiting. Still, it was rather crude.
So now I've gotten a small soft paint brush - a tiny version of the ones used by humans during what is oft called 'foreplay'. Here's the plan:
I figure that if even a fingernail gets the flowers to go to fruit, imagine how much the yield will improve if the plants enjoy the experience even more with gentle and genteel brush strokes! As I only just started this method, there is an obvious induction period before any results are observable.
I'll update the lounge, if there is the expected clamor for the results, when the upcoming developments are manifest, so stay tuned !