Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - thelowerrhythm

Pages: [1]
1
QB64 Discussion / Re: Need basic help (pun intended)
« on: June 05, 2020, 08:38:58 pm »
I'm nowhere even near being a novice, so there's that. It's doing what it is supposed to do for you, but it only happens for me at higher cycle rates (=slower sequences). When it's sped up a keypress doesn't end the sound, and when the software restarts its still playing. Not sure why the different cycle speeds would make a difference. Maybe when it's going really fast it isn't pausing to see if its supposed to stop? I don't even know if that makes sense.

2
QB64 Discussion / Need basic help (pun intended)
« on: June 05, 2020, 06:21:16 pm »
Beginner here, messing around with this simple sequencer. I first posted about not being able to get the sound to stop at the end (after key press), and I *sort of* figured that out. However, it only works when the cycle rate (variable R) is high (slow) enough. For example, it works as intended when cycle rate is 8, but not when .1.

Code: QB64: [Select]
  1.  
  2. 1 CLS
  3. COLOR 10, 0
  4. 2 PRINT "±±±±± ²²²²²² °°°°°°"
  5. 3 PRINT "±     ²    ² °"
  6. 4 PRINT "±±±±± ²    ² °°°°°°"
  7. 5 PRINT "    ± ²  ² ²      °"
  8. 6 PRINT "±±±±± ²²²²²² °°°°°°"
  9. COLOR 11, 0
  10. PRINT "8 step waveform generator for toned sequences"
  11. PRINT "or drones at faster speeds (lower cycle)."
  12. PRINT "Input frequencies in Hz from 40 - 16000."
  13. PRINT "Press any key to stop sequence."
  14. COLOR 1, 0
  15. 7 INPUT "FREQ A: ", S1
  16. 8 IF S1 < 40 OR S1 > 16000 THEN GOTO 4
  17. COLOR 2, 0
  18. 10 INPUT "FREQ B: ", S2
  19.  
  20. 11 IF S2 < 40 OR S2 > 16000 THEN GOTO 10
  21. COLOR 3, 0
  22. 16 INPUT "FREQ C: ", S3
  23. 17 IF S3 < 40 OR S3 > 16000 THEN GOTO 16
  24. COLOR 4, 0
  25. 22 INPUT "FREQ D: ", S4
  26. 23 IF S4 < 40 OR S4 > 16000 THEN GOTO 22
  27. COLOR 5, 0
  28. 28 INPUT "FREQ E: ", S5
  29. 29 IF S5 < 40 OR S5 > 16000 THEN GOTO 28
  30. COLOR 6, 0
  31. 32 INPUT "FREQ F: ", S6
  32. 33 IF S6 < 40 OR S6 > 16000 THEN GOTO 32
  33. COLOR 7, 0
  34. 36 INPUT "FREQ G: ", S7
  35. 37 IF S7 < 40 OR S7 > 16000 THEN GOTO 36
  36. COLOR 8, 0
  37. 39 INPUT "FREQ H: ", S8
  38. 41 IF S8 < 40 OR S8 > 16000 THEN GOTO 39
  39. COLOR 9, 0
  40. INPUT "CYCLE RATE(.023+): ", R
  41.     LET k$ = INKEY$
  42.     SOUND S1, R
  43.     COLOR 1, 0
  44.     PRINT "Generating Tone A"
  45.     SOUND S2, R
  46.     COLOR 2, 0
  47.     PRINT "Generating Tone B"
  48.     SOUND S3, R
  49.     COLOR 3, 0
  50.     PRINT "Generating Tone C"
  51.     SOUND S4, R
  52.     COLOR 4, 0
  53.     PRINT "Generating Tone D"
  54.     SOUND S5, R
  55.     COLOR 5, 0
  56.     PRINT "Generating Tone E"
  57.     SOUND S6, R
  58.     COLOR 6, 0
  59.     PRINT "Generating Tone F"
  60.     SOUND S7, R
  61.     COLOR 7, 0
  62.     PRINT "Generating Tone G"
  63.     SOUND S8, R
  64.     COLOR 8, 0
  65.     PRINT "Generating Tone H"
  66.  
  67. LOOP UNTIL k$ <> ""
  68. X = 1
  69. IF X = 1 THEN SOUND 0, 0
  70. INPUT "Enter Q / q to EXIT, anything else to RESTART: ", I$
  71.     CASE "Q"
  72.         GOTO 666
  73.     CASE "q"
  74.         GOTO 666
  75.  
  76. 666 END
  77.  
  78.  
  79.  
  80.  
  81.  

3
QB64 Discussion / Re: basic counter question
« on: June 13, 2019, 01:15:53 pm »
Thanks! After playing around with it a bit I got it to work and think I've got a solid grasp on why it works, too. :)

4
QB64 Discussion / basic counter question
« on: June 13, 2019, 02:28:33 am »
Greetings! Hoping someone can give me a hand with this. Haven't touched code more than a couple of times in a few decades and can't figure out how to add a timer to this that counts 1 for every second the program is active and set a variable to that value. The idea is to print said amount of seconds to the file as the program completes. Right now I'm doing it a really stupid way, essentially capturing the time as the program starts as X$ and then printing that in addition to the current TIME$ at the end. Not really ideal. :P

Thanks for taking pity on me. For some reason I've got the bug to try and learn some things I never quite got to way back when,

Code: QB64: [Select]
  1. X$ = TIME$
  2.  
  3. PRINT "Follow the instructions below..."
  4.  
  5. INPUT "Enter your name: ", n$
  6.  
  7. OPEN "File.txt" FOR OUTPUT AS #1
  8. PRINT #1, "FILE CONTENTS"
  9. PRINT #1,
  10. PRINT #1, "Date              : "; DATE$
  11. PRINT #1, "Time Started      : "; X$
  12. PRINT #1, "Time of Completion: "; TIME$
  13. PRINT #1,
  14. PRINT #1, n$; " has completed the exercise."
  15. PRINT #1, ""
  16. PRINT #1, "Congratulations, you did the thing."
  17.  
  18.  
  19. PRINT "File has been written."
  20.  
  21.  

5
QB64 Discussion / Re: background color shenanigans
« on: August 27, 2018, 02:01:52 pm »
Actually it worked nearly immediately, so that's cool. I bow before your wisdom. A simple thing, but I'll take it a long way.

6
QB64 Discussion / Re: background color shenanigans
« on: August 27, 2018, 01:51:30 pm »
Thanks everyone. I think I've learned more from this forum in a week than a few months reading BASIC books back in the day. Knowing why it is doing what it is doing really helps.

I solved the scrolling issue this morning using the WIDTH command. Set it to 80, 25, which I think is the original default for Screen 0. That seems to maintain it. The semi-colon thing works in its own right... I still want to be able to get it to go vertically, but this is an interesting way of printing the information as well.

I'll work on implementing that last suggestion sometime today or tomorrow! :D

7
QB64 Discussion / Re: background color shenanigans
« on: August 27, 2018, 12:50:40 am »
I take back what I said... that COLOR statement wasn't a fix. Just had a few fluke runs where the BG color was set to black as it scrolled. /facepalm

8
QB64 Discussion / background color shenanigans
« on: August 27, 2018, 12:45:35 am »
I've been playing around with a simple program that randomly prints user generated strings of text with foreground and background colors that can be both randomly generated and user generated. Thanks to a handful of personal heroes the other day (yesterday even? it all blurs together) I've now worked out most of the bugs.

Something I found a fix for that I'd like to understand more about is this, though: These text strings print line by line as you can see in the attached image, and all is well until the last line on the screen. For some reason whenever that happens, suddenly the background color is bled out beyond the string of text, all the way to the end of the screen, and then one or so spaces down on the next line. In QB64 the resolution raises (annoyingly) when the printed text tries to move beyond the screen and it stops doing it after one or two lines.

On my 486, in Qbasic, every new line bleeds the background color like that.

The fix was to add a COLOR 0, 0 after the PRINT statement for the random string, so that's, cool. But yeah. Anyone know why it does that suddenly when the screen scrolls?

Also, is there any way to stop the resolution from changing in QB64 when my printed lines pass the bottom? I'd like it to just scroll rather than zoom out, like it does in Qbasic. It's just a couple of dumb little programs I'm working on to aid in my art practice (I'm a studio practice grad student), but I was hoping to have them behave similarly on the older and newer machines if possible. The resolution funny-business is actually kind of a big deal, as I rely on the visual output and need to keep it clear.

Thanks again!

9
QB64 Discussion / Re: ELSEIF question
« on: August 24, 2018, 10:01:03 pm »
Noooo. /facepalm

That was totally it, lol. It was reversed and trying to call the wrong variable in the wrong spot.

I love the fact that my first dip back into this after all this time was just to embarrass myself over a 20 year old problem.

Damn this forum is quick! Thanks everyone!

10
QB64 Discussion / ELSEIF question
« on: August 24, 2018, 08:55:38 pm »
Hello, first post. Dusted off a really old machine the other day and was digging through some BAS programs I had been working on. Now I've got the wild hair to finish some of them. I'm still working in Qbasic, but QB64 is on its way down the pipe as I type this.

Fair warning: I'm no programmer. I had barely learned anything when I moved on.

Anyway, this program I've got is supposed to let the user input four strings of text, choose foreground / background colors (or randomize them), and then barf out these strings at random X number of times.

This is the section that always falters:

IF B = 666 AND F = 666 THEN
COLOR FR, BR
ELSEIF B < 666 AND F < 666 THEN
COLOR F, B
ELSEIF B = 666 AND F < 666 THEN
COLOR FR, B
ELSEIF B < 666 AND F = 666 THEN
COLOR F, BR
END IF

B is the background color input by user and F is foreground color input by user, while BR and FR are the randomly generated versions respectively.

If you set both to random by entering 666 for B and F, it works. It also works if both are NOT 666. However, if one is set to random and the other isn't, it always fails, citing the appropriate COLOR line as an Illegal Function Call.

This is a mystery that's about 18 years old, so my future appreciation for any help solving it.


Pages: [1]