Change midi sound when playing midi file.

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,389
Office Version
  1. 2021
Platform
  1. Windows
I have the code below that plays midi files. The files were created by me using a midi sequencer, and recorded using the 'Grand Piano' midi voice. I have a workbook designed to teach piano scales et al. As such, when I play them back (through the PC speakers) using this code, it sounds like a grand piano.
I also want to use these files in another Excel workbook that I have set up to teach guitar scales. Is there a setting or routine that I can use so that when they are played in the guitar environment, it sounds like a guitar instead of a piano?

VBA Code:
Private Declare Function mciExecute Lib "winmm.dll" _
(ByVal IpstrCommand As String) As Long
Sub midi(action As String, midifilename)
mciExecute action & " " & midifilename
End Sub
Sub playMIDI()
    mf = "C:\users\peter\data\midi_files\C_major.mid"
midi "play", mf
End Sub
 
If you have a midi sequencer and they were created by you. Couldn't you just modify them in your MIDI program to be a different voice and save them out as something like guitar_C_major.mid, etc...? Pretty sure the instrument data is contained within the file and not just a "setting"
 
Upvote 0
If you have a midi sequencer and they were created by you. Couldn't you just modify them in your MIDI program to be a different voice and save them out as something like guitar_C_major.mid, etc...? Pretty sure the instrument data is contained within the file and not just a "setting"
Yes I could do that, but that would mean creating another set of files, which I was hoping to avoid. (Probably several hours' work). Thanks for your reply. Regards.
 
Upvote 0

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