User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - VB.net Code to Work with midi-ox »
Welcome, Guest. Please Login or Register.
Mar 16th, 2025, 12:03pm


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Scripting Questions
(Moderator: Jamie OConnell)
   VB.net Code to Work with midi-ox
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: VB.net Code to Work with midi-ox  (Read 7711 times)
julynessi
New Member
*



MIDI-OX Rules!

   


Posts: 3
VB.net Code to Work with midi-ox
« on: Jan 1st, 2011, 5:41pm »
Quote Quote Modify Modify

'VB.net shot code for working with MIDI-OX
'You just need to add Listbox to Form1
'Add MidiOX reference to your project in "Project Menu"
 
Imports MIDIOXLib
 
Public Class Form1
 
    Public WithEvents mox As MIDIOXLib.MoxScript
    Delegate Sub FireToListbox(ByVal txt As String, ByVal obj As ListBox)
 
    Private Sub FireList(ByVal txt As String, ByVal obj As ListBox)
   Try
  If obj.InvokeRequired Then
      Dim d As New FireToListbox(AddressOf FireList)
      Me.Invoke(d, New Object() {txt, obj})
  Else
      ListBox1.Items.Add(txt)
  End If
   Catch ex As Exception
  MessageBox.Show(ex.Message)
   End Try
    End Sub
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   mox = New MIDIOXLib.MoxScript
   mox.DivertMidiInput = 1
   mox.FireMidiInput = 1
    End Sub
 
    Private Sub mox_MidiInput(ByVal nTimestamp As Integer, ByVal port As Integer, ByVal status As Integer, ByVal data1 As Integer, ByVal data2 As Integer) Handles mox.MidiInput
   'combine all midi data in to 1 line split with ","  
   Dim strMIDI As String = nTimestamp & "," & port & "," & status & "," & data1 & "," & data2
   FireList(strMIDI, ListBox1)
    End Sub
 
    Private Sub mox_SysExInput(ByVal bStrSysEx As String) Handles mox.SysExInput
   FireList(bStrSysEx, ListBox1)
    End Sub
End Class
IP Logged
julynessi
New Member
*



MIDI-OX Rules!

   


Posts: 3
Re: VB.net Code to Work with midi-ox
« Reply #1 on: Jan 1st, 2011, 5:46pm »
Quote Quote Modify Modify

this example will add midi input From midiOX
To your listbox
How-to
#1-Start your VS.net  
2.New Project type VB.net windows form Application
3.then Drag Listbox to your form1
4.copy code to your form1.vb
5. hit F5 to test it
 
Hope this help
IP Logged
drwave
New Member
*



MIDI-OX Rules!

   


Posts: 1
Re: VB.net Code to Work with midi-ox
« Reply #2 on: Apr 17th, 2012, 11:58am »
Quote Quote Modify Modify

This sample was a great help to make MIDI from a PC. Initially I used a M-audio UNO to connect the USB out to a Korg Synth and it worked fine. The VB.net program generates MIDI messages that play on the synth. But now I want to eliminate the UNO and the synth. I don't want any MIDI input(except from the VB program) and I want the output to go to the PC WavTable sound card. Now if I try MIDI-OX with the MIDIBAR player I get a "no MIDI inputs" message but it does play a MIDI file on the PC soundcard. So does the "keyboard". But the VB.NET program provides no audio output ! Ideas ?
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.