Jump to content
newcoleco

NewColeco's Tiny Music

Recommended Posts

Posted (edited)

Hello everyone!

 

In 2018, I was working on a way to add music data as small as possible in my future projects without typing each note as a frequency and a volume effect. As a bonus, I've also considered to add vibrato and arpeggio support which sure increase the code size but do provide a richer sound experience.

 

To achieve this, I've simply extended the CV BIOS sound format by using its sound type 4 which is just a call to a routine. The routine is reading differently the sound data as my proposed new tiny sound format which reduces to (almost) 1 byte each note. I've coded this routine based on my needs and the way I compose music. Some details are written in the "sndtiny.asm" source file, and you are invited to look and modify the data in "snddata.asm" to figure out by yourself how the notes are coded.

 

The way I code music in my projects in based on CV BIOS sound format, the channels 0 and 3 are working together to play NOISE and BASS notes in a loop, these channels are not affected by this new format. The channels 1 and 2 are the melody channels and those do benefit from this new format by quite a lot for long music composition.

 

I have trouble to make this new sound format work with my music_update routine, so I'm also considering to write a more stable music sequencer in the future.

 

TINYMUSIC.thumb.PNG.4db383b16c9f24d9c2d9fba7adc5daea.PNG

 

The source code is entirely in assembly code and uses keywords only used by tniasm assembly cross-compiler. But it can be easily adapted to be compiled by other cross-compilers.

 

Version 0.1 Alpha TINYMUSIC.ZIP

Version 0.5 Alpha (bugfix) sndtiny.zip

Edited by newcoleco
  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks a lot !!! Nice to see you back on the coding path ;)

Will check your code and how I can use it, if possible, in my games.

Share this post


Link to post
Share on other sites

Tested and... I've spotted some issues in version 0.1 Alpha including an incorrect "6 bits code to 12 bits period" conversion, and also other bugs I'm not sure how to fix at the moment.

 

Will work on it again another day.

 

Version 0.2 Alpha (just the tiny sounds routines file) : sndtiny.zip

Share this post


Link to post
Share on other sites

I don't suppose you could create a simple interface that you type in a series of notes from some sheet music or a simple tune then it outputs compileable assembly code...

Just checking.

 

Music and Sound effects seem to be the hardest part of Coleco programing.

Share this post


Link to post
Share on other sites

Fixed an out-of-sync issue by simply make sure the duration counter in the init sound routine is reset to zero before trying to play any note.

 

Version 0.3 Alpha (just the tiny sounds routines again) sndtiny.zip

 

This version seems stable enough to try adapting part (about 5K data) of my compositions to tiny sounds format. I've selected the hardest one to adapt which is the elaborated Commando Chiptune music. There will be differences in the sounds quality of course but it should be close enough. And since I keep the bass and drum sounds data as is from the original composition, only the melody will be affected by this experiment. And, because of all these notes with arpeggio everywhere that were coded into multiple sounds swept codes for each note, tiny sounds format will make a big difference in size, like saving 20 or more bytes per 12 cycles duration notes. The size of the tiny sounds routines should be worth it right at the start of the Commando music.

 

To be continued...

Share this post


Link to post
Share on other sites
On 8/8/2019 at 3:03 AM, Mike Harris said:

I don't suppose you could create a simple interface that you type in a series of notes from some sheet music or a simple tune then it outputs compileable assembly code...

Just checking.

 

Music and Sound effects seem to be the hardest part of Coleco programing.

 

One step at a time - I'm getting closer to a stable sounds player with vibrato and arpeggio support.

 

This is just a spark, an idea of routines based on my way to compose music with a bonus of data optimization.

 

My goal is to code something stable I will use myself to compose even more music in the future.

 

And if there is any interest in using this experimental sounds format to compose musics, I'm sure talented programmers will figure out a way to make it easier to use.


 

  • Thanks 1

Share this post


Link to post
Share on other sites

My real fantasy would be if someone had the file and sound format to Video Tunes so we could use that to compose and retrieve the logic in Assembly.

There is a guy on Youtube named Steve Simpson that says he programed Video Tunes and I have reached out to him with zero success.

 

Share this post


Link to post
Share on other sites
8 hours ago, Mike Harris said:

My real fantasy would be if someone had the file and sound format to Video Tunes so we could use that to compose and retrieve the logic in Assembly.

There is a guy on Youtube named Steve Simpson that says he programed Video Tunes and I have reached out to him with zero success.

 

I have no idea what is Video Tunes.

Share this post


Link to post
Share on other sites
34 minutes ago, newcoleco said:

I have no idea what is Video Tunes.

LOL

 

It's an ADAM program that allows you to compose music, save it and I think print out the sheet music but don't quote me on that.

Graphics I think I have mastered.
Sounds and Music is still a mystery.
Just waiting on Tony Cruise's next two programing videos which is supposed to explain sound and music.

 

Edited by Mike Harris

Share this post


Link to post
Share on other sites
7 hours ago, Mike Harris said:

LOL

 

It's an ADAM program that allows you to compose music, save it and I think print out the sheet music but don't quote me on that.

Graphics I think I have mastered.
Sounds and Music is still a mystery.
Just waiting on Tony Cruise's next two programing videos which is supposed to explain sound and music.

 

Code now working for all three platforms i.e Colecovision, MSX and Spectravideo, article complete, just need to get a break from family stuff to actually record it :)

Share this post


Link to post
Share on other sites
15 hours ago, Tony Cruise said:

Code now working for all three platforms i.e Colecovision, MSX and Spectravideo, article complete, just need to get a break from family stuff to actually record it :)

 

You are fast!

 

Meanwhile, after hours of work, I've finally fixed a special tiny sounds routine bug and converted (most of) my ColecoVision Commando music based into tiny sounds. It sounds similar to the original without some nuances only possible by coding every notes by hand.

 

More than half the data size was saved by using this new format.

 

Bugfix : Removed the unneeded RESET " (ix+7),0 " that was stopping the special code 3 to play fully if the duration was more than 1 unit of time. This is important for the special drum code 0xfe and the freq and volume swept code 0x03 (see CV BIOS sound format).

 

Music Commando (src) with updated tiny sounds routines TinyMusic - Commando - src.zip

Music Commando (bin) both original and tiny sounds versions : TinyMusic - Commando - bin.zip

Edited by newcoleco
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Pretty damn good....

Just as a viewer from the outside looking in...
 

Can that be adapted to a working game or does it take the entire processing power of the Colecovision?

I can pretty much guarantee you that not one of the original developers of the Colecovision would have ever dreamed this was possible.

Can you imagine if this kind of music came out from the beggining.

Coleco would have dominated the market.

Share this post


Link to post
Share on other sites
3 hours ago, Mike Harris said:

Pretty damn good....

Just as a viewer from the outside looking in...
 

Can that be adapted to a working game or does it take the entire processing power of the Colecovision?

I can pretty much guarantee you that not one of the original developers of the Colecovision would have ever dreamed this was possible.

Can you imagine if this kind of music came out from the beggining.

Coleco would have dominated the market.

Thank you!

 

Beside decoding the data written in the new format I've invented, and using a little bit of RAM to store pointers and instrument codes, these sounds are played by the ColecoVision BIOS sounds routine. Therefore, this doesn't use that much extra CPU power than regular CV sounds. By exploiting the BIOS power, I was able to plugin my routines and avoid adding too much codes in the ROM. All the sounds priorities and effects are for the most part from within the BIOS. 

 

In other words, this could have been implemented and used back in the 80s without a doubt.

Edited by newcoleco

Share this post


Link to post
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.

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

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...