PDA

View Full Version : Blitz 2: AHI and MIDI. Is it possible?


XDelusion
10-05-2012, 09:10 PM
I'm wondering if Blitz 2 can be made to support USB, AHI and MIDI?

It would be interesting to write a program that supported XBOX 360 Rock Band Guitars and Drums via USB, and or something that will support PS2 sets via the PS2 to 9pin adapter.

My interest would be to create a sampler that could be triggered by the drums and guitar. Ideally I'd like to be able to assign each sample to a MIDI channel as well that could be triggered by musick hardware or another Amiga. Lastly, I believe the ability to use it to convert the Guitar and Drums to a MIDI controller would also be nifty, but first things first, a Sampler Controlled by USB inputs from Rock Band products and or a PSX adapter if USB is not possible, but it must support AHI if possible.

Could something like this be done?

http://youtu.be/JbntIQ7W7Ek

http://youtu.be/-1AnfCwl260

http://youtu.be/sAT2OUNuxEU

platon42
10-09-2012, 08:50 AM
I'm wondering if Blitz 2 can be made to support USB, AHI and MIDI?

It would be interesting to write a program that supported XBOX 360 Rock Band Guitars and Drums via USB, and or something that will support PS2 sets via the PS2 to 9pin adapter.

My interest would be to create a sampler that could be triggered by the drums and guitar. Ideally I'd like to be able to assign each sample to a MIDI channel as well that could be triggered by musick hardware or another Amiga. Lastly, I believe the ability to use it to convert the Guitar and Drums to a MIDI controller would also be nifty, but first things first, a Sampler Controlled by USB inputs from Rock Band products and or a PSX adapter if USB is not possible, but it must support AHI if possible.


For all I could find out from a little googling the XBOX360 Controllers use -- of course, since this is Microsoft -- a non-approved Interface/Class/Subclass code ('X'/'B'/0) and hence it will not bind to the HID class as a joystick. Turns out, it doesn't even use the HID protocol, so that wouldn't be of any help.

The protocol doesn't seem too complicated though:
http://lxr.free-electrons.com/source/drivers/input/joystick/xpad.c?a=avr32#L90

If Blitz can access Amiga libraries (I'm pretty sure it can) and you feed it with an .FD file or whatever to call the poseidon.library main functions, you will find it rather easy to lock onto the guitar and read out the data coming from it. There's the slightly (ahem) outdated Poseidon SDK, but you can also look into the AROS Sources on how things are done.

For some things, you might need to be able to provide Callback Hooks that are called asynchronously, and as I never programmed Blitz, I cannot say how and if that's supported.

Adding a CAMD MIDI driver is a bit tricky. In fact, it's a pain in the ass, especially when being tied to such dynamic plug/unplugable things like USB devices. You WILL need to code some ASM here (the USB camd class "drops" a MIDI driver file into the supposed directory as soon as a USB MIDI device is connected that will then try to talk back to the USB class (USB classes are libraries aswell)). Unfortunately, not many applications actually support CAMD, so you might be better off doing the playback thing yourself (with AHI).

Sure you don't want to give C a try? It's not that hard if you were thinking of such stuff from Blitz (or maybe, do the driver part in C and let Blitz just talk to the driver through a port or such).

XDelusion
10-09-2012, 01:39 PM
Playsation USB will work in that case. Hmm...

Maybe I should start practicing with C. I've got a lot to learn if I do, and a lot already on my plate. Will see though, it would be interesting.