These pages will contain both beginners tips and advanced HTML coding. Suggest you RIGHT CLICK and select Open in New Window for these links.

Beginners Pages - This is a complete working site (SarahsSite) designed to explain the use of DreamWeaver. Navigate around it then read the explanation. Sound in HTML - An advanced explanation of the use of sound in HTML and a possible approach to high quality background sound on web sites.

Note that every page in busker.net has the source available - just right click and view source This site costs upwards of 115 a year to host. Please consider donating to help our costs.

You can donate any amount with PayPal - It would help keep busker.net free for yourself and others in the future.

 

New 2002

Visual Basic & MIDI

After years of scouring the web including microsoft and other Visual Basic support sites the support for MIDI in Visual Basic is dire. Most articles that are found are simply showing people how to play a MIDI file. While this IS probably the most sought after useful code after 32 pages of the same thing you would think that people would reconsider publishing it yet again. Also many support pages are out of date and support only VB 3.0. Code for VB3 does not support VB4 and above for MIDI. This must drive the poor beginner to distraction. These pages are therefore an attempt to sort this out by putting the latest, working code together with explanations and examples to allow VB coders to come to grips with VB, MIDI & Music.

A good working example, though coded in VB3, is mOUSmUSO Ver 1.30 .

Currently mOUSmUSO is being upgraded and recoded with VB 6.0. A series of articles explaining the use of MIDI to MAKE MUSIC with computer code will be published here.

Here is the first instalment

1Note

Private Declare Function midiOutClose Lib "winmm.dll" (ByVal hMidiOut As Long) As Long
Private Declare Function midiOutOpen Lib "winmm.dll" (lphMidiOut As Long, ByVal uDeviceID As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long
Private Declare Function midiOutShortMsg Lib "winmm.dll" (ByVal hMidiOut As Long, ByVal dwMsg As Long) As Long
Dim hMidiOut As Long
Dim hMidiOutCopy As Long
Dim gridnote As Integer

Sub Form_Load()
midiOutClose hMidiOut ' Just in case
X% = midiOutOpen(hMidiOut, -1, 0&, 0&, 0&)
If X% = 0 Then
hMidiOutCopy = hMidiOut
MidiOK = True
Else
midiOutClose hMidiOut
End If
End Sub


Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
gridnote = Int((X / 6) + Int(Y / 8)) / 8 ' Generate note from x,y pos
'gridnote = Int(126 * Rnd) + 1 ' for auto Fn later
If gridnote > 127 Then gridnote = 127 ' restrict to legal MIDI val
SendMidiOut 144, gridnote, 100
End Sub


Sub SendMidiOut(MidiEventOut%, MidiNoteOut%, MidiVelOut%)
lowint& = (MidiNoteOut% * 256) + MidiEventOut%
VelOut& = MidiVelOut% * 256
highint& = VelOut& * 256
MidiMessage& = lowint& + highint&
X% = midiOutShortMsg(hMidiOutCopy, MidiMessage&)
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
SendMidiOut 144, gridnote, 0
End Sub

Note that if you want to try and cut and paste this code YOU MUST ENSURE that the wrapped lines are copied as a single line.

Here is the app 1Note.exe. Note that you will need the VB6 runtimes to run this app.

Here are the files to make the app 1Note.vbp Form1.frm 1Note.vbw

In the following days/weeks/months/years this will be expanded to show how to build a full musical instrument of your own design. Again see mOUSmUSO Ver 1.30 as an example of this.