Page 1 of 1

Joystick and MIDI handler

Posted: Wed Sep 27, 2017 5:06 pm
by Spektro
Hello,

I'm suggesting two new DOS handlers: an USB joystick handler and a MIDI handler. They would provide easy access to joysticks and MIDI devices from any programming language.

Re: Joystick and MIDI handler

Posted: Wed Sep 27, 2017 11:10 pm
by Belxjander
Spektro wrote:Hello,

I'm suggesting two new DOS handlers: an USB joystick handler and a MIDI handler. They would provide easy access to joysticks and MIDI devices from any programming language.

My only questions with these would be...
In what order are devices listed?
Are there any special keywords like the CON: handler to change access details?

Did you have something already in mind?

Re: Joystick and MIDI handler

Posted: Thu Sep 28, 2017 8:37 pm
by Spektro
I had a vague idea that the joysticks would appear as directories in the JOY: device. And in the same way the various MIDI gadgets would be listed as directories in the MIDI: device.

Seeing which joysticks and MIDI devices are available is then just a matter of listing the content of JOY: and MIDI:.

Once you know what joysticks and MIDI devices are available, you can read and write to a device's directory to get a joystick direction, send commands to a force feedback joystick, and send and receive MIDI messages.

Both handlers could accept special keywords, like the CON: handler does, if needed.

Re: Joystick and MIDI handler

Posted: Thu Sep 28, 2017 10:39 pm
by Belxjander
so basically,

JOY: would show a device listing as it's directory entries...
and opening the device-file for a given joystick would read that joystick...

MIDI: doing something similar for midi devices attached and valid for camd.library?

I honestly don't know if keywords beyond a basic file open would really work...

devices as files or directory entries...
can readargs() for additional options be used when extensding the file/directory name?

maybe making the device a file and reading/writing options with that somehow?

Re: Joystick and MIDI handler

Posted: Tue Oct 03, 2017 10:12 pm
by LyleHaze
camd is a library, which is a bit more "program" oriented than a handler, but there are command line tools for basic stuff, and enough example code to show how easily it can be used.

os4depot/camdtools/showclusters will show a list of currently available MIDI clusters. It may also be used with a specific cluster name, and will set the WARN flag if found. This makes it easy for a script to detect specific devices and automatically add links to support them.

os4Depot/camdtools.MidiThru can create linkages between MIDI devices and/or programs from a command line. Think "Midi Cable" with options to filter, transpose, shift channels etc..

Other tools provide a configurable mixing console, program change manager that handles standard instrument files, Sys Ex record, SysEx playback, control change generator, Piano display, and lots of stuff like that.

MOST of those tools come witrh complete source, so if you want to play, you've got a running start.

I suppose there's plenty of material there to help you write a handler if you want to. :)

Re: Joystick and MIDI handler

Posted: Wed Oct 04, 2017 11:05 pm
by Belxjander
LyleHaze wrote:camd is a library, which is a bit more "program" oriented than a handler, but there are command line tools for basic stuff, and enough example code to show how easily it can be used.

os4depot/camdtools/showclusters will show a list of currently available MIDI clusters. It may also be used with a specific cluster name, and will set the WARN flag if found. This makes it easy for a script to detect specific devices and automatically add links to support them.

os4Depot/camdtools.MidiThru can create linkages between MIDI devices and/or programs from a command line. Think "Midi Cable" with options to filter, transpose, shift channels etc..

Other tools provide a configurable mixing console, program change manager that handles standard instrument files, Sys Ex record, SysEx playback, control change generator, Piano display, and lots of stuff like that.

MOST of those tools come witrh complete source, so if you want to play, you've got a running start.

I suppose there's plenty of material there to help you write a handler if you want to. :)
And with that clarifying that a lot more than ( MIDI:<device>/ ) would be possible...

Thank you LyleHaze for all of the above.

@Spektro: the MIDI: handler looks very practical to me based on LyleHaze camd work and the above camdtools all being source included.

Just need a clear "These are the features" list to define more exactly if you want more than "Device Exists"...

One thing that comes to mind is Linux "/dev/input/joystick#" and "/sys" sysfs... may be something to look at ?
to compare your idea and think about any other features that make sense for a handler to provide?