QBasic Tutorial 25 - Sound And Music- QB64


Description:


There are a few ways of making sounds and music in Qbasic.


The first command is BEEP. BEEP just beeps and is used as an alert.


Next is the SOUND command. SOUND plays a frequency for a specified duration

- Frequency 37 to 32767

- Duration 0 to 65535


Finally, there is PLAY. Here are some settings for PLAY:


O - Octave (0 - 6): O6

< or > - Moves Up or Down One Octave

P - Pauses (1 - 64): P1   Pause Whole Note

T - Tempo (32 - 255) in Quarter Notes Per Minute: T120

A, B, C, D, E, F, G - Plays The Note in the Current Octave

Playing Length(1 - 64): C2 Plays an C Half Note

+ or # Makes The Preceding Note Sharp

- (Minus) Makes the Preceding Note Flat



NOTE: QBasic uses the internal speaker to play sounds and music. Many computers do not come with internal PC speakers anymore. To get around this problem use DOSBox or QB64.




Links Of Interest:


DOSBox Download


DOSBox Tutorials


Frequency Notes List


QB64 Download







Ode To Joy Notes:


PLAY "T120<<e8e8f8g8g8f8e8d8c8c8d8e8e8d12d4"

PLAY "e8e8f8g8g8f8e8d8c8c8d8e8d8c12c4"

PLAY "d8d8e8c8d8e12f12e8c8d8e12f12e8d8c8d8p8"

PLAY "e8e8f8g8g8f8e8d8c8c8d8e8d8c12c4"



Code Download:


QBT25_1.BAS


QBT25_2.BAS


QBT25_3.BAS


QBT25_4.BAS


QBT25_5.BAS


QBT25_6.BAS



Video Tutorial: QBasic Tutorial 25 - Sound And Music- QB64


Previous Tutorial                  Next Tutorial