This is great! About four years ago, I was working on a MIDI visualizer similar to Synthesia and I remember there weren't many videos explaining MIDI files. Thank you for making this!
@hyoenmadan2 күн бұрын
I truly hate when specification documents don't store their snippets and samples with a monospaced font. Is like saving formulas in a math document as anything but the formal notation.
@STA-313 сағат бұрын
As a musical artist, I always wondered how computers actually manage to read those files and how DAWs read them too. This video explains it insanely well. You got my sub. ❤
@theashbot40972 күн бұрын
Love how you challenge me to code it myself! I know that is the best way for me to learn, but I really appreciate you helping those how might now know that!
@jmvr2 күн бұрын
5:26 My guess is that you can just easily read the whole byte, since negative integers have that first bit set to 1. But I don't know for sure
@jasmijnwellner6226Күн бұрын
Yep, I'm pretty sure that's it. I'm guessing that someone thought that it would be more efficient to do an unary minus operation rather than toggling a bit. I don't know if and to what extent it actually mattered at the time.
@bryankadzban1159Күн бұрын
Yeah, that's my guess as well: so that you can read that first byte as a signed char (in C) and if the whole byte is less than zero, the frame rate is just the byte value times -1.
@frasermips14 сағат бұрын
I believe that the minus comes from the first bit being set. Depending on the CPU's assembly instructions there is often a compare to zero, which avoids loading the comparison value into a register. The CPU can compare -30 to zero within a single instruction. This is generally faster than an & or | bit extraction followed by a compare.
@kono15223 сағат бұрын
omg this came in at the perfect time ive been trying to wrap my head around the midi file format to make my own midi player as well
@tl880linux3 күн бұрын
Dude this is great! I went on a similar journey with MIDI even down to hex editing test files. My focus is more on realtime MIDI, so if/when I ever get that video out, I will point people here for the technical details of MIDI files. Looking forward to the Soundfont video!
@mtirado3 сағат бұрын
Very good explanation. I worked on my own MIDI parser a few months ago, so this would've been very useful; specially the explanation about the Running Status, as I was confused why I wasn't able to parse events correctly. Another catch is that some MIDI files treat a note ON event with a velocity of zero as an OFF event.
@RayBellis13 сағат бұрын
This is timely, as I've just been writing an SMF parser so that I could extract the sysex data from a preset dump that had been stored in SMF format. Something you've apparently missed is that the spec *requires* that the final event in every track be an "end of track" meta-event, encoded as FF 2F 00. Also, running status is only allowed for *channel* messages (0x8* - 0xE*) and not for system messages or meta events (0xF*).
@CoolJosh3kКүн бұрын
My guess for the negative frame rate, is due to the MSB being 1. If not masked out, then the sign bit would mean the integer byte represented is ranging from -128 to -1.
@yannickperret158619 сағат бұрын
Yes, I'm pretty sure this is that.
@tivonlitster25473 күн бұрын
Under appreciated video. You do an incredible job putting so much information into a linear stream of thought.
@rcnhsuailsnyfiue23 күн бұрын
Brilliant explanation, excellent graphics, keep up the great work!!! 🎹
@squidmaster964Күн бұрын
Insanely good video, keep up the great work!
@lohphatКүн бұрын
SMPTE colloquially pronounced SIM-tee Society of Motion Picture and Television Engineers Like the IEEE, SMPTE sets the technical standards for all things video and audio over all media. e. g. The new ST2110 SMPTE standard defines how to handle realtime video and audio and timing data over IP networks vs using baseband SDI cabling.
@jogloran2 күн бұрын
Excellent choice of sample MIDIs.
@nurmr9 сағат бұрын
1:06 Easy Driver from Transport Tycoon. Originally composed by John Broomhall.
@sokzpieprzu2 күн бұрын
Great and informative video. Makes me wanna create my own MIDI editor/parser
@textnumbers222 күн бұрын
So if I remember correctly the number of 32nd notes per quater note is a backwards compatibility feature.
@jcf_176016 сағат бұрын
I think the quantity of 32nd notes in a quarter note thing is primarily used to aid in tuple subdivisions, like playing 3 notes evenly across a half-note. I think it also aids in allowing nested tuples to be played. It might also be used by music notation software to help with time signatures. But that's just my theory.
@NicholasAndre1Күн бұрын
Very cool! I’ve wanted to do more with MIDI it’s quite a nifty protocol.
@RollingHeat13 сағат бұрын
I previously made a MIDI decoder and synthesizer, but I am interested in the sound-fonts and if there are standardized formats and publicly available files for these.
@ZullfixКүн бұрын
You've nerd sniped me and now I want to write a MIDI parser for fun
@Hereson16 сағат бұрын
An excellent explanation 🎉
@ebin22222 күн бұрын
14:23 You can tell this standard was made by americans for dedicating instruments to helicopter, applause and gunshots.
@gameslp7583Күн бұрын
when you said that python didn't have do while loops and you'll just make a while loop with an if statement at the end... you can just replace the "True" in "while True" with the condition......
@jmvrКүн бұрын
A do-while loop is a loop that will always run at least once. If you replace the True with the conditional, there's the chance that the condition will be False, resulting in the loop never being run at all. Using an if-statement at the end of the loop achieves the goal of a do-while loop. ``` while 1 > 5: print("This will never run") while True: print("This is guaranteed to run at least once, but due to the end if-statement, it will not continue") if 1
@JamsODonnell10018 сағат бұрын
Very impressive! As a non programmer but keen amateur musician this is the first explanation I have ever seen. Certainly the first that makes any sense to me. Cheers. I’ll need to re watch to properly grasp most of it! Could the irregular number of 32nd notes in a quarter note be down to making playback more human? - I can remember when drum machines were almost instantly recognisable because their timing was ‘too perfect’, and mechanical sounding…Humans can rarely play anything exactly in time
@Wutheheooooo11 сағат бұрын
That's not how do while loop works.
@LukeVader7715 сағат бұрын
I appreciate the monkey island soundtrack in the background