[comp.sys.apple] cassette click

dkonerding@eagle.wesleyan.edu (10/23/89)

	Hello, folks.  I sense the UPS man approaching with my IBM clone; it's
a matter of days.  I'm trying to cram all the work I always wanted to do into
about 72 hours.  One thing I'm doing to trying to get a check the cassette in
byte and see if there's sound coming in,and if so, click the speaker-- in
effect, making the Apple speaker sound like whatever my tape is playing.  I
know that people have taped their voices and played them back with the Apple,
the following program won't do the first job I mentioned:
LDA C060 (or whatever the cassette-in byte is)
CMP #A0 (160 seems to equal "no sound")
BNE TOP
BIT C030... all this does is click the speaker when sound is coming in, no
pitch, nothing.  How can I get this to work?

	Thanks.

-- 
	Remember, while having sex, always, always wear a condiment.
DKONERDING@EAGLE.WESLEYAN.EDU
DKONERDING%EAGLE@WESLEYAN.BITNET

jb10320@uxa.cso.uiuc.edu (Jawaid Bazyar) (10/24/89)

In article <2390@eagle.wesleyan.edu> dkonerding@eagle.wesleyan.edu writes:
>
>	Hello, folks.  I sense the UPS man approaching with my IBM clone; it's
>a matter of days.  I'm trying to cram all the work I always wanted to do into
>about 72 hours.  One thing I'm doing to trying to get a check the cassette in
>byte and see if there's sound coming in,and if so, click the speaker-- in
>effect, making the Apple speaker sound like whatever my tape is playing.  I
>know that people have taped their voices and played them back with the Apple,
>the following program won't do the first job I mentioned:
>LDA C060 (or whatever the cassette-in byte is)
>CMP #A0 (160 seems to equal "no sound")
>BNE TOP
>BIT C030... all this does is click the speaker when sound is coming in, no
>pitch, nothing.  How can I get this to work?
>
>	Thanks.
>
>-- 
>	Remember, while having sex, always, always wear a condiment.
>DKONERDING@EAGLE.WESLEYAN.EDU
>DKONERDING%EAGLE@WESLEYAN.BITNET

   As far as I remember, only one bit in the C060 (or whatever) cassette-in
port is actually functional. I assume this is the high bit (7 or 8 for those
of you who prefer).  What you really need to check for is something like this:
LDA C060
BPL TOP
BIT C030
BRA TOP

   In addition, you might need to put some sort of delay in this loop,
as this loop executes at around 100,000 times per second, far faster than
the resolution of the speaker and sound hardware on the //e.
   Alas, I have only a GS with no cassette port to test my ideas.

--
===============================================================================
jawaid bazyar    jb10320@uxa.cso.uiuc.edu  Junior/Computer Engineering UIUC

Seepage from deep,black,brittle experiments which failed and transformations too
hard to find. "I was overcome and turned to Red." Duster's dust became the sale.
Lucifer the light. A restless motion came to move and then subside. In endless
knocking at the door- it's time. TYRANNY & MVTATION. TYRANNY & MVTATION.

throoph@jacobs.CS.ORST.EDU (Henry Throop) (10/24/89)

In article <2390@eagle.wesleyan.edu> dkonerding@eagle.wesleyan.edu writes:
>
>	Hello, folks.  I sense the UPS man approaching with my IBM clone; it's
>a matter of days.  I'm trying to cram all the work I always wanted to do into
>about 72 hours.  One thing I'm doing to trying to get a check the cassette in
>byte and see if there's sound coming in,and if so, click the speaker-- in
>effect, making the Apple speaker sound like whatever my tape is playing.  I
>know that people have taped their voices and played them back with the Apple,
>the following program won't do the first job I mentioned:
>LDA C060 (or whatever the cassette-in byte is)
>CMP #A0 (160 seems to equal "no sound")
>BNE TOP
>BIT C030... all this does is click the speaker when sound is coming in, no
>pitch, nothing.  How can I get this to work?

I don't have a cassette port to try it on, but this program, lifted from Feb.
89 A2-Central, which stole it in turn from November 82 Apple Assembly Line,
might work:

6000: A0 1E	ldy #$1e	;150 uSec delay by counting down
6002: 88	dey
6003: D0 FD	bne $6002
6005: AD 60 C0  lda $c060	;get cassette input
6008: 45 2F	eor $2f		;compare it to LAST
600A: 10 F4	bpl $6000	;if no change, restart
600C: 45 2F	eor $2f      	;input changed, so fix A
600e: 85 2F	sta $2f		;save LAST
6010: AD 30 C0  lda $c030 	;wham speaker
6013: 4C 00 60  jmp $6000  	;restart

Henry

>DKONERDING@EAGLE.WESLEYAN.EDU
>DKONERDING%EAGLE@WESLEYAN.BITNET


---
Henry Throop
Internet: throoph@jacobs.cs.orst.edu

DANFUZZ@BROWNVM.BROWN.EDU (Dan Bornstein) (10/25/89)

>Re: cassette click
>From:         Jawaid Bazyar
>              <brutus.cs.uiuc.edu!wuarchive!uwm.edu!ux1.cso.uiuc.edu!uxa.cso
>              .uiuc.edu!jb10320@APPLE.COM>
>
>In article <2390@eagle.wesleyan.edu> dkonerding@eagle.wesleyan.edu writes:
>>... One thing I'm doing to trying to get a check the cassette in
>>byte and see if there's sound coming in,and if so, click the speaker-- in
>>effect, making the Apple speaker sound like whatever my tape is playing.  I
>>know that people have taped their voices and played them back with the Apple,
>   As far as I remember, only one bit in the C060 (or whatever) cassette-in
>port is actually functional. I assume this is the high bit (7 or 8 for those
>of you who prefer).  What you really need to check for is something like this:
>LDA C060
>BPL TOP
>BIT C030
>BRA TOP
>
>   In addition, you might need to put some sort of delay in this loop,
>as this loop executes at around 100,000 times per second, far faster than
>the resolution of the speaker and sound hardware on the //e.

Not quite; The way the cassette port works is *not* to toggle hi/low for
each click but rather to just do one change (low to high or vice versa),
so the program should look like this (no extra delay necessary):

300: BIT C060
303: BPL 300
305: BIT C030
308: BIT C060
30B: BPL 308
30D: BIT C030
30F: JMP 300

This should click whenever the state of the cassette port changes.
If you're interested in actual digitizing, I wrote a program a while
ago (when I still had an Apple ][ (not ][+,e,etc.) called "Reel To Reel".
If you can't find it locally, mail me and I'll try to get it packed and
upload it (the last time I uploaded from an Apple was pre-shrinkit, so
I may have to get that first; it may take me a while, seeing as I'm in
the midst of midterms.) Mail me if you're interested.


-dan

Bitnet:    danfuzz@brownvm
Internet:  danfuzz@brownvm.brown.edu
AppleTalk: Find me a long enough cable and I'll see what we can do.

dlyons@Apple.COM (David Lyons) (10/27/89)

In article <8910251156.aa16257@SMOKE.BRL.MIL> DANFUZZ@BROWNVM.BROWN.EDU (Dan Bornstein) writes:
>[...]
>300: BIT C060
>303: BPL 300
>305: BIT C030
>308: BIT C060
>30B: BPL 308
      ^^^
>30D: BIT C030
>30F: JMP 300
>
>This should click whenever the state of the cassette port changes.
[...]

Shouldn't one of the BPLs be a BMI?  (Doesn't matter which one, but you
want to be stuck in *one* of the little loops while bit 7 of $C060 is
0, and in the other little loop when bit 7 is 1.)
-- 

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   America Online: Dave Lyons                |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.