Synchronizing outcomes

Status
Not open for further replies.

toddswint1

New Member
Joined
Jan 31, 2014
Messages
8
Hello,

I am building a tool to dynamically and graphically illustrate a guitar scale on a guitar fretboard.

I am trying to achieve the following: On worksheet change event, 1) show image and play sound SIMULTANEOUSLY, and 2) pause for a predefined number of seconds before executing next procedure.

When I run the code below, I hear the tone immediately but the image display is delayed.

How can this rudimentary code be modified to achieve the objective? Your help is much appreciated! Todd



‘ 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
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,303
Office Version
  1. 365
Platform
  1. Windows
Duplicate https://www.mrexcel.com/forum/excel-questions/1088109-synchronizing-outcomes.html#post5229391

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it.
Please be patient and do not attempt to post the question again.
 
Status
Not open for further replies.

Watch MrExcel Video

Forum statistics

Threads
1,108,969
Messages
5,525,960
Members
409,673
Latest member
Riseee

This Week's Hot Topics

Top