Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Musical notes in QB or FB
#1
Hello. I am trying to make some music, using the PLAY command in QB. My speaker produces about five nice sounds in the 5th octave, and one in the fourth octave; all others are just a low buzz. Is there any other way to make musical notes, perhaps even using the loudspeakers that came with the computer? Or, perhaps FB has better abilities in this than QB? Any low-level information will be appreciated, Please note that I am not into music, and don't even know the musical scale notes.

The reason I am posting this is because I have an old, BASIC program with the PLAY command for some music, and I am trying to make it work.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#2
Have you tried SOUND commands?

And for making music come out of your speakers check this topic here:

http://forum.qbasicnews.com/viewtopic.php?t=11216
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Reply
#3
MoochTheMonkey:

Thanks for your reply. I tried the following, and got "Illegal Function call". I use Windows XP Home Edition, SP2, by the way.

Edited 2006-01-04: Oops!, I left out the code. Here it is:
Code:
FOR i = 50 to 1500 STEP 50
  SOUND i, 10
NEXT i
When I changed the i to uppercase (I) throughout, it worked!
Now, my only problem is translating the frequency to a PLAY value, so I can do the proper substitutions in the program I have.


Next, I will go to the site you indicate, to learn more. Thanks again.

Edited a little later:
I went to the site you indicated. I had been there before, and, first, the SOUND statement was said not to work with Windows 2000; mine is XP, and, I have already indicated my experience above.

Edited again on 2006-01-04:
I corrected my statement that SOUND didn't work for me, in my first "Edited 2006-01-04. I have now been able to make the SOUND statement work.


Then, I went to the site indicated there, but came away with the impression that all were specific function programs, created to do specific things. I don't think that I am up to that, actually.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#4
I have just edited and corrected my previous reply. Please re-read it. Thank you.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#5
Hmm...sorry for the late reply. I couldn't access a computer.

I'm a bit confused with your question...you're just
trying to translate Sound statements to Play statments right? If so, you can completely(though quite accurate) translate the two. Sound sends a very specific sound to the PC Speaker while the play statement sends a set frequency set on the note..You may be able to tweak this with ASM. As the octave gets higher, the greater distance the frequencies are apart.

However though, here's a chart that will tell you certain frequencies for each note. I think this is what you need: Smile

http://www.cs.nyu.edu/courses/fall03/V22.../notes.htm
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Reply
#6
Thanks, it looks as if the table shown on that site is just what I was looking for. I'll try to get some time on this, and I'll post my final "thing", if I learn how to make it work properly.

Over and out.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)