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
Challenge, create a sound bar using what ever you want:

Circle
Pset
Line

---|INPUT #RULES, post|---------------
Limit: 9 Lines

Restricted: " : " <--- Those

Must Have: Varible Amplitude (e.i. |2 amp = 100...|) Must be able to increase and decrease.. not that it has to do all that, just the varible declare will do ^_^

Goal: Again, have some 3min fun!!!
--------------------|CLOSE #RULES|---
What do you mean? something that shows you the amplitude
of the sound from your speakers?
:o Heh, not likely,

Here is what I did, its just to graft a wave...

Code:
'Wave Bar by Kevin(x.t.r.GRAPHICS)

1 SCREEN 19, 32, 2, 1
2 amp = 100 'Amplitude Ajust
3 LINE (0,300)-(800, 300), RGB(0,0,255)
4 FOR x = 1 TO 800
5 y! = amp * SIN(ang * 3.24/180)
6 PSET (x, 300 - y!), RGB(0,255,0)
7 ang = ang + 1
8 NEXT
9 SLEEP

If that helps... :wink:
:???: Have I stumped all of you, or do you have little interest in a wavebar? Its less to it than a PSET Circle.. oh well....

Drawing Wave Bar...
Code:
'Drawing Wave Bar by Kevin(x.t.r.GRAPHICS)

1 SCREEN 19, 32, 2, 1
2 amp = 100 '<<>>Amplitude Ajust<<>>
3 LINE (0,300)-(800, 300), RGB(0,0,255)
4 FOR x = 1 TO 800
5 PSET (x, 300 - (amp * SIN(ang * 3.24/180))), RGB(0,255,0)
6 ang = ang + 1
7 SLEEP 5
8 NEXT
9 SLEEP

Smile Enjoy!
No you didn't stump me....

I could do your challenge:
A: I don't know what to do
B: I couldn't see your example which led to #1
Smile Aye, okay, let me port it right quick.....

Code:
'Wave Bar by Kevin(x.t.r.GRAPHICS)

1 SCREEN 13
2 amp = 50 'Amplitude Ajust
3 LINE (0,100)-(320, 100), 9
4 FOR x = 1 TO 320
5 y! = amp * SIN(ang * 3.24/180)
6 PSET (x, 100 - y!), 10
7 ang = ang + 1
8 NEXT

That should work for ya.. :wink: ..

EDIT: Increace the angle add for shorter wavelenghts.. Smile
Cool, so what do you want us to do?Big Grin


BTW I'm feeling a lot better
Eh, make one however you want as long as its under 9lines & has no ":".. Any which way makes the better sound bar, cooler looking what ever...

If you come up with a cool effect that is more than 9 Lines, its welcome also, seems n1 is interested elsewise.. :lol:
So... you want a nicely drawn sinus curve?

Edit: Like this?
[syntax="qbasic"]1 if t=0 then screen 13 else if t<64 then palette t,t*256
2 for x=0 to 160
3 for y=0 to sin(x*360/320/57.29)*75
4 pset (x,y+100),abs(y/75*63)
5 pset (x+160,-y+100),abs(y/75*63)
6 next
7 next
8 t=t+1
9 if t<64 then goto 1 else sleep[/syntax]
Quote:So... you want a nicely drawn sinus curve?

Bingo! Yes, but in the forum of a sound bar.. (e.i. has to atleast have a visible axis for amplitude reference).. if you can manage a grid along with it that would also do.. Smile
Pages: 1 2 3 4 5 6 7 8