Jump to content
IGNORED

PR#3 and War Games


newTIboyRob

Recommended Posts

So I watched War Games for the umpteenth time again, and there will likely be umpteenth more. I've always wanted a monitor to duplicate the color and sounds created when David types on the keyboard, e.g. when he types his reply to GREETINGS PROFESSOR FALKEN. I am aware that the computer sounds used in the actual movie were done in post production, but I'm looking to see if I can get something close to those typing sounds regardless.

 

I recently got my 2c fixed and remembered the PR#3 command to get to the 80 column. I've also been able to simulate the blue screen font as well. So visually, right there and 2 out of 3 ain't bad...

 

But what's missing are those typing sounds. Does anyone know if it's possible to get similiar sounds when typing on a 2c?  A longshot, but I was thinking through some kind of command like CALL or the like in some kind of combination so when you type, you hear a flurry of similar to the movie sounds?

 

This would be fascinating to me to see if anyone can come up with something like that in a basic program. As a refresher, just rewatch that scene when he first shows her the "talking box" and you will see what I mean about those typing sounds heard both when he is asked questions by the professor and when he replies. 

  • Like 1
Link to comment
Share on other sites

On 7/27/2023 at 9:06 AM, newTIboyRob said:

I am talking about the keyboard typing sounds, not the speaker box simulated professor sound.

It would be possible to "hook" the Keyboard Routine to Click the Speaker..   

 

This would Slow Down the Response a bit, because you would need to make an Audible Click before returning the Control to BASIC or your application...

 

MarkO

  • Like 1
Link to comment
Share on other sites

15 hours ago, newTIboyRob said:

Hi MarkO.  So would that be a hard thing to do?  Is that an inner hardware hack you are mentioning or some program lines I could incorporate into a BASIC program?

Could you elaborate and tell me what I should try?

Thanks!

First would be making the Click Sound routine, then Hooking the Character Input Routine or Character Output Routine to "invoke" the Click each time..   

 

The Character Output is Vectored to DOS, so that the Apple DOS Command are seen before the BASIC Commands....

 

Many Machine Language Programs, bypass any ROM Routines to read the Keyboard and Directly Read the Keyboard Strobe and Incoming Character..

 

As long as your writing your Own Programs, you could build in the Click yourself..

 

 

Did you want to have the Click, All the Time, no matter what your doing on the Apple ][, or only in Certain Programs or.....

 

MarkO

Link to comment
Share on other sites

Hi Mark. To be honest, I couldn't follow what you were saying above for the most part.  I would be writing my own basic programs, but I was hoping to get the click sound, actually it sounds more like a cluster of "data" sounds rather than just a single click sound, to occur within the program. Just like in WarGames, if you take a listen. For example, I make a program that requires the user to input his name.... so when you run the program, you will see "HELLO, WHAT IS YOUR NAME?"  and also, simultatenously, hear the Wargames aforementioned clicking sound. Then, that same clicking sound remaining while the user types in the name and the sound occurring when the next inputtable question is asked, and answer typed, and so on. I also wouldn't mind that sound cluster to occur while I am typing in the program itself.

 

Could you give me an idea in a basic program?:

 

10 HOME

20  INPUT "WHAT IS YOUR NAME"; NAME$

30 REM HERE IS WHERE I DON"T KNOW THE REST!

 

 

Link to comment
Share on other sites

On 7/30/2023 at 1:11 PM, newTIboyRob said:

Hi Mark. To be honest, I couldn't follow what you were saying above for the most part.  I would be writing my own basic programs, but I was hoping to get the click sound, actually it sounds more like a cluster of "data" sounds rather than just a single click sound, to occur within the program. Just like in WarGames, if you take a listen. For example, I make a program that requires the user to input his name.... so when you run the program, you will see "HELLO, WHAT IS YOUR NAME?"  and also, simultatenously, hear the Wargames aforementioned clicking sound. Then, that same clicking sound remaining while the user types in the name and the sound occurring when the next inputtable question is asked, and answer typed, and so on. I also wouldn't mind that sound cluster to occur while I am typing in the program itself.

 

Could you give me an idea in a basic program?:

 

10 HOME

20  INPUT "WHAT IS YOUR NAME"; NAME$

30 REM HERE IS WHERE I DON"T KNOW THE REST!

 

 

Sorry for the Delay...

 

When your making your own program, like the example above, you can customize the Input Routine so that it, make sound when you type....

 

This would be a Machine Language routine that Reads the Key Input and generates the sound when a key is pressed...

 

After you press the RETURN key, the Characters are transferred to a String..


As I recall, there is a Keyboard Read routine in Assembly Lines, and possiblity a Sound Routine..

https://www.apple.asimov.net/documentation/programming/6502assembly/Assembly Lines Complete.pdf

 

I can try to pull those two things together to make you something for a sample..

 

It has been a very long time since I watched War Games..   Can you post an Audio Clip with the Sounds your looking for?

 

MarkO

 

Link to comment
Share on other sites

This is something I did back in High School (1986),  I created a routine to create a 'click' sound when printing each character to the screen that is viewable (i.e. not a space):

 

450 VTAB V: HTAB H: FOR A = 1 TO LEN(MG$): AA$ = MID$(MG$,A,1): INVERSE: HTAB H + (A - 1): PRINT AA$;: PRINT CHR$(8);: IF AA$ = CHR$(32) THEN 470
460 QQ = PEEK(49200): REM THIS JUST CLICKS THE SPEAKER ONCE
470 NORMAL: HTAB H + (A - 1): PRINT AA$;: NEXT : RETURN

 

This way, you put whatever string you want to print in MG$, the vertical position in V and the horizontal position in H and I believe it will give you the effect you are looking for.

Using your example:

 

10 HOME
20 MG$ = "WHAT IS YOUR NAME": V = 10: H = 2: GOSUB 450
30 VTAB V: HTAB H + LEN(MG$): INPUT NAME$

 

I hope this helps!

Bob

 

P.S. - There was a reason I did two separate 'PRINT' statements in line 450 for the AA$ and the backspace (CHR$(8))...  I just can't remember why that was.

Edited by PacManPlus
Added P.S.
Link to comment
Share on other sites

Hello Bob, so I typed in the program, verbatim, and came so close!  Here is the exact result. I double checked myself for typos:

 

WHAT IS YOUR NAME?  [cool how it spread all those words out with that sound!]

 

[I typed in ROB right next to that prompt]

 

...But then it printed out that same WHAT IS YOUR NAME? ROB line, right over the first line, (as if it simply returned to the beginning of that line), while simultaneously making the sound, with the same cursor-spreading-out-through-the-line-concept, but once it got to the "?" and before running over the word "ROB, on the next line appeared:

?RETURN WITHOUT GOSUB ERROR IN 470

 

...So did I miss something?  Also, that click is kind of cool, but is there a more cheery "bell" like sound or a more cheery sound we could substitute for that speaker click (again, something closer to the sound in Wargames.)

Then I think we will, actually, you, will have solved the puzzle :)

Link to comment
Share on other sites

Hmmm... for some reason I wasn't alerted to replies in this thread, even though I marked it to 'follow topic'. 😕 

 

Yes, thank you nick3092...  I (incorrectly) assumed there would be more to the program so I didn't include the 'END' statement.

 

Quote

Also, that click is kind of cool, but is there a more cheery "bell" like sound or a more cheery sound we could substitute for that speaker click (again, something closer to the sound in Wargames.)

 

Not if you want it to take forever to display a string. :(  IIRC, I don't know of another way of doing this with a different sound, as that speaker click is the shortest duration; anything else will just make it take longer to run.

Edited by PacManPlus
Link to comment
Share on other sites

Yes, thank you Nick, and Bob. Tried it and it worked.  Now all I'd ike to do is make a few simple changes:

 

1) This one rather easy. How do I get the cursor to move over 1 more space to the right after the ? in line 10?  If the semi colon just means "keep us on this line" and I tried with " ".. I've been close, but I keep getting something I am not looking for here. 

Desired:  WHAT IS YOUR NAME? X     [...not WHAT IS YOUR NAME?X]

 

2) I wouldn't mind it taking longer to display a string. I was wondering if we could use that BELL sound as heard with a SYNTAX ERROR? It looks like CHR$(7), but I am not sure it is something that can be PEEKed in there, as in line 460, or how to work that sound in, if it's possible? Maybe there still is a different sound that is a bit longer duration. I would think that there's gotta be some sound or combo of sounds still!

Maybe someone else reading this can come up with another sound?

 

3) I just want to take this program one final step, though it's a little more involved.  How about making the program interactive, a la David's "convo" with the professor. So I've been trying to get it so it also results the same sound effect concept when additional questions from the professor are asked, like for the following line I added.  (Here is where I get stuck. It's gotta be a GOTO or a subroutine or another subroutine or the like to repeat the sound concept while the the string is printing again, but every time I tried, SYNTAX ERROR et al.)

 

35 ?:?"Hello,";NAME$".";" How are things going";:INPUT HOW$

 

[my reply:  FINE]


 

And then this pattern of questioning and answering while the sound clicks while the professor's next question spews out, and so on and so forth.

 

I had saved this program as WARGAMES... but I should really call it BOBnNICK!

 

All in all though, as simple a thing in life as this is, I still find in rather cool.

 

 

Link to comment
Share on other sites

Answering your questions above:

 

1 - To push the cursor over 1 character, just add a space to the end of the MG$.  I.e. instead of MG$ = "WHAT IS YOUR NAME?" use MG$ = "WHAT IS YOUR NAME? " (notice the space after the question mark but before the end quote).  Then, if you use INPUT "";NAME$ it will not print an additional question mark when asking for your input.

2 - Using the system bell after each character will get annoying VERY fast.  I think the click is the best you are going to get...

3 - For every message you want to display, you just need to keep calling the 450 subroutine after changing the MG$, V, and H.

 

For instance:

10 HOME
20 MG$ = "WHAT IS YOUR NAME? ": V = 10: H = 2: GOSUB 450
30 INPUT "";NAME$
40 V = V + 1: MG$ = "HELLO, " + NAME$ + ".  HOW ARE THINGS GOING? "
50 INPUT "";GOING$

...AND SO ON

400 END
450 VTAB V: HTAB H: FOR A = 1 TO LEN(MG$): AA$ = MID$(MG$,A,1): INVERSE: HTAB H + (A - 1): PRINT AA$;: PRINT CHR$(8);: IF AA$ = CHR$(32) THEN 470
460 QQ = PEEK(49200): REM THIS JUST CLICKS THE SPEAKER ONCE
470 NORMAL: HTAB H + (A - 1): PRINT AA$;: NEXT : RETURN

 

I hope this helps.

Bob

Edited by PacManPlus
Link to comment
Share on other sites

1 hour ago, PacManPlus said:

3 - For every message you want to display, you just need to keep calling the 450 subroutine after changing the MG$, V, and H.

That's the beauty of a subroutine. It just keeps applying the same "effect" (in this case) over and over and over. You just pass new values using the variable(s), and it just keeps repeating the process. Otherwise you would have a bloated program with repeated code.

 

Anytime you have to do the exact same thing in code multiple times, but with different values, a subroutine is the answer. 

Edited by nick3092
Link to comment
Share on other sites

RE:

 

1)... Success in moving the cursor over.

2)  Ok, click only it is. I will take your word for it otherwise :)

3) Typing the program verbatim, lines 10-50  (no more lines 'til those typing in those finishing 4 lines of the program) yielded:

WHAT IS YOUR NAME?  ROB

^

|

[the arrow here pointing to a blinking cursor, with no program continuation from line 40 and onward.]

 

...?  What did I do wrong?

 

and 4) one more adjustment: Once that is fixed, we will have the continual question answer convo, but I still couldn't figure out how to make line 40, when it works, to also have the sound in the string. What I was aiming for is a line with the clicks (the first one asking for name is working perfectly) but then after entering a name, to then have the sound in all subsequent questions.

 

How are things going?  (sound throughout the line as in the what is your name question), etc.

 

Once all above is resolved, I will go ahead and try to add more conversation lines, and try to see what you did with the counter concept, etc.  :)

 

 

Link to comment
Share on other sites

On 8/1/2023 at 9:43 PM, newTIboyRob said:

You can hear the sound I am looking for in the You Tube clip: David Discovers A List of Games.

As the computer is spitting out the information on the screen, best heard as the flight information is displayed. Notice the computer's sound in the background.

 

On Text Output...

 

It almost sounds like the Multi-Tone sound of a Touch Tone phone sound..

 

MarkO

Link to comment
Share on other sites

On 8/1/2023 at 9:43 PM, newTIboyRob said:

You can hear the sound I am looking for in the You Tube clip: David Discovers A List of Games.

As the computer is spitting out the information on the screen, best heard as the flight information is displayed. Notice the computer's sound in the background.

A Machine Language routine might get a closer sound to this sample than just the PEEK from BASIC..

 

MarkO

Link to comment
Share on other sites

Ok thank you everyone. Yes, MarkO that is very very very close to the sound, pretty much is it, but I was trying to get that sound in the BASIC program.

 

Bob, I want to thank you very much for taking the time, sharing your knowledge and expertise, offering your great program, and being patient while answering all of my questions.

I want you to know that I appreciate what you've done here very much.

 

With my basic knowledge, no pun intended, I really don't know how to do what you said, namely writing your own input routine and hooking into the keypress routine, but I will try to study what you've done thus far and maybe I c figure out how to incorporate that into what we already have.

 

Thanks again

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...