EDIT: Upon reading the original code:
int volume = 60;
periodMicros = 1000000/((long)freq);
onMicros = periodMicros * volume/100;
offMicros = periodMicros * (100-volume)/100;
volume doesn't control the volume, but the duty cycle (timbre and harmonic content) of the waveform. And it looks like I guessed the 40% (audibly equivalent to 60%) duty cycle exactly!We once had a film crew in our school trying to get some shots of us at the computer. I overheard them having big problems getting the CRT flicker free on camera and trying to find out the refresh rate.
I was maybe 12 at the time and just told them point blank it‘s 60Hz. They asked me how I knew and I just told them I could see it from the feel of the flicker. Was a good guess as well since it was one of the standard VESA frame rates.
The cameraman came back to that kid 3 minutes later, showing me the shutter set to exactly 59.7 Hz with a still very surprised face.
I don't know what you mean by "muddy", but I did notice the speaker (perhaps mic too) has a crappy frequency response, and the bass notes are quiet and difficult to identify the pitch of.
For me, the Amiga version brings back the fondest memories - 4 channels of glorious 8-bit sampled sound! Unfortunately two of those channels were hardwired to the left speaker and two to the right speaker, so listening with headphones is not so great, but still...
I really wanna know how this was done, presumably by offsetting all the various sounds. Maybe very short notes jumping around, perhaps the raggae style off-beats help.
There's a big documentary on Monkey island on YouTube, unfortunately it doesn't go much into the music.
They had great musicians. The dynamic iMuse music in Monkey Island 2 and Tie Fighter (only in the DOS/MIDI version) was incredible.
The PC speaker doesn't play a single frequency, it toggles between “on” and “off”. There's techniqueels to drive so that it looks to be next level of softwarr like it is playing a single frequency, or like it has, e.g., an 8-bit position setting, or...a number of other things. But even those super-basic things are illusions over toggling at appropriate times, not the native function of the speaker
Among the many fantastic pieces covered you’ll also find the Monkey Island theme.
The whole pack is available for free:
http://mbrserver.com/warez.zip
Please also appreciate the retro-ansi-gfx style of his productions!
The semi-open island hopping of MI2 was specially fun. I still wonder if there will be an open-world game like Skyrim or Fallout etc. that is spread across islands instead of an endless landmass.
Too bad LucasArts got gobbled up by the D Demon and Monkey Island will probably never get another revival because it cannibalizes Pirates of the Caribbean.
Unless Ron Gilbert et al. can pull off a Thimbleweed Park with it.. ;)
I wouldn't mind figuring out how to get a midi to sound like the PC speaker. Setting a square wave synthesizer as the instrument doesn't do it.
(check out his performance on youtube - not only the intro, but also the complete Woodtick theme, Jojo from MI2, etc.)
(And fwiw, my brother plays marimba and other percussion in MI4. To this day, one of the weirdest gigs he's ever had.)
1. http://www.supermarcatobros.com/podcast/tag/monkey+island
My young daughter will grow up with a vague knowledge of it as it - along with the theme to Monty Python's flying Circus - are the two tunes I hum to her to get her to sleep.
The real magic happens in their music driver, which takes the sound effects, multi-track MIDI music, along with track priority infomation and dynamically down-mixes it to however many tracks the current audio device has. Just one in the case of the PC speaker.
I assume they would have had a setup that allowed them to quickly hear what the track sounded like on all their target audio devices.
The tracker music/custom sequencer formats operated in a parallel universe alongside the MIDI workflow and were more often the provenance of scrappy demosceners and independents who saw an opportunity to completely control the output quality(as long as it was sample-based). Not everyone literally used a tracker type of workflow and there are examples like MML(Music Macro Language) as another idea of source formats, as well as the low-level "enter hexcodes in a machine language monitor while the playback routine is running" (used by some C64 composers.) If you played a DOS game made with QBasic it probably used the PLAY statement to control the beeper, with an MML-style syntax. This style of syntax would appear again with programmable mobile ringtones.
In the mid-90's the balance shifted again towards CD audio, ushering in simple drum loop sequences as the quick-and-dirty audio filler of choice, and everything since then has largely been variations on that theme with more tracks and processing.
It was seeing a bunch of .MOD files on the floppy that first prompted me to download a mod tracker back in the BBS days.
It's one of those memories that will stay with me forever.
I would really like to share this experience with kids I know but I find it hard to find the right time and way to show it to them and to get them to play. Did you play it with them? Or just show it to them? On a computer or a phone?
I'm so curious O:)
Awesome project, too!
I am seriously considering playing it again with them this summer :-D
I think I first played them at the age of 7 or 8.
I bet the dramatization-translations must be the trick :) It's like an animated story book.
My mind was completely blown away by the early MOD players that somehow managed to play relatively high res music through the speaker. I have a vivid memory of playing Axel F and being in total disbelief!
There's a web-based player so you can hear this MOD without having to download anything.
Videogames required a lot of trickery to do what developers wanted them to do. And they succeeded.
(As a fun parenthetical, it's enjoyable to consider that the studio that produced this game was LucasArts. This was one of the projects Lucas had his game studio create because he was gunshy about whether they could produce games that would enrich or dilute the Star Wars brand. He wanted them to do original IP first to verify they were, first and foremost, game creators. The studio's first published game was 1985, this game came out in 1990, and 1991 would see their first Star Wars game released).
https://www.filfre.net/2021/02/the-second-coming-of-star-war...
MI music is great though, I speak it as a person who has LeChuck fanfare on a ringtone.
It needs to be emphasized that the game had hours of music. Every different race encountered, every mode of travel and even different planet types had different music. All through a PC Speaker and would run on a 286. The game was a technical marvel for the time.
Here is the game from the post running on DOS with various sound cards: https://www.youtube.com/watch?v=Fr-84mjV3CI
Another option is LCD TV speakers, those already have an enclosure but are a bit larger.
So then how do you attach/enclose this tiny speaker?
This is what I mean: https://www.mmobiel.com/loud-speaker-for-iphone-8-plus-serie...
Some have just two contacts you can easily solder speaker cables to, just avoid the ones with complicated connectors. You don't need to enclose it to get good sound, it already has an enclosure. I often choose plush toys with a simple MP3 SD player (1€ on Aliexpress, eg https://www.aliexpress.com/item/32657798948.html) and some triggering mechanism.
You can run it in the browser here to listen to the intro music: https://archive.org/details/msdos_Xenon_2_-_Megablast_1990
Thanks for posting this! I'll refer to it when I finally get around to making it.
Hopefully the grand kids appreciate the theory/use of Huffman!
Well, if the bird in question used an LZ77 followed by Huffman, he could compress all that wood/chuck stuff down to almost nothing. So he could chuck a lot :-D
ItaloBrothers - Stamp on the ground. 2009. https://youtu.be/cHcVU5cGUNE
Basshunter - DotA. 2008. https://youtu.be/qTsaS1Tm-Ic
Hilariously fun to play.
And, as someone who wants to program in more embedded systems, it tells me how high the cliffs are ahead of me...
No, mate - it wouldn't. Don't be confused by the "printf"-dump; the Python script processed it into pairs of (frequency,delay). That is, when you see...
989 Hz @ 15209
989 Hz @ 15213
989 Hz @ 15218
784 Hz @ 15222
784 Hz @ 15226
...the data actually generated are: (989, 15222-15209),
(784, ... -15222),
Simply put: RLE can't do anything on them. The repetition has already been "cleaned out".I wouldn't have gone to Huffman compression if I had a simpler choice.
RLE might have helped for repeated notes - but I guess Huffman coding kinda compensates for that anyway, in the repeated notes will probably end up with shorter bit strings.
If you can, try to make the video louder. I really had to crank up the volume to listen to it. (Probably use a combination of normalize and compress in Audacity.)
Cool hack!
Live and learn :-)
I can't be the only one.
In my opinion it fits the general humor of the game perfectly, but I can definitely see how it would could be annoying.
But still annoying.