Qbasicnews.com

Full Version: Sound Wave Bar.....
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
Quote: amps is the volume of sound and not its pitch

Oh, yeah. *slaps self in the face* I can't believe I did that. Oh, well. It still works. I should have made it FREQ instead of AMP.
:lol: Yeah, I've been reading up on sound waves (where I got this idea for a chalange).. ^_^,. yeah, make it wave change in pitch ((Hz)waves per sec), and the SOUND respond to that if you want it simulated.. :wink:
Hey Rattra, I was bored and now...well....I was playing with graphics again. :lol: what you think?
I could only get it to 11 lines....
[syntax="qbasic"]
SCREEN 13
amp = 10
DO
r% = (r% + 1)
IF r% = 200 THEN r% = -120
FOR i% = 1 TO 360
PSET (((i% + amp) * SIN(r% * 3.141593 / 180)) + 160, ((r% + amp) * SIN(i% * 3.141593 / 180)) + 100), (i% MOD 255)
NEXT i%
WAIT &H3DA, 8
CLS
LOOP
[/syntax]
Cool, Mitth. Smile
Quote:Hey Rattra, I was bored and now...well....I was playing with graphics again. :lol: what you think?
I could only get it to 11 lines....
[syntax="qbasic"]
SCREEN 13
amp = 10
DO
r% = (r% + 1)
IF r% = 200 THEN r% = -120
FOR i% = 1 TO 360
PSET (((i% + amp) * SIN(r% * 3.141593 / 180)) + 160, ((r% + amp) * SIN(i% * 3.141593 / 180)) + 100), (i% MOD 255)
NEXT i%
WAIT &H3DA, 8
CLS
LOOP
[/syntax]

Hey, mith, i removed the screen 13 and it worked fine, so i guess you could have done it in 10 lines
Mabey in FB but the default in QB is SCREEN 0, which is text mode.

The graphics statements like PSET don't work in text mode.

thnx lynax. Big Grin
Quote:I could only get it to 11 lines....
[syntax="qbasic"]
SCREEN 13
amp = 10
DO
r% = (r% + 1)
IF r% = 200 THEN r% = -120
FOR i% = 1 TO 360
PSET (((i% + amp) * SIN(r% * 3.141593 / 180)) + 160, ((r% + amp) * SIN(i% * 3.141593 / 180)) + 100), (i% MOD 255)
NEXT i%
WAIT &H3DA, 8
CLS
LOOP
[/syntax]

Taken down to 8:-

[syntax="QBASIC"]
1 IF amp = 0 THEN SCREEN 13 ELSE CLS
2 amp = 10
3 IF r% = 200 THEN r% = -120 ELSE r% = r% + 1
4 FOR i% = 1 TO 360
5 PSET (((i% + amp) * SIN(r% * 3.141593 / 180)) + 160, ((r% + amp) * SIN(i% * 3.141593 / 180)) + 100), (i% MOD 255)
6 NEXT i%
7 WAIT &H3DA, 8
8 GOTO 1
[/syntax]
:o Whoa! That's alsome, Mitth!!! Big Grin The wave just reaches out of the screen almost! :wink:
Ya, thnx, can anyone tell me why it 'looks' 3D?
^_^ Do you? Me? No, not atm... :wink:
Pages: 1 2 3 4 5 6 7 8