Menu images does not show in hardware player but does in software players and PS3 - java-me

I'm developing a blu-ray menu with java (BD-J). I developed a simple loading animation. when running it on PS3, soft players (PowerDVD, TotalMedia Theatre, ...) and some hard players (Samsung ht-c6950w), there is no problem and it runs like a charm. But when running it on other hard players (LG, Panasonic, Samsung,...) nothing happens. You cannot see any image on the screen.

BD-J Xlets is JavaME.
The thing about JavaME (on both Blu-ray players and cellphones) is that it behaves differently on different devices. Different manufacturers simply implements it differently. (Hence why Java coders replaced the "Code once, run anywhere" with "Code once, debug everywhere").
Some Blu-ray players are very forgiving while others are very tricky.
So yes, you will need to debug on a lot of different players to make sure your Xlet runs on as many different devices as possible. (I think I have about 15 different players, bought on various flee markets and such).
Here are two things I've learned during my own research:
Some players require a video to be played before the BD-J works. So if you don't have any video in your project, then add a little 3-second long black screen and play it.
There's a folder called CERTIFICATE in the root of the disc. This folder needs to contain a file id.bdmv containing the ID of the disc - regardless of your BD-J Xlet is signed or not. Again; some players are forgiving about this - others aren't.
There aren't many places left for those interested in BD-J, but you can find some useful links at http://www.Blu-Play.com

Related

Play More Than One Sound Files in Livecode

I want to create a game with sound effects. When I start the game, the background music should be played until the game is over. When I click on something in the game (such as buttons), a sound effect should be played but the background music is stopped.
How can I make the background music play continuously while the sound effect from object is playing?
I already have these scripts...
Card script...
on openCard
play "backgroundmusic.wav" looping
end openCard
Buttons (or any object)...
on mouseup
play "sound.wav"
end mouseup
How to play these sounds together?
Update: I found a game uploaded to Game Jam. This game was ranked #1. When I play the game, the sound was amazing that it has background music and sound effects. But the owner of this game doesn't upload the livecode stack file in order to study it. The game was entitled Space Shooter Game. The sounds of this game is what I expect.
Note:
As what I figured out from the answers, using the player object can be work. But this requires QuickTime which I don't have that installed in my PC. I want also the sound to be able to play in mobile devices.
As it stands, the soundChannel property has no effect in LiveCode and is only provided for Hypercard compatibility.
Currently on desktop there are two ways to do multi-channel sound: 1) play imported sounds as one channel, and use a player object as the second channel, or 2) use two player objects.
Typically, a good option is to import short sounds as sound effects into a stack that only play once, and reserve the player object for background music. Imported sounds usually play with the least latency, however, you cannot play multiple imported simultaneously -- attempting to play a second sound while a first is playing will stop the first to play the second. If you have a need to play asynchronous sound effects, this option will not work; you must use a combination of playback options.
Multiple players can be used, but note that there can be some latency during the process of loading a sound (assigning a sound's filepath to a player) and playing it.
Also note that truly seamless playback of of a track is difficult if not impossible -- LiveCode will at some point become susceptible to some system event that will cause a slight pause between loops. A while back, Trevor Devore made an addition to his Enhanced QuickTime external that enabled true seamless looping of audio. However, with Apple getting rid QuickTime, it's unknown how much longer this option will be useful.
With the enhancements that the RunRev guys have been making to the engine, it's likely we'll see improvement with media playback and management, hopefully sooner rather than later.
In the LiveCode forums, they suggest using player objects on the card instead and telling them to play.
In HyperCard, you could set the soundChannel property for that. Have you checked in the LiveCode documentation whether it supports that? The docs for the play command and the the sound property might also help. Maybe those contain hints. FWIW, in HC
set the soundChannel to 1
play "BackgroundMusic"
set the soundChannel to 2
play "SoundEffect"
would play the sound effect and background music at the same time. Maybe that's how it works in LiveCode as well?
The multimedia capabilities are a going through a transformation. Previously everything was built around QuickTime (well almost everything) and you needed to add a player control for each concurrent sound. Currently the whole foundation is changed as Apple dropped QuickTime, but assuming you develop for desktop you should still (again) be able to add a player object and then use:
start player "name of player"
You can also create player object dynamically by
create player "my player""
and then use
set the filename of player "my player to "/path/to/your/audio/file"
before staring your sound. And as long as you have different players for your different sounds they should play simultaneously.
on openCard
put specialFolderPath("engine") & "/soundfx/backgroundmusic.wav" into tSound
mobilePlaySoundOnChannel tSound, "Background", "looping"
end openCard
on mouseup
play "sound.wav"
end mouseup

Gesture Recognition for my Grandma (Kinect) Linux

I'm looking into making a project with the Kinect to allow my Grandma to control her TV without being daunted by using the remote. So, I've been looking into basic gesture recognition. The aim will be to say turn the volume of the TV up by sending the right IR code to the TV when the program detects that the right hand is being "waved."
The problem is, no matter where I look, I can't seem to find a Linux based tutorial which shows how to do something as a result of a gesture. One other thing to note is that I don't need to have any GUI apart from the debug window as this will slow my program down a fair bit.
Does anybody know of something somewhere which will allow me to in a loop, constantly check for some hand gesture and when it does, I can control something, without the need of any GUI at all, and on Linux? :/
I'm happy to go for any language but my experience revolves around Python and C.
Any help will be accepted with great appreciation.
Thanks in advance
Matt
In principle, this concept is great, but the amount of features a remote offers is going to be hard to replicate using a number of gestures that an older person can memorize. They will probably be even less incentivized to do this (learning new things sucks) if they already have a solution (remote), even though they really love you. I'm just warning you.
I recommend you use OpenNI and NITE. Note that the current version of OpenNI (2) does not have Kinect support. You need to use OpenNI 1.5.4 and look for the SensorKinect093 driver. There should be some gesture code that works for that (googling OpenNI Gesture yields a ton of results). If you're using something that expects OpenNI 2, be warned that you may have to write some glue code.
The basic control set would be Volume +/-, Channel +/-, Power on/off. But that will be frustrating if she wants to go from Channel 03 to 50.
I don't know how low-level you want to go, but a really, REALLY simple gesture recognize could look at horizontal and vertical swipes of the right hand exceeding a velocity threshold (averaged). Be warned: detected skeletons can get really wonky when people are sitting (that's actually a bit of what my PhD is on).

Choosing an audio API

I'm struggling to choose between a vast number of audio programming languages and APIs. I'm very (totally) new to audio programming so please bear with me.
Software
I need to be able to:
Alter volume of different sounds before outputting them to anything (these sounds can have a variety of different origins, for example mp3s and microphone input)
phase shift sounds
superimpose sounds that I have tweaked (as per items 1 and 2)
control the output to each of 8 channels independently of one another
make this all happen on Windows7
These capabilities need be abstracted by a graphical frontend I will probably make myself. What I want to be able to do is create 'sound sources' and move them around a 3D environment along either pre-defined trajectories and/or in relation to the movement of whoever is inside the rig. The reason I want to do pitch bending is so I can mess with red-shift stuff.
I don't want to have to construct full tracks before-hand and just play them. I want the sound that is played to depend on external input from sensors as well as what I am doing on the frontend.
As far as I know this means I cant use any existing full audio making app.
The Question
I've been looking around for for the API or language I should use and I have not turned up a blank, quite the opposite actually. I'm struggling to narrow down my search. A lot of my problem stems from the fact that I have no experience in audio programming.
So, does anyone know off-hand of an API or language that meets my criteria?
Hardware stuff and goals
(I left this until last because I'm not sure how relevant it is)
My goal is to make three rings of speakers at different heights and to have enough control over them to be able to simulate any number of 'sound sources' within the array. The idea is to have someone stand in the middle of the rig and be able to make it sound like there are lots of things moving around them. To get this working I'm planning on doing a little trig and using 8 channels of audio from my PC. The maths is pretty straight forward, it just the rest that I need to worry about
What I want to do next is attach a bunch of cameras to the thing and do some simple image recognition stuff to be able to 'attach sound sources' to different objects. Eg. If someone is standing in the right place it can be made to seem as though all red balls quack like a duck, and all orange ones moan hauntingly.
This is not to detract from Richard Small's answer, but to comment on some of the other options out there:
If you are looking for something higher-level with which you can prototype and develop this faster, you want max/msp or it's open source competitor puredata. These are designed for musicians who are technically minded, but not so much for programmers. As a result, you can build this sort of thing quickly and efficiently.
You also have some lower level options: PortAudio can handle your audio I/O, you would have to do the sound generation and effects and so on on your own or with other libraries. Cinder and OpenFramewoks both provide interfaces for audio, cameras, and other stuff for "creative programming". I'm afraid I don't know if they meet your full requirements, but they are powerful and popular for this sort of thing so I encorage you to look at them.
The two major ones these days tend to be
WWise
WWise Download Link
FMOD
FMOD Download Link
These two engines may even in fact be overkill for what you need, but I can almost guarantee that they will be capable of anything you require.

Using a piano keyboard as a computer keyboard [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Closed 9 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I have RSI problems and have tried 30 different computer keyboards which all caused me pain. Playing piano does not cause me pain. I have played piano for around 20 years without any pain issues. I would like to know if there is a way to capture MIDI from a MIDI keyboard and output keyboard strokes. I know nothing at all about MIDI but I would like some guidance on how to convert this signal into a keystroke.
I haven't done any MIDI programming in years, but your fundamental idea is very sound (no pun).
MIDI is a stream of "events" (or "messages"), two of the most fundamental being "note on" and "note off" which carry with them the note number (0 = C five octaves below middle C, through 127 = G five octaves above the G above middle C, in semi-tones). These events carry a "velocity" number on keyboards that are velocity sensitive ("touch sensitive"), with a force of (you guessed it) between 0 and 127.
Between velocity, chording, and the pedals, I'd think you could come up with quite a good "typing" interface for the piano keyboard. Chording in particular could be a very powerful technique — as I mentioned in the comments, it's why rank-and-file stenographers can use a stenotype machine to keep up with people talking for hours in a row, when even top-flight typists wouldn't be able to for any length of time via normal typewriter-style keyboards. As with machine stenography, you'd need a "dictionary" of the meanings of chords and sequences of chords. (Can you tell I used to work in the software side of machine stenography?)
To do this, the fundamental pieces are:
Receiving MIDI input. Don't try to do this yourself, use a library. Edit: Apparently, the Java Sound API supports MIDI, including receiving events from MIDI controllers. Cool. This page may also be useful.
Converting that data into the keystrokes you want to send, e.g. via the dictionary I mentioned above.
Outputting the keystrokes to the computer.
To be most broadly-compatible with software, you'd have to write this as a keyboard device driver. This is a plug-in to the operating system that serves as a source for keyboard events, talking to the underlying hardware (in your case, the piano keyboard). For Windows and Linux, you're probably going to want to use C for that.
However, since you're just generating keystrokes (not trying to intercept them, which I was trying to do years ago), you may be able to use whatever features the operating system has for sending artificial keystrokes. Windows has an interface for doing that (probably several, the one I'm thinking of is SendInput but I know there's some "journal" interface that does something similar), and I'm sure other operating systems do as well. That may well be sufficient for your purposes — it's where I'd start, because the device driver route is going to be awkward and you'd probably have to use a different language for it than Java. (I'm a big fan of Java, but the interfaces that operating systems use to talk to device drivers tend to be more easily consumed via C and similar.)
Update: More about the "dictionary" of chords to keystrokes:
Basically, the dictionary is a trie (thanks, #Adam) that we search with longest-prefix matching. Details:
In machine stenography, the stenographer writes by pressing multiple keys on the stenotype machine at the same time, then releasing them all. They call this a "stroke" of the keyboard; it's like playing a chord on the piano. Strokes frequently (but not always) correspond to a syllable of spoken language. Like syllables, sometimes one stroke (chord) has meaning all on its own, other times it only has meaning combined with following strokes. (Think "good" vs. "good" followed by "bye"). Although they'll be heavily influenced by the school at which they studied, each stenographer will have their own "dictionary" of what strokes they use to mean what, a dictionary they will continuously hone over the course of their working lives. The dictionary will have entries where the stenographic part ("steno", for short) is one stroke long, or multiple strokes long. Frequently, there will be several entries with the same starting stroke which are differentiated by their length and by the subsequent strokes. For instance (and I won't use real steno here, just placeholders), there may be these entries:
A = alpha
A/B = alphabet
A/B/C = alphabetic
A/C = air conditioning
B = bee
B/C = because
C = sea
D = dog
D/D = Dee Dee
(Those letters aren't meant to be musical notes, just abstract markers.)
Note that A starts multiple entries, and also note that how you translate a C stroke depends on whether you've previously seen an A, a B, or you're starting fresh.
Also note that (although not shown in the very small sample above), there may be multiple ways to "play" the same word or phrase, rather than just one. Stenographers do that to make it easier to flow from a preceding word to the next depending on hand position. There's an obvious analogy to music there, and you could use that to make your typing flow more akin to playing music, in order to both prevent this from negatively affecting your piano playing and to maximize the likelihood of this actually helping with the RSI.
When translating steno into standard text, again we use a "longest-prefix match" search: The translation algorithm starts with the first stroke ever written, and looks for entries starting with that stroke. If there is only one entry, and it's one stroke long, then we can reliably say "that's the entry to use", output the corresponding text, and then start fresh with the next stroke. But more likely, that stroke starts multiple entries of varying lengths. So we look at the next stroke and see if there are entries that start with those two strokes in order; and so on until we get a match.
So with the dictionary above, suppose we saw this sequence:
A C B B C A B C A B D
Here's how we'd translate it:
A is the start of three entries of varying lengths; look at next stroke: C
A/C matches only one entry; output "air conditioning" and start fresh with next stroke: B
B starts two entries; look at next stroke: B
B/B doesn't start anything; take the longest previous match (B) and output that ("bee")
Having output B = "bee", we still have a B stroke in our buffer. It starts two entries, so look at the next stroke: C
B/C matches one entry; output "because" and start fresh with the next stroke: A
A starts three entries; look at the next stroke: B
A/B starts two entries; look at the next stroke: C
A/B/C only matches one entry; output "alphabetic" and start fresh with the next stroke: A
A starts three entries; look at next stroke: B
A/B starts two entries; look at next stroke: D
A/B/D doesn't match anything, so take the longest previous match (A/B) and use it to output "alphabet". That leaves us with D still in the buffer.
D starts two entries, so we would normally look at the next stroke — but we've processed all the strokes, so consider it in isolation. In isolation, it translates as "dog" so output that.
Aspects of the above to note:
You have a buffer of strokes you've read but haven't translated yet.
You always want to match the most strokes against a single entry that you can. A/B should be translated as "alphabet", not "alpha" and "bee".
(Not shown above) You may well have sequences of strokes that you can't translate, because they don't match anything in the dictionary. (Steno people use the noun "untranslate" -- e.g., with our dictionary, the strokes E would be an "untranslate".)
(Not shown above) Some theories of steno allow the same set of strokes to mean more than one thing, based on a broader context. Steno people call these "conflicts". You probably want to disallow them in your project, and in fact when steno used to be translated manually by the stenographer, conflicts were fine because they'd know just by where in the sentence they were what the right choice was, but with the rise of machine translation, conflict-free theories of steno arose specifically to avoid having to go through the resulting translated text and "fix" conflicts.
Translating in real time (which you'd be doing) means that if you receive a partial match, you'll want to hold onto it while waiting for the next chord — but probably only up to a timeout, at which point you'd translate what you have in the buffer as best you can. (Or maybe you don't want a timeout; it's your call.)
Probably best to have a stroke that says "disregard the previous stroke"
Probably best to have a stroke that says "completely clear the buffer without outputting anything"
Consider doing something in hardware that emulates a usb (or ps/2?) keyboard. You will no longer be dependent on a specific OS, or specific OS API. A hardware solution will stand the test of time. Don't be stuck using an old API in Windows 7 when everyone else is running Windows 11! Arduino is pretty easy to learn.
Arduino MIDI hardware is available off of the shelf
Arduinos have been used to emulate keyboard devices
There is a ton of info and help out there for Arduino. It is a hardware hacking platform built for newbies. It will only get bigger now that Google is pushing Arduino.
EDIT: Virtual USB Keyboard software and hardware
It sounds to me like you're looking less for advice on how to build this yourself and more asking what resources are already out there to accomplish what you want. Depending on your OS, there are many ways to accomplish this without having to write your own program from scratch:
MIDI Stroke
Free. For Mac OS X 10.3 and up. This one specifically comes with "the ability to use any MIDI keyboard as a full blown computer keyboard replacement."
Bome's MIDI Translator
Free/Postcardware (it's a bit odd). For Windows 2000 and up, and Mac OS X. It initially appears to be more geared towards AutoHotkey-type usage, but on further looking I think it could do what you want nicely.
Max and aka.keyboard
Free. For Mac OS X. Not exactly a "ready out of the box" solution, but if you are comfortable with basic device configuration, it shouldn't be too bad.
You can access the hardware with source code samples in .NET in MIDI DotNet.
A complete working sample as sourcecode to create MIDI notes data stream is in VB 5/6-Tipp 0521: MIDI-Töne erzeugen (Visual Basic 6.0, somewhere is .NET version too)
A way to simulate keyboard strokes is in VB 5/6-Tipp 0155: Tastaturereignisse simulieren (Visual Basic 6.0, somewhere is .NET version too)
And recognize keystrokes is describedin Tipp-Upload: VB.NET 0266: Globaler KeyHook.
Then, just use a good working matrix for a piano player
On piano and when you're a good player, you can have 10 fingers on the keyboard and if the matrix is usable you can be much more quickly that any computer keyboard user I think. :-)
In that case, if I understand your question right, it should not be a big thing.
I studied piano performance in college and then got into interaction design, programming, and using Vim, so I have actually spent a lot of time prototyping things like this.
You can get this working pretty quick in Linux by using the graphical programming language for multimedia artists, "Pure Data," along with the x11key external by Alex Andre.
On Mac, you can use MidiStroke. I believe a method on Windows involved the MidiOx and AutoHotKey tools. At another time I had a version going using the Java plugin for Max/MSP. I believe Patrice Colet made a windows external for Pure Data that worked as well, but I can't seem to locate it anymore. Also, there's an external for MaxMSP that can do this on Windows. Finally, the non-free but awesome Osculator can do what you want - see the features page.
When I got it working, I never stuck with it, because I couldn't stop tooling with the layout. It was cool just having my monitor on my electric keyboard, though! Good luck.
About MIDI
You stated that you "know nothing at all about MIDI". MIDI technology is fairly straight-forward once you grasp it, but it can be confusing at the outset. One of the resources that has been tremendously helpful for me in understanding the foundations for MIDI (which are certainly necessary if you want to program MIDI interactions), is a book called MIDI for the Technophobe. It's an easy book to read and is very helpful.
Pure Data & Max
In my experience developing interactive multimedia, there are two very similar programs I have encountered that facilitate connecting and mapping signals/inputs from any device.
These are Max for a Mac environment and Pure Data for a PC environment. Both have a plethora of online documentation and YouTube tutorials. The video Max/MSP Tutorial 1 - using your computer keyboard as midikeyboard (ableton style) demonstrates a program built in Max that maps a computer keyboard to a MIDI keyboard's inputs (which is basically the exact opposite of what you are trying to do). You could get your intended results by using the same pattern, but reversing the signals/mappings.
AutoHotKey
AutoHotKey is a free open source utility for Windows that allows you to remap keys and buttons on your devices to macros. It natively supports QWERTY keyboards, joysticks and mouse macros.
However, I was able to find an implementation supporting the specific mapping you are looking for. These two threads explain the process:
MIDI IN support in AutoHotkey , the discussion of the use case. The author was looking for a program that could detect MIDI IN input and translate that to keypresses.
MIDI input library , the solution to the author's problem and the posted code/patch to AutoHotKey which actually implements your intended result.
Basically, it looks like AutoHotKey, along with this user's custom patch, will provide exactly what you need to create a mapping from a MIDI keyboard to a QWERTY keyboard's input signal. All you would have to do is install, configure and define your mappings.
Anything else?
Some of the other answers have given you much more extensive information on MIDI and MIDI programming, in general, but as your post states that doesn't seem to be quite what you are looking for. I would like to help you more if possible, but it would be easier if you could be more specific about the type of information you are looking for. For instance, are you more interested in how to convert a MIDI keyboard's input signals to a QWERTY keyboard's signals, or is your primary interest finding an out of the box solution to your specific problem? What are you looking for that has not yet been addressed?
You could hack your own USB keyboard pretty quickly using a Teenys micro controller.
In fact, they have example code for how to make a USB keyboard.
You could approach this two ways:
Get an old piano and wire up switches directly to the teensy
Add the additional logic to connect to the MIDI port and necessary decoding.
Actually, I worked on this a while ago, trying to capture Rock Band drum inputs into my computer (making a little Java homemade drum emulator) Anyway, I asked a question on here about that, Time delay problem (there is polling code in there, along with what I was attempting to do.). And if I can find my program I can give you the code, it uses a third-party API (JInput).
Good luck either way.
Try Bome's MIDI translator.
It works cross platform, can convert any MIDI input to a keystoke easily, quick to setup and configure, plus it's free for personal use.
There is a tutorial, Quick Tip: MIDI Translation – MIDI to Keystrokes, of how to easily set it up:
Basically, there are infinite possibilities of what you can do, including chording and modifier keys. I use it for my live audio rig to control my DAW using my piano and have never had an issue.
In Java, you can use JMF (Java Media framework) to convert MIDI signals.
Basic of keyboard design is easy to use, that is, the user interface; and place frequently used charcter/symbol handy.
The sample code and API in Java Sound Resources: Examples: Digital Signal Processing (DSP) help to understand how to process the signal.
Some more references:
Processing Audio with Controls
Digital Audio Signal Processing, 2nd Edition
A good library in .NET with full midi support (BASS), go to http://www.un4seen.com.
And for the other part, translating keyboard midi notes to keys and more, I would go for AutoItX, the ActiveX/COM and DLL interface to autoIt. Info and download, go to http://www.autoitscript.com/site/autoit/
No need to write keyboard driver.
There is a program called GlovePIE. You can program it in a simple scripting language, and I believe it supports MIDI. I'm not sure if this fits under the "Java" category, but still, it is a great program. I've used it to control robots using PS3 controllers. It's very powerful.
Many keyboards have a serial port (RS-232) connector to send MIDI signals to the computer. I use a program called Girder to convert serial port communication into keyboard strokes.
Girder has a "mapping" feature that lets you map each key, one by one, to the corresponding keystroke.
This might be the simple solution you're looking for!
Just learn stenography!
It's clear from all the discussion on your part. You don't want to re-invent any wheels, from a technical standpoint. But once you have a connection made (what this question is asking) and up and working, you still have most of the work ahead of you: You have to train your brain. You also have to invent the cleverest, most efficient way to do that - a design issue totally out of the rhealm of computer techies. You or any of us would fall short.
Fortunately, the problem has been solved and honed though centuries of maturing...
Learn stenography!
Yes, this will set you back some jack. But what are hundreds of hours of your own time worth, with at the end, a less favorable result? Besides, the stenography Wikipedia article says, 'it looks more like a piano keyboard'.
Unless, of course, you want to have a sideshow effect going. I would have to admit, I never thought of this possibility, it it would be really entertaining to see somebody bust out a text from a piano keyboard!
You could start with a USB keyboard with touchpad (or a pointing stick would be more ergonomic?), use Plover to translate it (I'm sure it can be configured to let the non-letter keys retain their functionality as they are critical for programming), or, follow the thread Re: Plover keyboard to roll your own USB stenography keyboard, or, buy a stenotype.
Good luck!
Take a look at MAME arcade gaming. They have built hardware devices to allow input from any number of different items. The iPac, for example, converts signals from input devices into USB that the computer can then use to emulate keys. You could use any combination of input devices arranged any way that seems comfortable with no crazy programming logic required--because the software to interpret input is already done and well tested.
I've seen flight simulator cockpit inputs, custom kiosks, and voting systems built in this method.....and the price is right!
To solve this you will need a few things:
A way to capture MIDI data from your keyboard. Depending upon the interface: MIDI interface (classic) or USB MIDI interface (modern) the most likely interface is to a computer as it provides the most options. USB host microcontrollers are not as simple as just using a computer.
A scheme to convert MIDI data into keystrokes. Like one user pointed out, chords are the way to go as the number of keys will not be dependent upon the number of piano keys.
A way to inject a key into the operating system. This will require a low-level driver to be accurate. I have played around with applications that inject keyboard and mouse data into applications in Windows 7, and it can be flaky and depend upon whether an application is currently in focus. This is hardest part of the interface. What may work is to create a HID USB keyboard microcontroller that also has a serial interface.
The serial interface would create a virtual serial port. The software that reads the MIDI data and produces the keystrokes could send a serial message to the virtual serial port. The microcontroller would send a keystroke so it would look like a standard keyboard input. This would allow interfacing both MIDI ports and USB MIDI keyboards.
Hmmm, with this type of interface you could also simulate a mouse and use some piano keys setup for the mouse axis and buttons. The pressure could be used to determine mouse pointer velocity. So you could eliminate the mouse as well. Another benefit of this approach is any type of input device you connect could talk to the virtual serial port to produce keyboard and mouse events. So if you wanted to add other hardware such as drum pedals or a joystick it would be a matter of adjusting the program that talks to the serial interface.
Another take on the above is like some posted above to use an Arduino, but also include USB Host Shield from Sparkfun to handle USB based music keyboards. This allows the Arduino to be programmed as a keyboard or keyboard mouse combo in the boot loader chip and allows the device to act a USB host for the USB based music keyboard. Then you are covered for both types. Although, I still think the virtual serial port method is more flexible and would be easier to program in the long run. The Arduino device will be harder to change than a desktop program or service.
There is another possibility:
Chorded one handed keyboards already exist. I have seen videos on them, but you would have to determine if those hurt your hands or not.
It should be fairly easy using something like the .NET DirectSound interface to hook into an MIDI device. You will need to identify your target MIDI device and then get the code to listen in on the incoming messages (there are articles about doing this via Google).
Since you are using the MIDI in as a keyboard there are basically only two MIDI messages that you need to detect, namely note on and note off. The MIDI message is three data bytes specifying the command, the note and the velocity. The note off is just the note number (sometimes 'bad' MIDI stacks send a note on with zero velocity which you also have to expect).
Once you have the messages translating them the keyboard output should be fairly simple from .NET.
There is plenty of advice in the other answers about the technicalities; I just wanted to give you an idea of the actual MIDI messages. Good luck!
You'll get better and happier results (regardless what operating system and/or DAW program you like to use) by playing any external MIDI keyboard as a controller through your sound card. Then route that into your GB software (or whatever) and tone generate the many sounds they have supplied you that way in real-time.
If your sound card does not support MIDI I/O's (ins / outs /thrus), that's not a problem. You can consider researching and investing in an external MIDI table top converter. Many are equipped to further convert MIDI outs to USB 2.0 (by- passing an existing sound card altogether).
For example: it's pretty tough getting "human like" grace note results via a Z and X change key option using a computer keyboard and pencil tool. When, instead, your own fingers can just play that with a MIDI keyboard from its own physical octave register ranges—immediately!
I realize budgetary constraints may be involved. But, some of these seemingly cheap "Casio" type 5 octave keyboards sold at Radio Shack for under $100.00 U.S. Dollars (*or less) is all you would need (plus, some of their on-board sound patches and sequencer modules sound and handle amazingly well for other things too).
RadioShack MIDI keyboard options.
As for external MIDI converters for existing sound cards, I've run some Google searches for you as follows with Mac platforms specifically in mind:
A lot of this external MIDI conversion information may be cumbersome to you at first, so I've broken down things more as "user friendly" for your considerations & budget:
MIDI sound cards
There's nothing wrong with facilitating virtual keyboards as VST's when using DAW. They have their place.
But, you sound like an accomplished keyboardist. So, why not consider the external MIDI conversion / keyboard options I just mentioned for yourself?
Good luck and I hope this gave you some ideas that can and will work for you!
If you don't want to do any programming yourself but just want the problem solved you can just buy a USB-MIDI-keyboard where you can re-assign any key to send a QWERTY keyboard output signal instead of a MIDI-output, for example M-Audio Axiom Pro
This method will work with any OS and any computer that supports standard USB-keyboards since the MIDI-keyboard will identify itself as a standard QWERTY keyboard.
You can use a simple AutoIt script to both read MIDI events, see MIDI Input.
You'll also need MIDI UDF and simulate key presses.
Reading MIDI events should be easy, but different MIDI controllers (instruments) have different features. Try to find out what your MIDI piano can do first, then see how you can best map those features to simulated QWERTY-keyboard presses.
If you want, you could have something on screen or in the tray to help you see what you are doing (that is, for Shift, Ctrl and Alt simulation).
You might take a look at chorded keyboards. They have the advantage that you don't need to write a driver for them before you can use them, and some are similar to the layout of a piano keyboard.
If you know coding in Java, you could use this way:
First, implement a javax.sound.midi.Receiver with a send(..) method that is mapping the 'Note on' events to keystrokes like you want.
You would need to get the MidiMessage's content with its getMessage method and intepret it in your fashion. The meaning of the message bytes can be found in MIDI Messages.
After receiving a 'note on' or 'note off' for a certain keyboard key, you may map that to a key you like by assigning it a constant of the KeyEvent class, something like C#4 -> KeyEvent.VK_A and so on. This key code can then be used by java.awt.Robot's keyPress and keyRelease methods to actually send the keystroke to the OS and thus to other applications.
I agree with Brian O'Dell's answer - if this were my project, I'd do it in hardware. It has the advantage of being platform and hardware independent - your box replaces the need for a MIDI-USB interface and a PC API.
mbed is a fast-prototyping platform that is very easy to learn, and has multiple advantages over Arduino IMHO (online compiler, 512 KB flash, 96 MHz, C++ language). It has a USB keyboard interface and a USB Midi interface pre-written for you.
The community is very friendly and willing to help, and there are a lot of existing projects using both MIDI and USB hid emulation - search Youtube for "mbed MIDI" or similar.
If you use Linux have a take at Footware.
It should be exactly what you're looking for - if you adjust the MIDI pitches to a keymapping of your liking...
I never thought this could be useful for anyone but me ;o)
Try using a microcontroller-based system, like Arduino.
This wouldn't be too tough.
I'm assuming you're on Windows, not sure about that though. I've written a MIDI sequencer, http://pianocheetah.com, in plain old C++, and it lets you use the piano keyboard to run commands. There isn't any reason you couldn't do the same thing to push keys
into the keyboard input stream.
But come on now. You remember how long it took you to learn
the keyboard in the first place, right?
Are you willing to go through that again?
And are you willing to pollute your blessed keyboard with
a bunch of stupid looking key symbols all over it?
You'll need to use at least 26 alpha, 10 numeric, 11 punctuation,
and at least 12 function keys AND their shifted states.
So that's 60 keys plus shifted states.
That'll burn up a full 5 octaves of keys.
You will be doing piano "hops" =all= the time.
Say goodbye to touch typing.
You may save yourself from RSI, but you've created another
different type of nightmare for yourself.
And good luck getting your boss to buy you a MIDI keyboard at work.
If you've learned to truly play piano, you've learned
how to play stress free. Do that on the QWERTY keyboard.
No tension. Start slow.

Major game components

I am in the process of developping a game, and after two months of work (not full time mind you), I have come to realise that our specs for the game are lacking a lot of details. I am not a professional game developper, this is only a hobby.
What I would like to receive help or advices for is this: What are the major components that you find in games, that have to be developped or already exists as librairies? The objective of this question is for me to be able to specify more game aspects.
Currently, we had specified pretty much only how we would work on the visual, completely forgetting everything about game logic (AI, Entities interactions, Quest logic (how do we decide whether or not a quest is completed)).
So far, I have found those points:
Physics (collision detection, actual forces, etc.)
AI (pathfinding, objectives, etc.)
Model management
Animation management
Scene management
Combat management
Inventory management
Camera (make sure not to render everything that is in the scene)
Heightmaps
Entities communication (Player with NPC, enemy, other players, etc)
Game state
Game state save system
In order to reduce the scope of this queston, I'd like it if you could specifically discuss aspects related to developping an RPG type of game. I will also point out that I am using XNA to develop this game, but I have almost no grasp of all the classes available yet (pretty much only using the Game component with some classes that are related to it such as GameTime, SpriteBatch, GraphicDeviceManager) but not much more.
You have a decent list, but you are missing storage (save load), text (text is important in RPGs : Unicode, font rendering), probably a macro system for text (something that replaces tokens like {player} with the player characters name), and most important of all content generation tools (map editor, chara editor, dialog editor) because RPGs need content (or auto generation tools if you need ). By the way have links to your work?
I do this exact stuff for a living so if you need more pointers perhaps I can help.
I don't know if this is any help, but I have been reading articles from http://www.gamasutra.com/ for many years.
I don't have a perfect set of tools from the beginning, but your list covers most of the usual trouble for RUNNING the game. But have you found out what each one of the items stands for? How much have you made already? "Inventory Management" sounds very heavy, but some games just need a simple "array" of objects. Takes an hour to program + some graphical integration (if you have your GUI Management done already).
How to start planning
When I develop games in my spare time, I usually get an idea because another game lacks this function/option. Then I start up what ever development tool I am currently using and try to see if I can make a prototype showing this idea. It's not always about fancy graphics, but most often it's more about finding out how to solve a certain problem. Green and red boxes will help you most of the way, but otherwise, use Google Images and do a quick search for prototype graphics. But remember that these images are probably copyrighted, so only use them for internal test purposes and to explain to your graphic artists what type of game/graphic you want to make.
Secondly, you'll find that you need to find/build tools to create the "maps/missions/quests" too. Today many develop their own "object script" where they can easily add new content/path to a game.
Many of the ideas we (my friends and I) have been testing started with a certain prototype of the interface, to see if its possible to generate that sort of screen output first. Then we build a quick'n'dirty map/level-editor that can supply us with test maps.
No game logic at this point, still figuring out if the game-engine in general is running.
My first game-algorithm problem
Back when I was in my teens I had a Commodore 64 and I was wondering, how do they sort 10 numbers in order for a Highscore? It took me quite a while to find a "scalable" way of doing this, but I learned a lot about programming too.
The second problem I found
How do I make a tank/cannon fire a bullet in the correct direction when I fly my helicopter around the screen?
I sat down and drew quick sketches of the actual problem, looked at the bullet lines, tried some theories of my own and found something that seemed to be working (by dividing and multiplying positions etc.) later on in school I discovered this to be more or less Pythagoras. LOL!
Years and many game attempts later
I played "Dune" and the later C&C + the new game Warcraft (v1/v2) - I remember it started to annoyed me how the lame AI worked. The path finding algorithms were frustrating for the player, I thought. They moved in direction of target position and then found a wall, but if the way was to complex, the object just stopped. Argh!
So I first sat with large amounts of paper, then I tried to draw certain scenarios where an "object" (tank/ork/soldier) would go from A to B and then suddenly there was a "structure" (building/other object) in the pathway - what then?
I learned about A-star pathfinding (after solving it first on my own in a similar way, then later reading about the reason for this working). A very "cpu heavy" way of finding a path, but I learned a lot from the process of "cracking this nut". These thoughts have helped me a lot developing other game algortimes over time.
So what I am saying is: I think you'll have to think more of:
How is the game to be played?
What does the user experience look like?
Why would the user want to come back to the game?
What requirements are needed? Broadband? 19" monitor with 1280x1024?
An RPG, yes - but will it be multi-user or single?
Do we need a fast network/server setup or do we need to develop a strong AI for the NPCs?
And much more...
I am not sure this is what you asked for, but I hope you can use it somehow?
There are hundreds of components needed to make a game, from time management to audio. You'll probably need to roll your own GUI, as native OS controls are very non-gamey. You will probably also need all kinds of tools to generate your worlds, exporters to convert models and textures into something suitable for your game etc.
I would strongly recommend that you start with one of the many free or cheap game engines that are out there. Loads of them come with the source code, so you can learn how they have been put together as you go.
When you think you are ready, you can start to replace parts of the engine you are using to better suit your needs.
I agree with Robert Gould's post , especially about tools and I'd also add
Scripting
Memory Management
Network - especially replication of game object states and match-making
oh and don't forget Localisation - particularly for text strings
Effects and effect timers (could be magical effects, could just be stuff like being stunned.)
Character professions, skills, spells (if that kind of game).
World creation tools, to make it easy for non-programmer builders.
Think about whether or not you want PvP. If so, you need to really think about how you're going to do your combat system and any limits you want on who can attack whom.
Equipment, "treasure", values of things and how you want to do the economy.
This is an older question, but IMHO now there is a better answer: use Unity (or something akin to it). It gives you 90% of what you need to make a game up front, so you can jump in and focus directly on the part you care about, which is the gameplay. When you run aground because there's something it doesn't do out of the box, you can usually find a resource in the Asset Store for free or cheap that will save you a lot of work.
I would also add that if you're not working on your game full-time, be mindful of the complexity and the time-frame of the task. If you'll try to integrate so many different frameworks into your RPG game, you can easily end up with several years worth of work; maybe it would be more advisable to start small and only develop the "core" of your game first and not bother about physics, for example. You could still add it in the second version.

Resources