Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Frequencies in QBASIC...anyone can help?
#1
hi me and my freind have been experimenting with qbasic for a while and we were wondering how to go about using frequencies for we saw some source for a bethoven song and they used frequencies to do it. how would i go about doing this? liek wat is the syntx for it, and also does anyone have a tutorial maybe on how to work it? any help would b great, thank you
Reply
#2
Each note has a different frequency, IE, middle A is 440 Hz. Almighty google gave me a complete list in a while:

http://www.phy.mtu.edu/~suits/notefreqs.html
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
Then you use the SOUND command to play the note. Eg, for middle A for one second:

Code:
SOUND 440, 18.2

18.2 = 1 second, 36.4 = 2 seconds etc.
Reply
#4
thats it? really? thats sweet man! thanks so much. but wait i have just one more question what if i wanted the frequency to in one continuos soud just like go low to high and back down again like in 3 seconds go from like (off the top of my head) from 100mhz to 400mhz then back down to 200mhz all in one sound do i just do one after another or is there liek another way to do it?
Reply
#5
yeah, use a loop:

Code:
SUB Slide( stf%, enf%, duration! )
   if enf% = stf% then sound stf%,duration!: Exit Sub
   timeC! = duration! / ( abs ( enf% - stf% ) + 1 )
   For i% = stf% TO enf% step sgn ( enf% - stf% )
      sound i%, timeC!
   next i%
END SUB

I've writen this sub from the top of my head. It takes a starting frequency, an ending frequency, and a duration, and it slides from starting frequency to ending frequency during "duration" ticks.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)