Click here to Skip to main content
15,887,135 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

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.

 
GeneralRe: CCC 2022-05-05 Pin
Craig Robbins5-May-22 4:37
Craig Robbins5-May-22 4:37 
GeneralOi! Greg Utas! Pin
OriginalGriff4-May-22 23:49
mveOriginalGriff4-May-22 23:49 
JokeRe: Oi! Greg Utas! Pin
Peter_in_27805-May-22 1:05
professionalPeter_in_27805-May-22 1:05 
GeneralRevenge of the 5th Pin
Jacquers4-May-22 19:03
Jacquers4-May-22 19:03 
GeneralHow did they do it? PinPopular
honey the codewitch4-May-22 18:37
mvahoney the codewitch4-May-22 18:37 
GeneralRe: How did they do it? Pin
David O'Neil4-May-22 18:59
professionalDavid O'Neil4-May-22 18:59 
GeneralRe: How did they do it? Pin
honey the codewitch4-May-22 19:03
mvahoney the codewitch4-May-22 19:03 
GeneralRe: How did they do it? Pin
Kirk 103898216-May-22 4:36
Kirk 103898216-May-22 4:36 
Isn't this effectively a merge sort from N sources.
Each source is already sorted. I admit my ignorance in how you calculate your context.
But I assume that EITHER you have an incoming stream of N contexts pre-sorted (which would make outputting it more trivial as you output it in the order it arrives).

Or you have an incoming stream with N tracks, where each track is at a specific offset, but the magic is that while track 1 has a small delta, track 3 could have an excessively large delta, so it is played at the right time. And you might not hear from track 3 for some time.

I often find it helpful to imagine how they implemented the player at the hardware level.
For my take, I would write something that played only 1 of N contexts correctly...
Then I would look hard at how to implement simply adding a second context to that. Based on how the data shows up.
Because by the time you get to the third or fourth, I think you usually have a decent approach.

The other comparison I would make is a Multiplexer. is this similar to CDM or TDM (Code or Time division Multiplexing).
Another comparison is Stereo, where you get L+R and a 2L (I forget the actual), but taking -2L + L+R => -L+R + L+R = 2R
But they did it that way to take advantage of simpler hardware.

I remember learning from that example that coding stuff versus building components you have to think differently about what is easy/hard.

==
Finally, your problem reminds me of a Computer Engineering Class, where we built circuits that were run through a simulator. The simulator used a queue design, where "events" would trigger through the queue, and the simulator was able to be fast, because it ignored the timing signals, allowing it to "not wait" any time before processing an item. (I got in trouble in the class, because I wrote obscenely inefficient but SIMPLE code, reducing the homework to a TRIVIAL problem, avoiding the timing issues others were busy coding around).

anyways, I could envision a queue that is managing N queues of inputs, and only when you take off an item, do you go to the stream to pull in another item.

GeneralRe: How did they do it? Pin
honey the codewitch6-May-22 6:31
mvahoney the codewitch6-May-22 6:31 
GeneralRe: How did they do it? Pin
Peter_in_27804-May-22 19:11
professionalPeter_in_27804-May-22 19:11 
GeneralRe: How did they do it? Pin
honey the codewitch5-May-22 15:19
mvahoney the codewitch5-May-22 15:19 
GeneralRe: How did they do it? Pin
User 4909744-May-22 22:36
User 4909744-May-22 22:36 
GeneralRe: How did they do it? Pin
CPallini5-May-22 2:50
mveCPallini5-May-22 2:50 
GeneralRe: How did they do it? Pin
Wizard of Sleeves5-May-22 20:51
Wizard of Sleeves5-May-22 20:51 
GeneralRe: How did they do it? Pin
honey the codewitch6-May-22 1:57
mvahoney the codewitch6-May-22 1:57 
GeneralRe: How did they do it? Pin
Dougy835-May-22 21:18
Dougy835-May-22 21:18 
GeneralRe: How did they do it? Pin
honey the codewitch6-May-22 1:18
mvahoney the codewitch6-May-22 1:18 
GeneralRe: How did they do it? Pin
Dougy836-May-22 1:48
Dougy836-May-22 1:48 
GeneralRe: How did they do it? Pin
honey the codewitch6-May-22 1:55
mvahoney the codewitch6-May-22 1:55 
GeneralRe: How did they do it? Pin
Dougy836-May-22 1:57
Dougy836-May-22 1:57 
GeneralRe: How did they do it? Pin
Dougy836-May-22 1:56
Dougy836-May-22 1:56 
GeneralRe: How did they do it? Pin
Cpichols6-May-22 1:49
Cpichols6-May-22 1:49 
GeneralRe: How did they do it? Pin
honey the codewitch6-May-22 1:58
mvahoney the codewitch6-May-22 1:58 
GeneralRe: How did they do it? Pin
Gary Wheeler6-May-22 2:02
Gary Wheeler6-May-22 2:02 
GeneralRe: How did they do it? Pin
honey the codewitch6-May-22 2:44
mvahoney the codewitch6-May-22 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.