TIP: Click on subject to list as thread! ANSI
echo: apple
to: comp.sys.apple2
from: Bill Buckels
date: 2008-04-15 15:43:38
subject: Re: Musical Playback In Aztec C

On Apr 15, 4:12=A0pm, "Simon D. Williams"
 wrote:
> On Tue, 15 Apr 2008, Bill Buckels wrote:
> > Musical Playback functions for Aztec C that runs on the apple ][
>
> *** I don't know C, so this may well be a stupid question:
>
> In the tone routine, does note duration change relative to pitch? I'm
> curious because most assembly routines I've seen don't have very good
> timing due to the duration being the same number of cycles for all piches,=

> so that C1 with a duration of X play twice as long as C2 with the same
> duration.
>
> ] SIMON D WILLIAMS =3D
> LUDDITE'S CAVE BBS =3D telnet://ld8.org
> APPLE II WEBSERVER =3Dhttp://ld8.org:6502
> 8-BIT SOUND & FURY =3Dhttp://8bitsoundandfury.ld8.org

How I wrote it is basically a scaling algorithm. The actual duration
(that is so say the length of the note) is constant, and relative to
the length of the other notes in the song. Therefore the duration is
relatively precise.

However, the clicking of the speaker is what I scale... the greater
number of clicks in a specified period, the higher the note.

So since the inverse holds true given a constant interval of 1 second,
clicking the speaker 36 times during that interval will give a lower
ratio of clicks with a higher proportion of time (in a timing loop)
between clicks, and thereby make a lower pitched sound.

Best go download the working examples and see "how they run..." in an
emulator...

Here's a disk image of samples...

http://www.clipshop.ca/DiskImages/Samples.zip

Here's some real apps using the same routines...

http://www.clipshop.ca/DiskImages/index.htm

Bill
--- SBBSecho 2.12-Win32
* Origin: Derby City BBS - Louisville, KY - derbycitybbs.com (1:2320/100)
SEEN-BY: 10/1 3 14/300 34/999 90/1 106/1 120/228 123/500 134/10 140/1 222/2
SEEN-BY: 226/0 236/150 249/303 261/20 38 100 1404 1406 1410 1418 266/1413
SEEN-BY: 280/1027 320/119 393/11 396/45 633/260 267 712/848 800/432 801/161
SEEN-BY: 801/189 2222/700 2320/100 105 200 2905/0
@PATH: 2320/100 261/38 633/260 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.