15
1
Challenge
Create a GUI Keyboard with as few characters as possible.
Example
Because this was an assignment in one of my courses, I can't show the source code. However, here is a screen shot of my keyboard.
In this example, my keys were of type JButton
and I used a Midi Synthesizer to produce the sound (with the default ADSR envelope values).
Rules
- You are allowed to use standard external libraries.
- Be creative with your sound. You can use 8-bit, a sitar, etc.
- For simplicities sake, you may have five keys; black and white, from C to E (the first five keys on my keyboard).
- Most importantly... showcase your work!
NOTICE: Depending on what language you choose to work with, this may be a rather large task.
This is my first question on SE Code Golf. If anything is unclear, please ask for further details.
EDIT: The due date for this challenge will be 9/22/12. If you post an answer after this date, I will look over it regardless (and possibly +1 it).
2Restrictions on which language to use are not liked very much here. Consider dropping your restriction or name an important reason. – FUZxxl – 2012-09-15T18:08:53.130
I agree with FUZxxl. Java and C♯ suck at CG anyway so I can see even less why you would want to forbid them. Still, I like this task. – ceased to turn counterclockwis – 2012-09-15T18:37:12.527
1@FUZxxl As stated under the Example section, this was a term project for our Java class. It is still being used as a term project for that very class. But I suppose I'm just paranoid so I'll drop the restrictions. I think you meant which languages not to use... but whatever, I removed them. – Rob – 2012-09-15T19:02:29.607
@leftaroundabout Thank you, I made some changes to the Rules. – Rob – 2012-09-15T19:05:48.523
2What are the minimal requirements to be considered a "GUI keyboard"? I infer from what's already present that it must display a GUI and produce some sound, but what restrictions are there on: a) the input mechanism; b) the sound envelope; c) the scale used; d) the accuracy of the tuning; e) the proportions of the keys? – Peter Taylor – 2012-09-15T22:02:27.657
@PeterTaylor I used buttons for my piano along with a midi synthesizer (default ADSR values) in Java. Since I am only asking for five keys, you can use C, C#, D, D# and E. These keys correspond to the first five keys farthest to the left in the image that I provided. – Rob – 2012-09-16T00:11:42.717
2@MikeDtrick, that answers 0/5 of my questions. I'm not asking how your implementation worked: I'm asking how I can know whether my (hypothetical) implementation is a valid competitor, because there's no point shortening an entry by 20% if so doing takes it from being a valid entry to an invalid one. – Peter Taylor – 2012-09-16T08:03:22.940
1@MikeDtrick: For example, you could require that the buttons look exactly like the ones in your example, pixel by pixel. At the other extreme you could allow any arrangement of five GUI buttons of any type. – han – 2012-09-16T10:25:47.320
@PeterTaylor As long as it looks like a piano and sounds like a piano (perfect pitch), then it's a valid answer. – Rob – 2012-09-16T12:41:31.090