[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Musical Playback In Aztec C
On Apr 15, 4:12 pm, "Simon D. Williams" <bb...@chebucto.ns.ca> 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 =
> LUDDITE'S CAVE BBS = telnet://ld8.org
> APPLE II WEBSERVER =http://ld8.org:6502
> 8-BIT SOUND & FURY =http://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