MIDI OUT per Protmidi

BlitzMax Forums/Brucey's Modules/MIDI OUT per Protmidi

Dezzo(Posted 2010) [#1]
Iīm writing a small Midi Aplication which uses the Protmidi module.

Is it possible to get MIDI OUT working with Portmidi?
MIDI IN Works fine though but i would like to send Data as well.
I canīt make it work for now.

cheers,

D


Nigel Brown(Posted 2010) [#2]
I am calling portmidi directly, using one I downloaded and amended on the 28th Aug 06, you can always test I/O by feeding the output back to the input! I will email you the portmidi that I have used and there are examples within.


Nigel Brown(Posted 2010) [#3]
oops you will probably need this also:


Import "portmidi28aug06/porttime/*.h"
Import "portmidi28aug06/porttime/porttime.c"

Import "portmidi28aug06/pm_common/*.h"
Import "portmidi28aug06/pm_common/portmidi.c"

Import 	"portmidi28aug06/porttime/ptwinmm.c"
Import 	"portmidi28aug06/pm_win/*.h"
Import 	"portmidi28aug06/pm_win/pmwin.c"
'Import 	"portmidi28aug06/pm_win/pmdll.c"
Import 	"portmidi28aug06/pm_win/pmwinmm.c"

Import		"sysex.cpp"

Extern "C"		' sysex.cpp

	Global	OutputDevice:Int
	Global	InputDevice:Int
	Global	LoopbackInputDevice:Int
	Global	LoopbackOutputDevice:Int

	Global	midi_message:Byte[]

	Function midi_open:Int()
	Function midi_close:Int()
	Function midi_test:Byte Ptr()

	Function loopback_open:Int()
	Function loopback_close:Int()
	Function loopback_test:Int()

	Function listener_open:Int()
	Function listener_close:Int()
	Function listener_test:Int()

	Function get_midi_in()
	Function get_midi_out()

	Function sysex_receive_open:Int()
	Function sysex_receive_get:Byte Ptr()
	Function sysex_receive_close:Int()

	Function diagnostic_send( message:Byte Ptr )

	Function sysex_send( message:Byte Ptr )
	Function sysex_send_receive:Byte Ptr( message:Byte Ptr )

	Function sysex_initalise()
	Function sysex_set_device:Int( device:Byte Ptr, dir:Int )
	Function sysex_get_next_device:String( nxt:Int, dir:Int )
	Function sysex_get_number_of_devices:Int()

	Function sysex_finalise()

End Extern


then just call


LoopbackInputDevice = ??
LoopbackOutputDevice = ??

looback_open()
loopback_test()
looback_close()


this will at least give you confidence that it is all working OK.

Last edited 2010


Dezzo(Posted 2010) [#4]
Sorry for the late reply ! Thanx to your Post and fast Answer , big time !!
Just to clearify : If i want to ,for example, send some Controller values to a MIDI port i have to write a Function in C first to finaly call it via Blitz Max ?

cheers,

D


Nigel Brown(Posted 2010) [#5]
Dezzo, not sure that you have to write the C wrapper, in this case it was easier for me to implement it this way, this time.


Nigel Brown(Posted 2011) [#6]
RTMidi available in bah.mod with examples you could try that route.


Brucey(Posted 2011) [#7]
RTMidi is much easier to use, and I think a little more stable.