Jump to content

Photo

Assembly language sound effects

Assembly Sound

8 replies to this topic

#1 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,736 posts
  • Location:Denmark

Posted Wed Jul 24, 2013 1:28 AM

I would like to add some sound effects to my game that are a little more interesting than the usual square wave crash and chime examples from the A/E manual. Do you have any suggestions for tricks or techniques to use to produce other effects or wave forms? I have read about the sample trick used by the Sound FX program, but I have no room for samples, so it has to be programmed and relatively short, but it doesn't have to be limited to a 60 FPS data feed.

One idea I have is to rapidly changing the frequency on two generators slightly out of sync to obtain an illusion of phase shifting. I have no idea if that's possible or what that would sound like.

Before I start experimenting, are there any limitations to the sound emulation in Classic99 and MESS that I should be aware of?

#2 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,062 posts
  • Location:Uzbekistan (no, really!)

Posted Wed Jul 24, 2013 2:02 AM

One idea I have is to rapidly changing the frequency on two generators slightly out of sync to obtain an illusion of phase shifting. I have no idea if that's possible or what that would sound like.


That's a trick i've often used and it works well. By varying the pitch of one channel slightly you can get some nice phase effects.

#3 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,111 posts

Posted Wed Jul 24, 2013 2:05 AM

I think 60 FPS will be efficient for any sound effect. Also real time manipulation.

The ISR will play all channels but only one track. For example, if you tryout BurgerTime, the music will stop every other second for sound effects to play. Like if you want to play music and have lasers or explosions at the same time, you have to plan which channels to use for what (or get more advanced than that), and also write your own multi track player, like ISR but capable of playing more than one track at the same time.

Having one frequency slight off from another can generate rich sound dynamics. This demonstrates the difference between one frequency and two close to each other.

100 CALL SOUND(1000,110,0)

100 CALL SOUND(1000,110,0,111,0)

I haven’t replicated my problems with Classic99 on other computers (yes, will do), but often have to go and check things like quality of smoothness, sound and speech on MESS. Classic99 appears rather jerky and I loose joystick control within 2 to about 25 minutes, MESS and Win994a works fine for trying to beat a score with MunchMan etc.

I once used a sound spectrum analyzer (PC) to sample frequencies in chunks of 1/60 of a sec. Works fine with “clean” sound effects from any source, but then even simple music and speech becomes pretty unrecognizable.

:)

#4 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

  • 5,351 posts
  • Coding something good
  • Location:Mexico City

Posted Wed Jul 24, 2013 8:02 AM

There are various simple yet interesting sounds that can be done using a single channel. In my games I distinguish a start effect and doing effect routines.

I use to "dump" sound at start of interruption so it doesn't "change" place in time, and most of times I've a counter/frequency value for each sound.

Like these (of course, add a volume setting)

1. Bump: start: count = 0x07. var = 0x0300 doing: if (!count) return; count--; channel3 = var; var += 0x20;
2. Laser: start count = 0x03. var = 0x0100 doing: if (!count) return; count--; channel3 = var; var >>= 1;
3. New life: start: count = 0x20. var = 0x0200 doing: if (!count) return; if (count & 1) return; count--; channel3 = var; var = var - (var >> 4)

Sometimes I also play with volume setting.

You can also put two tones in same channel, playing in alternate frames.

#5 retroclouds OFFLINE  

retroclouds

    Stargunner

  • 1,602 posts
  • Location:Germany

Posted Wed Jul 24, 2013 12:13 PM

You might want to check out the sound player by Tursi and the sound player by Marc, both are assembly language routines and a lot more advanced compared to the ISR da-dee-do player :-)

On a sidenote, I seem to recall that the Colecovision had an advanced sound player embedded in the OS7 bios.

Edited by retroclouds, Wed Jul 24, 2013 12:17 PM.


#6 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,059 posts
  • HarmlessLion
  • Location:BUR

Posted Wed Jul 24, 2013 6:35 PM

Before I start experimenting, are there any limitations to the sound emulation in Classic99 and MESS that I should be aware of?


Classic99 currently can't cope with sound changes faster than 60hz, it'll drop them. That's the only limitation I'm aware of with it.

Oh, and it won't attempt to generate extremely high (inaudible) frequencies. (I can't remember the cutoff). But this does prevent it from working with samples.

Edited by Tursi, Wed Jul 24, 2013 6:35 PM.


#7 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

  • 5,351 posts
  • Coding something good
  • Location:Mexico City

Posted Thu Jul 25, 2013 7:35 AM

Because I'm "moving" between MSX and Colecovision, I didn't use any BIOS routines but my own music player and routines for sound effects.

#8 Airshack OFFLINE  

Airshack

    Dragonstomper

  • 658 posts
  • Location:Phoenix, AZ

Posted Sun May 6, 2018 11:34 AM

 

You might want to check out the sound player by Tursi and the sound player by Marc, both are assembly language routines and a lot more advanced compared to the ISR da-dee-do player :-)

On a sidenote, I seem to recall that the Colecovision had an advanced sound player embedded in the OS7 bios.

I'll be searching for information on these players....any advances in the past five years?



#9 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,059 posts
  • HarmlessLion
  • Location:BUR

Posted Tue May 15, 2018 1:23 AM

The download for mine is here: http://harmlesslion.com/software/vgm





Also tagged with one or more of these keywords: Assembly, Sound

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users