toddswint1

New Member
Joined
Jan 31, 2014
Messages
8
Hello,

I am working on a project to dynamically and graphically illustrate a guitar scale on a fretboard and am having an issue that I was hoping one of you could help me with.

In the following sub-procedure I wanted to 1) show an image and play a sound SIMULTANEOUSLY, and 2) pause for predefined number of seconds before executing the next procedure. The idea is to simulate the fingers crawling up the fretboard.

Instead, the code plays the tone immediately and then lags probably for 4 seconds before loading the image corresponding to that tone.

Is there a way to re-order my highly rudimentary code or to completely rewrite it to achieve the desired result of synchronizing the playing of the tone with the displaying of the image? Your help is appreciated!


‘ Public Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
‘ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


‘ Sub Speed_Crawl()
' Pause for Crawl selection
‘ Application.Wait (Now + TimeValue("00:00:4"))
‘ End Sub


‘ Sub PLAY_PASS_1_HIGH_E_Fret1()
'
‘ Dim MyPath As String
‘ MyPath = Application.ActiveWorkbook.Path


' LOW E/FRET 1
' MARKER FINGER - NULL
‘ If Range("G259").Value = "" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - PINKY
‘ If Range("G259").Value = "P" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - INDEX
‘ If Range("G259").Value = "I" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - RING
‘ If Range("G259").Value = "R" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - MIDDLE
‘ If Range("G259").Value = "M" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = True
‘ End If

' PLAY TONE
' Determine Clean or Heavy Tone
‘ If Range("S69").Value = "CLN" And Range("G259").Value <> "" Then
‘ Application.Run "SoundFile_High_E"
‘ End If
‘ If Range("S69").Value = "HVY" And Range("G259").Value <> "" Then
‘ Application.Run "SoundFile_High_E"
‘ End If
‘ DELAY NEXT PROCEDURE
‘ Call Speed_Crawl


‘ End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top