listen, am trying to create a metronome. So basicly what i have is a .wav file that plays the beat. My problem is i have got to adapt that beat to the bpm out of the scroll list. Here's what i have done till now. OH n remember try not to laugh so hard when u see the code cause im pretty new to vb myself so....
a = sndPlaySound("C:\Documents and Settings\lalis.jiménez.000\desktop\david\programacion\visual basic\descargas\metronome\beat.wav", SND_LOOP + SND_ASYNC)
mira hice unos movimientos como kitar el boton de stop a ver si entiendes el cambio asi kedo e codigo a mi me funciona pero no trabaje mucho en la formula para el beat esa tu ponsela
VB Code:
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_MEMORY = &H4
Private Const SND_LOOP = &H8
Private Sub Command1_Click()
If Command1.Caption = "Go" Then
Command1.Caption = "Stop"
Timer1.Interval = Text1.Text
Label3.Caption = Timer1.Interval
Else
Command1.Caption = "Go"
sndPlaySound 0, 0
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub HScroll1_Change()
Text1.Text = Str(HScroll1.Value)
End Sub
Private Sub hscroll1_scroll()
HScroll1_Change
End Sub
Private Sub Timer1_Timer()
If Command1.Caption = "Stop" Then
a = sndPlaySound("C:\Documents and Settings\lalis.jiménez.000\desktop\david\programacion\visual basic\descargas\metronome\beat.wav", SND_LOOP + SND_ASYNC)
entiendo lo q hiciste pero no estoy muy seguro q sabes como funciona un metronomo....BPM significa beats per minute. Si sale 50 en text1.text tonces el interval del timer es tambien 50 lo que quiere decir que va a haber mucho mas de 50 beats en un minuto.