• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: was: HELP!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: was: HELP!


  • Subject: Re: was: HELP!
  • From: Daniel Jalkut <email@hidden>
  • Date: Thu, 31 Aug 2006 16:11:40 -0400

On Aug 31, 2006, at 12:52 PM, Jeff Moore wrote:
One other thing I'll throw out there: Back in OS 9, AppleScript supported Scripting Additions which were bits of native code that added capabilities to AppleScript, much like XCMDs did for Hypercard or JNI does for Java. I definitely recall somebody, back in the day, writing a Scripting Addition that interfaced to OMS and/ or the MIDI Manager. The best possible solution to this problem would be a similar approach that connected AppleScript directly to CoreMIDI, provided that AppleScript still has something like Scripting Additions in it.

For the record, AppleScript never stopped supporting Scripting Additions. You can install them on your system today in ~/Library/ ScriptingAdditions for example. Apple even continues to ship some of their own in /System/Library/ScriptingAdditions.


The bigger problem with trying to do something like this in AppleScript is that AppleScript is not good at blocking for user input. Even when the "wires are hooked up," for instance when trying to detect a regular old typing keyboard key press, scripters tend to need to jump through all kinds of hoops to make a script "notice" when it happens. This usually involves some crude combination of sleeping and polling. So even if there were a "MIDI Interface" scripting addition, it might be hard to achieve exactly what the original poster is looking for.

On Aug 31, 2006, at 3:51 PM, djl wrote:

I know what needs to be done from the example code (Echo.cpp) but don't have the experience/means to execute the changes as I don't know enough about the frameworks and coding conventions to call the required commands etc.

If I'm getting the original poster's gist, he wants to be able to react with an arbitrary script when a keyboard note is pressed via MIDI. If the "Echo.cpp" example does indeed do everything except the "calling his script," then perhaps some combination of Echo.cpp with the AppleScript handler execution described here:


http://developer.apple.com/qa/qa2001/qa1111.html

Would be a step in the right direction. I think instead of attempting to make the script itself detect key presses in this case, it would be better to aim for a standalone program that dispatches to an AppleScript (or other script) in response to key presses.

Daniel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: was: HELP!
      • From: Jeff Moore <email@hidden>
References: 
 >HELP! (From: djl <email@hidden>)
 >Re: HELP! (From: Steve Majewski <email@hidden>)
 >Re: HELP! (From: jbrave <email@hidden>)
 >was: HELP! (From: Steve Majewski <email@hidden>)
 >Re: was: HELP! (From: Jeff Moore <email@hidden>)

  • Prev by Date: Still is ... HELP!
  • Next by Date: Re: was: HELP!
  • Previous by thread: Still is ... HELP!
  • Next by thread: Re: was: HELP!
  • Index(es):
    • Date
    • Thread