Jump to content

Bally Sound Chip Fun: Tetris and Zelda Theme Songs (part of a much deeper exploration)


Recommended Posts

YouTube Short on Original Hardware: https://youtube.com/shorts/V2vkoQyhdi4?si=G1U5BF4eA6JXWSNJ 


(MP3 of output below, from emulator. As well as WAV data files to playback yourself.)


The Tetris bit cuts out short in the video but you still get the idea.


This spring/summer I went down another Bally rabbit hole to better understand the sound chip. I found it to be incredibly versatile with its three voices, noise, vibrato and tremolo capabilities. Certainly beyond what most other consoles through the early-80s could handle (even flagship systems like the TRS-80 Model 1 had no internal sound, relying only on mic-out manipulation for patchworked sound). A lot of these aspects have not often been tapped into, short of a few 70s-80s Bally legends like George Moses (who noted in his Bach music advert: “It took 5 months, 22,000 inputs and many new techniques to organize and de-bug this tape.” – Now that is dedication…)


The second segment of the Tetris theme via Bally is quite comparable to a lot of chiptune style music you’d find on Commodore etc. (NOTE: The attached data WAV files will work on a real Bally or the MAME emulator, but do not work through Evie’s BackBit due to the way the bytes are stored… I will send her a sample to see if she can improve the BASIC loading of that adapter, but it’s admittedly a very fringe use case.)


More Context and Technical Breakdown


When AstroBASIC released, they introduced dedicated variables for managing the master oscillator, volume and tones of three notes. But in taking this route (with NT=0) you end up missing out on the rest of the capabilities. Even manually poking the other ports relating to noise or vibrato will have no obvious affect if you mix it with the variable approach. Knowing this, I found the original I/O interfacing to be more adaptable (with NT=-1 to skip any AstroBASIC convenience variables). Spent considerable time studying the block diagrams and schematics in Bally’s “Hacker” guide and various newsletters to gain a higher understanding of how the various ports interact with each other and produce different sound effects. With a default mapping, you can achieve 52 notes of playback from C#2 through E6. By adjusting the oscillator, you can drop or gain entire octaves to conform as needed.


Intrigued by the potential, I then imagined how modern music, video game themes and so on might sound if ported over to Bally while embracing all three voices and noise or vibrato where beneficial. So off I set toward creating a makeshift in-house MIDI parser to remove the burden of manually mapping and inputting every single note. I used the approach of storing the tone byte data beyond the “size” wall of the program data, as determined in AstroBASIC via address %(20000) after all the program code has been typed. This would allow me to generate poke data for each byte with my script, without needing to embed lengthy REM statements as data placeholders.


I added front-end controls for adjusting the volume, enabling noise with its own associated volume (at the moment the noise will toggle on/off every other beat to mimic a basic drumline), and whether the track should repeat at the end. For fun and convenience I also added the ability to customize the display with a title and custom background/foreground color from any of Bally’s 256 color options. The memory start and allocations are calculated and updated in real-time based on any of these changes, but I also have a buffer option so that you can adjust the title and other properties without having to re-enter all the note data afterward.


The general process for my homegrown music parsing system then became: 1) Find a MIDI online or record a new one, ideally one that doesn’t have more than 3 simultaneous notes or that can be reduced to such. 2) Edit the MIDI in an editor to delete irrelevant tracks and then merge all the remaining notes into a single track. 3) Import the MIDI into the parser, which will iterate through all the notes and generate the Bally code for both the player and the tone data copy-paste ready. 4) Adjust the title, colors, volume and options. 5) Paste the output into a new Bally project using Mame (with my front-end editor, which I expect to release to public before end of year). 6) Batch run all the code into Bally. 7.) Run to check the output, adjust as needed, then save to WAV file to load on actual Bally.


To implement automated and adjustable vibrato throughout a song, I thought of another clever solution. The MIDI files can be edited to include C1 notes since these are outside the ordinary range of notes. Inserting a C1 anywhere along the track will signify that a vibrato change is to occur. The duration set for that note equates to the frequency/vibrato value of port 20 from 0-255. So you can start a track out with no vibrato, then mix in different variants of it at moments in the song using this technique direct from the MIDI with no manual coding required and while keeping the player to a minimum. I use this in the Tetris song to vary it up to five times in the full tune.


I’ll be taking a bit of a break from this project but still intend to release these two different toolsets to the community as-is by Christmas once I get them into a more distributable fashion.


Enjoy! P.S., The Zelda track doesn’t loop perfectly as I kind of ran out of time to perfect it and then lost the source MIDI I was working from… But it’s close.







Edited by MattPilz
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...