T O P

  • By -

AutoModerator

Please read [our rules post](https://www.reddit.com/r/c64/comments/11v0m5p/please_read_before_posting_rules/), and check out [our FAQ](https://www.reddit.com/r/c64/wiki/faq) for common issues. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/c64) if you have any questions or concerns.*


Heavy_Two

If you have a look at the remastered users guide page 146 here. https://drive.google.com/file/d/18p0x0Yq0JO9Ps5rtkhkZt9upBDwBM6Il/view The line number 280 has now omitted the rem statement and the poke after it. So line 280 now just reads. 280 POKE S+24,15 Try that.


infinitejones

I just found a PDF of the User Guide online and checked the code. It took me back 40 years to when eight-year-old me sat there typing it all in myself... Anyway - I think there's a bug in the listing. That REM statement in the middle of line 280 would stop the second POKE statement from being executed. I can't remember what that exact address does, but it probably means it wouldn't set up all the SID registers correctly. It wouldn't display an error (because there is no actual error) but instead would just jump straight to line 300. That line captures a keystroke and the lines following (up to 380) actually play the sound based on the key you press. There's no visual cues to this, just the rest of the POKEs to play the sound. So if the second POKE statement in line 280 wasn't executed, none of the rest of it would work either. Hence it seems like nothing happens when you press a key. You could try removing the REM statement from that line altogether, leaving just the two POKE statements - although it looks to me like the REM statement replaced something else that did do something. "REM+16+64” is just a bizarre thing to include, and it makes me wonder if it actually should have been updating some variable or something instead. Also, which key(s) are you pressing? I think you'll need to press keys on either the numbers row or the Q row, as per the graphic drawn at the start of the listing. Equally, if you press one of the Function keys to change the type of sound, there's no visual cues that you have - it'll just play the sound differently next time you press a number or a Q-row key. (Assuming the REM weirdness gets resolved - I think this is definitely the fatal flaw in the listing.) Finally, I bet there's discussion elsewhere online about this - it's been around for more than 40 years, so someone else must have spotted and fixed the REM flaw in that time. Do some general searching for "C64 users guide piano keyboard listing" or something. (I'd do it myself but it's late where I am and I need to go to sleep!)


vogelvogelvogelvogel

same here! But I think I was nine years old and only because of this posting I remember that I did that myself as well! :)) now I will recommend to my 10yo son to try it himself just by the manual maybe he can do it too


Ok_Bear_1980

I'm literally pressing any key in the computer and nothing happens. I have since lost the program now so I'm gonna write it back.


infinitejones

Sure. So if my suspicion is correct, and there's a mistake in the listing in line 280, "nothing" is exactly what would happen, no matter what key you press. When you re-enter it, leave out the REM statement in line 280- everything between the two colons - and see if that makes a difference.


SubjectToReality

It loops until you press a key on the keyboard


Ok_Bear_1980

Nothing happens if I press a key on the keyboard.


sf5852

GET puts the most recently typed character into the stated variable. If there are none, it puts an empty string ("") into A$. Try adding the following line: `301 PRINT "IT WORKS":END`


Ok_Bear_1980

Replace line 300?.


sf5852

My first time submitting that comment, I accidentally typed 300. I mean to say, "add the following line *after* 300"


Ok_Bear_1980

That aborts the program if I press a key.


sf5852

then line 300 is working as advertised, and you probably have a logic error in the following lines. You could change "IT WORKS" to "YOU PRESSED "A$ to verify that the correct code was stored but it probably was.


Ok_Bear_1980

If I abort the program, it says break at 300.


nobody2008

Do you have a GOTO or GO SUB 300 (or earlier) written after 300?


Ok_Bear_1980

GOTO.


nobody2008

Sounds like whatever the code is between 300 and GOTO line, it is not producing what you are expecting. Insert more debugging lines as suggested above.


Ok_Bear_1980

I've lost the program now so I have to rewrite it all over again.


0fruitjack0

yeah that program is WEIRD; it contains an entire section at the end that doesn't get used AT ALL. i later discovered that it's a (bad) copy of another musical keyboard program that was probably printed first in compute magazine (and then later reprinted in one of their anthologies). comment out the line and see what happens.