Joystick and MIDI handler

AmigaOS users can make feature requests in this forum.
Post Reply
User avatar
Spektro
Beta Tester
Beta Tester
Posts: 122
Joined: Sat Jun 18, 2011 6:55 am
Location: Finland
Contact:

Joystick and MIDI handler

Post 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.
- Janne Peräaho
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Joystick and MIDI handler

Post 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?
User avatar
Spektro
Beta Tester
Beta Tester
Posts: 122
Joined: Sat Jun 18, 2011 6:55 am
Location: Finland
Contact:

Re: Joystick and MIDI handler

Post 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.
- Janne Peräaho
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Joystick and MIDI handler

Post 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?
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: Joystick and MIDI handler

Post 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. :)
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Joystick and MIDI handler

Post 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?
Post Reply