Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Playing Music

bsaucerbsaucer Member Posts: 40
How can I write a program to play a simple tune? I want to be able to play a note, and control the pitch and duration.

Comments

  • JohnHogbergJohnHogberg Member Posts: 17
    : How can I write a program to play a simple tune? I want to be able to play a note, and control the pitch and duration.
    :

    Private Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" _ (ByVal lpSound As String, ByVal flag As Long) As Long
    Private Const sndSync = 0
    Private Const sndAsync = 1

    To play sound:

    Dim snd as long

    snd = sndplaysound("FILENAME",SndAsync)
  • bsaucerbsaucer Member Posts: 40
    That just plays a web file. I want to play notes programatically, specifying the notes and duration as I play.

    : : How can I write a program to play a simple tune? I want to be able to play a note, and control the pitch and duration.
    : :
    :
    : Private Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" _ (ByVal lpSound As String, ByVal flag As Long) As Long
    : Private Const sndSync = 0
    : Private Const sndAsync = 1
    :
    : To play sound:
    :
    : Dim snd as long
    :
    : snd = sndplaysound("FILENAME",SndAsync)
    :

  • JohnHogbergJohnHogberg Member Posts: 17
    : That just plays a web file. I want to play notes programatically, specifying the notes and duration as I play.
    :
    : : : How can I write a program to play a simple tune? I want to be able to play a note, and control the pitch and duration.
    : : :
    : :
    : : Private Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" _ (ByVal lpSound As String, ByVal flag As Long) As Long
    : : Private Const sndSync = 0
    : : Private Const sndAsync = 1
    : :
    : : To play sound:
    : :
    : : Dim snd as long
    : :
    : : snd = sndplaysound("FILENAME",SndAsync)
    : :
    :
    :
    manipulate the snd variable
Sign In or Register to comment.