How do I use sound effects in a BASIC program?

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
Chris
2nd Star Corporal
Posts: 29
Joined: Tue Jun 05, 2007 1:45 am
Location: Oregon, United States
Contact:

How do I use sound effects in a BASIC program?

Post by Chris »

I'm assuming that there are 4 sound effects the Oric is capable of (Shoot, explode, zap and ping.) What is the correct syntax of using these? Something like:
1 A=0
2 A=A+1
3 IF A>50 THEN SOUND PING
4 IF A>99 THEN A=0
5 GOTO 2

Would that make the 'ping' sfx go off repeatedly? I know a little bit of Basic from using Batari Basic, but am completely new at Oric machines and what they're capable of.

EDIT: Did some tinkering by myself and Found out if I take SOUND out, it works.
-Chris
User avatar
Pengwin
Pilot Officer
Posts: 69
Joined: Sun Jan 07, 2007 11:03 pm
Location: Scotland
Contact:

Post by Pengwin »

Just one thing you need to be aware of is that if you start a new sound effect before the previous one has completed, it will override the old one.
User avatar
Pengwin
Pilot Officer
Posts: 69
Joined: Sun Jan 07, 2007 11:03 pm
Location: Scotland
Contact:

Post by Pengwin »

After looking at the Atari version of the game, I see that the 'overlap' of sounds would actually work in this instance. :D
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

PING and ZAP are blocking sounds:

If you write

PING:PING:ZAP:PING:ZAP:PING

you will clearly hear the succession of pings and zaps. And the program is blocked during that time.

SHOOT and EXPLODE are non blocking, so if you write:

SHOOT:EXPLODE:EXPLODE:SHOOT:EXPLODE

it will just sound like an explosion
Post Reply