Slashdot Mirror


Programming On a Piano Keyboard

An anonymous reader writes: Here's a fun project: engineer Yuriy Guts built a Visual Studio extension that lets people program using MIDI instruments. You can write code letter by letter on a piano keyboard. Granted, it's not terribly efficient, but it's at least artistic — you can compose music that is also a valid computer program. Somewhat more usefully, it also allows you to turn a simple MIDI input device, like a trigger pad into a set of buttons that will run tests, push/pull code, or other tasks suitable for automation. The extension is open source and open to contributions.

29 of 57 comments (clear)

  1. That's going to be embarrassing... by K.+S.+Kyosuke · · Score: 3, Funny

    ...you play one of Chopin's Études, and a Perl program falls out...

    --
    Ezekiel 23:20
    1. Re:That's going to be embarrassing... by MightyMartian · · Score: 1

      If it can't pump out Java byte code, I'm not interested.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    2. Re:That's going to be embarrassing... by angel'o'sphere · · Score: 1

      I doubt you are able to write a class file byte wise.
      Well in ancient times gurus piped their code with cat into asm, perhaps _you_ indeed can do that with a midi device ;D

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:That's going to be embarrassing... by msauve · · Score: 4, Funny

      That's nothing. Play something by John Cage, and you get Windows OS.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    4. Re:That's going to be embarrassing... by AnalogDiehard · · Score: 1

      That's nothing. Play something by John Cage, and you get Windows OS.

      Clippy: It looks like you're trying to play John Cage's "4:33". Would you like help?

      --
      Eternity: will that be smoking, or non-smoking? I Corinthians 6:9-10
    5. Re:That's going to be embarrassing... by douglas.w.goodall300 · · Score: 1

      Actually, if one hundred monkeys play on the keyboard, that is how you get Windows.

  2. Combine this with the Internet of Things... by Em+Adespoton · · Score: 1

    Now we just need to make every day objects MIDI instruments and your plant (via midi-enabled soil sensor) can write the code to turn on the tap to give it more water....

  3. PHBs by TechyImmigrant · · Score: 3, Funny

    Beware! Write your stream encryptor in a lydian mode and the PHB will come back and ask for it in phrygrian.

    --
    I should use this sig to advertise my book ISBN-13 : 978-1501515132.
  4. I dub thee by Horshu · · Score: 2

    Loom#

    1. Re:I dub thee by Kojiro+Ganryu+Sasaki · · Score: 1

      That was a truly great game.

      The gameplay itself was a bit lacking, but the atmosphere was amazing.

  5. Teach A Pig To Sing by GrahamCox · · Score: 1

    "Never try to teach a pig to sing; it wastes your time and it annoys the pig".

    Likewise, I expect this produces terrible music and not very good code.

  6. Hmm... by GarethIwanFairclough · · Score: 1, Interesting

    I wonder what would happen if someone took this concept and reversed it, what would currently used code sound like?

    1. Re:Hmm... by mythosaz · · Score: 1

      ...I'll spare you the trouble of the finding anything made from it.

      It'll sound like a bunch of random notes. If the coders were thoughtful enough, they'd have taken simple common strings and made them correspond to notes in a chord, but beyond that it'd be atonal garbage with occasional breaks for My Dog Has Fleas.

    2. Re:Hmm... by drinkypoo · · Score: 1

      Perhaps then functions need to correspond to chords, operators to notes, etc etc

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    3. Re:Hmm... by jd2112 · · Score: 1

      I wonder what would happen if someone took this concept and reversed it, what would currently used code sound like?

      I suspect that some of my code would sound like Death Metal.

      --
      Any insufficiently advanced magic is indistinguishable from technology.
  7. Wow, programming with a keyboard by ghn · · Score: 2

    A keyboard is a keyboard. Might not be qwerty but it is still a effing keyboard.

  8. lol by Charliemopps · · Score: 1

    My Piano keyboard has MORE keys than my computer keyboard. Have you people seen these things lately? It's got your standard 88 keys, 20 trigger pads, 4 analog controllers, 9 analog sliders, 8 analog turny nobs, and a dozen or so buttons like "Select" "pause" etc...

  9. C# by Anonymous Coward · · Score: 1

    Does all MS code need to be written in the key of C#?

  10. Did that 23 years ago by hyc · · Score: 2

    with my Atari ST. It was trivial then since the same chip controlled both the keyboard and MIDI ports, just redirect one of the intercept vectors to catch the incoming MIDI packets and feed the notes to the keyboard buffer.

    It's more fun to do this with a Zeta MIDI violin. I programmed it to move the mouse pointer on glissandos too, could do pretty much anything without touching keyboard or mouse.

    --
    -- *My* journal is more interesting than *yours*...
    1. Re:Did that 23 years ago by slapout · · Score: 1

      I remember playing around with GFA Basic and a Midi keyboard hooked to my Atari ST. I had it set up so that whatever note you played on the musical keyboard, the computer would calculate a note an octave higher and then send that note back out to the musical keyboard and it'd play that note. It was pretty cool.

      --
      Coder's Stone: The programming language quick ref for iPad
  11. Funny, I was just thinking about this today... by jeffb+(2.718) · · Score: 1

    It seems like there should be useful mappings between the linear layout and chording affordances of a piano keyboard, and some computer-based tasks (although probably not "typing", I'd think). Maybe a less wrist-wracking rendition of Emacs commands?

    Let's see. If you're typing with a normal alphanumeric keyboard, keystroke ordering matters, but keystroke force (velocity) doesn't, and hold time matters only crudely. How would you take advantage of velocity sensitivity?

  12. What about ... by rnturn · · Score: 1

    ... using computer code or math to make music. Back in the (early) '70s, you'd sometimes see these weird commercials where Fred MacMurray (I imagine most /.ers just said to themselves "Fred Who?") was showing how a bunch of Korean schoolkids were doing math using their fingers on their desks in a piano-playing sort of action. The commercial was for some kind of learning aid to teach your kids how to do that. (Q: Does anyone recall those ads? What the heck was the name of the technique being hawked?) This was some years before hand-held calculators even existed let alone were actually affordable. I thought it might be interesting to use that to numerically integrate equations, somehow translate the finger action involved onto a standard 88-key keyboard, and see what comes out. Composition titles would be the equation being integrated. I figured the resulting music would have sounded something like Philip Glass or Steve Reich so public performances might have been hazardous to your health in certain venues. (For example, a place like this.)

    --
    CUR ALLOC 20195.....5804M
  13. As a hardware engineer.... by anubi · · Score: 2

    As far as I am concerned... just because a MIDI port was originally used for keyboards does not mean its limited to that. A MIDI port is really quite versatile and can be used for many other things.

    Now, one thing I used to like a lot is the 15-pin game and MIDI port was on damned near every PC, and very few people had it tied up. It was simply a great way for me to get data in and out of the computer. All I needed to do was coin a protocol on my Borland C++ compiler, and talk to the port. I could always design hardware on the other end to talk to it. Shift registers. It was very easily optically isolated, which again made it ideal for what I was doing where I did not want to risk a very expensive PC because I had a ground fault somewhere.

    I really liked that port. I used it a lot when I was building custom things controlled by a PC in the early DOS days.

    Another neat protocol out these days is DMX. Used for light controllers.

    They may make these for one thing, but when you see just what it is and how it works, they have usually made something that will work for a lot of stuff.

    --
    "Prove all things; hold fast that which is good." [KJV: I Thessalonians 5:21]

  14. Shoutout for Godel Escher Bach by cpm99352 · · Score: 2

    The ridiculous summary suggesting that garbage produced from a computer program could be considered music immediately reminded me of Douglas Hofstadter's Gödel Escher Bach, where music and its relevance to AI form much of the book. The book (unlike the article) has meaningful thoughts on Chopin, Bach and AI.

    Anyone seriously interested in music & computers needs to read this book now.

  15. What's old is new again by mrgren · · Score: 1

    Two words: chord keyboard.

    I used one in '87 or '88 at SRI. It was old then, part of Engelbart's mouse/keyset interface. He first demo'd it in '68.

  16. Re:MIDI? by RDW · · Score: 1

    You can send MIDI through USB if you have the drivers and your keyboard supports it, but pro keyboards will also have dedicated MIDI ports. The idea is to transmit which keys are played (with timing and velocities, etc.) to a virtual instrument on the connected computer. When set up this way, your keyboard's built-in sounds aren't used. This arrangement gives you access to a huge range of sophisticated virtual instruments, light years away from the unconvincing beeps you probably heard in the 90s. There are single instrument libraries (e.g. from a specific grand piano) with well over 100Gb of samples.

  17. I Play Piano on a Computer Keyboard by tomxor · · Score: 1

    :P It lacks certain subtleties of a proper midi keyboard such as velocity, but with 2-3 stacked octaves it's possible to play quite a lot. Learning a different arrangement isn't all that hard, it's just like playing a slightly different instrument. I actually find certain types of playing like monotone arpeggios easier with the supper light action laptop style keyboards, i guess it's also not that dissimilar to using a programmable midi pad.

    My most fun tune to play this way yet has to be "The Halls of Science" by Mike Morasky (from portal), as a pure sine wave of course :D and what more appropriate way than performing on a computer keyboard.

    1. Re:I Play Piano on a Computer Keyboard by mangobrain · · Score: 1

      Yep - anyone who's ever composed music using a tracker should be familiar with this.

  18. Weapon of mass destruction by t_ban · · Score: 1

    Convert Windows Vista to music, hijack a shortwave radio station & broadcast it around the globe! Muahahahahahaha!

    --
    First they ignore you. Then they laugh at you. Then they fight you. Then you win. -Gandhi