6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed May 08, 2024 2:15 pm

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
PostPosted: Thu Jul 06, 2000 5:47 pm 
I'd like to learn of different timing techniques for generating different "voices", or instraments, on the Apple II by using the softswitch $C030. I want to be able to create a base program that can sound from the data of whatever voice I create. I'm also interested in the ability of mixing voices, and controling volume.


Report this post
Top
  
Reply with quote  
PostPosted: Thu Jul 06, 2000 9:43 pm 
Offline

Joined: Fri Aug 30, 2002 3:06 pm
Posts: 124
Location: Colorado
What is "softswitch $C030"?

Do you want to generate voices in software? If so, the 6502 in an Apple probably isn't fast enough to do anything but very simple waveforms.
Note that PC sound cards have dedicated hardware (like the Yamaha chip) to do interesting waveforms.

Pete


Report this post
Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 07, 2000 9:45 pm 
Offline

Joined: Wed Mar 24, 2004 6:32 pm
Posts: 59
Location: Bay Area, CA
The Apple II has about the same level of audio as a PC without a sound card, except without as much CPU to drive it.

The Apple IIgs is a completely different beast, mind you...

The methodology for creating a sound is available at
http://www.qzx.com/pc-gpe/speaker.txt

That's for a PC, but you should be able to adapt it to an Apple II.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 11, 2000 11:27 pm 
>What is "softswitch $C030"?

On the Apple II, this is the address you access to toggle the polarity of the speaker. Every other time you access this "softswitch", you should hear a click.

>Do you want to generate voices in software?

Yes.

>If so, the 6502 in an Apple probably isn't fast enough to do
>anything but very simple waveforms. Note that PC sound cards
>have dedicated hardware (like the Yamaha chip) to do interesting
>waveforms.

Have you ever looked at GraFORTH for the Apple? It has a program that will play different voices. Too bad it only plays them one at a time. After I heard "Sonata" being played (from the disk: Apple at Play), I knew this was what I wanted to learn how to do.


Report this post
Top
  
Reply with quote  
PostPosted: Tue Jul 11, 2000 11:33 pm 
>The Apple II has about the same level of audio as a PC without
>a sound card, except without as much CPU to drive it.

Yeah, I know Apple II's sound isn't as good as any of the other computers, but it can do some pretty neat things.

>The Apple IIgs is a completely different beast, mind you...

I know. I want to do this on 8-bit Apple II's

>The methodology for creating a sound is available at
>http://www.qzx.com/pc-gpe/speaker.txt
>
>That's for a PC, but you should be able to adapt it to an Apple II.

Thanks. That helps some. This confirms my ideas for volume control. I think my biggest confusion is on exactly how to feed a sound wave through the speaker. A series of tones is all I can think of.

If I remember correctly, this is how a sound wave looks.

000 -high- 000 --
0 0 0 0 |
0-----0-----0-----0-----0 |Volume
0 0 0 0 |
| 000 -low- 000 --
| |
|<--Pitch-->|

And this is my idea of how it's done.

2 2
1 1
Base Pitch--> 0-------- 0-------- 0
-1 -1
-2-2

So if I wanted to play this wave form at the pitch of 7, then I play the tones 7,8,9,9,8,7,6,5,5,6,7, where each of the tones have the same length.

I've also thought about interleaving the base pitch with the wave, like this.

(2) (2)
(1) (1)
Base Pitch--> (0)-0-----0-----0-----0-----0-(0)-0-----0----0----0----0-(0)
(-1) (-1)
(-2) (-2)

Well, I'm getting tired of guessing at this. I need something that I know will work.


Report this post
Top
  
Reply with quote  
PostPosted: Thu Jul 13, 2000 7:26 pm 
I'm not familiar with the GraFORTH application you mention, but from WAY BACK WHEN the Apple II was still king, there was a really neat little assembly language program called BACH which played tone-based music. It was so named because it "played with both hands" -- that is, it had two tone voices instead of just one. Each voice played from a table of tone-duration information that represented the sheet music. There was no volume control capability because the Apple II's speaker was simply "on" (current flowing, speaker cone deflected) or "off" (no current flowing, speaker cone in rest position), though this defect was hardly noticeable. It sounded a lot like the dual-tone melody IC's you see in a lot of toys and greeting cards these days.

There was also a neat program which used a very simple amplifier circuit connected to the game port and allowed you to "record" sounds by timing the sounds' zero-crossings. During playback, you just wrote to $C030 in the same time pattern as the zero crossing were detected and presto, you got fairly recognizable human speech out of a computer with no sound card! Not on par with a 16-bit 44-KHz SoundBlaster, but useable.

I have the executable (binary) file and source code for BACH if you think it might be interesting to you. I don't have the source code for the other program, but I could describe the workings of the hardware and software in more detail. Just post a reply to this message or shoot me a direct E-mail and I'll reply within a few days.

-- Brian Farley


Report this post
Top
  
Reply with quote  
PostPosted: Tue Jul 18, 2000 7:58 pm 
Sorry for the delay in my responce. Yes, I'm interested in the listing of BACH. Thank you.

As far as direct recording and playback through the cassette jacks, I already have a Basic / Machine Language program that can do that. I have to admit, it is rather impressive. It's called "Sound Digitizer". I typed it in from InCider magazine, July 1988, p90 (for those reading who actually have old Apple mags, like me). Let me know if you want the listing.

Also, if you're interested, I can send you the player file and the Sonata data file from the disk "Apple at Play". This is the one that actually plays an "instrament" more then 1 note at a time. I plan to dissect the player file, in a week or so, to try and figure out how it works.

I'm still interested in more feedback, if anyone still has more to contribute. Thanks everyone!


Report this post
Top
  
Reply with quote  
PostPosted: Sun Jul 23, 2000 3:54 pm 
I have the source and executables for volume control and 2 voice sound on the Apple II. Volume doesn't work that good, but 2 voices sounds good.

I also have the source and executables for recording/playing through the cassette ports, along with playing backwards digitized sounds.

Rich

aiiadict@hotmail.com


Report this post
Top
  
Reply with quote  
PostPosted: Thu Jul 27, 2000 5:24 pm 
Thanks for replying to my Apple II sound thread. I am
interested in the programs. Thank you.
E-mail me at <eriknoc@collegeclub.com>
or visit my website at http://home.collegeclub.com/eriknoc


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: