Click here to Skip to main content
15,887,337 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
0x01AA5-May-22 3:26
mve0x01AA5-May-22 3:26 
GeneralRe: CCC 2022-05-05 Pin
Greg Utas5-May-22 3:51
professionalGreg Utas5-May-22 3:51 
GeneralRe: CCC 2022-05-05 Pin
rnbergren5-May-22 4:15
rnbergren5-May-22 4:15 
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 
I'm working on complicated MIDI wizardry for IoT gadgets, so I can make MIDI "smart" pedals and controllers and such.

Playing a multitrack MIDI file without reading it into memory is a bear.

I have just not been able to get this code right.

The trouble is each midi event has a delta attached to it that is the offset in "MIDI ticks"* from the previous event.

*A midi tick is a fixed time duration based on the tempo and timebase.

With a multitrack midi file, each track has its own sequence of events and the deltas are all relative to that track.

However, in order to play them, you must merge all the tracks into one event stream, adjusting the deltas.

The actual adjusting of the deltas isn't so bad, but the logic to figure out when to pull from what track - I'm not even sure I have it right yet, because my code has other issues.

My point in all this, is MIDI is early 1980s protocol and multitrack midi isn't exactly brand spanking new. Sequencers with scant amounts of RAM were doing this.

I feel like in so many ways MIDI was designed to make it possible to do things on little devices without much RAM.

But this particular operation - in C# I just merged the tracks in memory before I played them. I can't afford the RAM or the CPU to do that here. I have to stream everything.

And I've convinced myself I'm overcomplicating things.

I hate when I do that - it means I have tunnel vision, and/or am missing something big and important.

I don't like knowing that I don't know something I need to know, you know? It bugs me, like a song that's stuck in my head I can't remember the entire hook to.
To err is human. Fortune favors the monsters.

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 
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 

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.