• 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
Still is ... HELP!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Still is ... HELP!


  • Subject: Still is ... HELP!
  • From: djl <email@hidden>
  • Date: Thu, 31 Aug 2006 20:51:06 +0100

Jeff, Joel, Steve, Fredrik,
Firstly, thanks for all of your feeback/responses.
FWIW I'm running Xcode 2.4 on Mac OS X 10.4.7 on a 15" PowerBook G4/1.5Ghz with 2MB RAM.


Fredrik, do you have a link to a download please?

Joel definitely has the right idea with regard to what I want to do and I appreciate his help in keeping this thread alive.

Jeff and Steve, despite mentioning that 'I'm no C, C++, Obj C or Java programmer', I can't honestly believe what I want to do is so complex and (reading between the lines of some of the comments) would involve THAT much code. 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. Hence joining the list to ask for advice and to be (hopefully) pointed in the right direction.

Correct me if I'm wrong, but the sample code for Echo.cpp looks for attached MIDI devices and echo's the result?
How difficult can it be to keep a loop going that calls whatever commands are required to 'read' a MIDI In note-on event and echo that too?
It seems a quite simple and straightforward request to me irrespective of if it's deemed to be an unorthodox method/solution.
Please bear in mind that I have a very simple requirement here.
Maybe I need to elaborate somewhat - it doesn't need to be particularly responsive, I'm not attempting to write a Logic Audio killer app!!!!!
It doesn't even necessarily have to provide an option for various MIDI input devices (would be nice, but certainly not a must-have at this stage) - so long as one is attached and keys are pressed then all the app needs to do is return the decimal value of the note on message. I don't need after-touch, note-off, velocity or volume data either.


I'm pretty sure I can't describe or explain what I'm after any clearer than I have. Suffice to say, and as I mentioned in my first post, the rest of the coding I can do, no problem.

Re: the comment 'You seem to have decided on a set of tools and part of a solution before analyzing the problem', I agree and disagree. Yes, I have decided on a set of tools and part of a solution but this was done as part of 1. analyzing the problem and 2. as a result of being happy that I have the necessary knowledge and experience to get all the other bits working, albeit in the way I know how.

With regard to this comment 'Granted, I'm not totally up on what all AppleScript can do' - obviously not, otherwise you wouldn't have continued to say 'but the solution presented by the original post is totally unworkable'. In addition, I never once mentioned anything about storing a value in a file!?!?!?
If you're like this with AppleScript then perhaps you'll realise how I feel with regard to using XCode to do accomplish this (trivial and what should be simple/straight-forward) task.


I hope I've been clear enough with what I want to do this time and I await your comments/replies.
Thanks for listening,




David




On 31 Aug 2006, at 17:52, Jeff Moore wrote:


On Aug 30, 2006, at 7:27 PM, Steve Majewski wrote:


On Aug 30, 2006, at 8:58 PM, jbrave wrote:

Hmm - forgive my ignorance of the deeper aspects of OS X, but couldn't someone write a little C proggy that waits for midi inputs, and stores the result somewhere that his applesscript could check - like a text file with a flag 0 if none, keypress, 1 if there is, followed by the note #, his script would launch the program which would run in the background, and then his script would just check the text file periodically? Is that really impossible to do? Then he could just hire someone to write the little app for him, and he could continue writing his script, without having to learn the nitty gritty of java etc?


I didn't say, nor did I mean to imply, that it was impossible.

Actually, I think it may very well be impossible given the parameters laid out in the original post without doing some deep coding. Granted, I'm not totally up on what all AppleScript can do, but the solution presented by the original post is totally unworkable. Hence my and Mr. Majewski's answer.


BTW, storing the info in a file isn't any better than forking another process. It has the same sort of limitations.

The "No" was in response to his very specific question:

So, being that I'm no C, C++, Obj C or Java programmer is there anyway to easily create a command line executable that can be called from AppleScript's 'do shell script' command to:-

1. run in the background waiting for a key press
2. return the decimal value of the key pressed
3. exit/quit

No -- There's not an easy way for a non-(whatever)-programmer to write that program,
and if it were written to those specifications, it also might not quite work as required.


But perhaps I was trying too subtly to imply what Jeff Moore just simply said:

Perhaps you ought to step back and explain what you are trying to do and perhaps folks can chime in on ways to make it work.


The original poster seemed impatient in his second message, that no-one had yet answered the
question in his first message a day earlier. I suspect that one reason for the initial silence was
the way he asked the question, and that since "No" doesn't seem like a very useful answer,
most people are likely to just not reply at all. ( And since I didn't want to leave it at just "No"
myself, I tried to describe the easiest path that came to mind, even if it doesn't fit his stated
requirements. )

Amen. I have yet to see an answer to this query. All I've seen is a tiny window where the original post suggested a specific solution without providing the details as to what the actual problem is. For example, what is the program trying to do? Why does it need to interface to the MIDI hardware? Why does it need to do it in this awkward way?


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.

Of course, another solution would be to just switch to a scripting language that already knows how to call out to the native frameworks on the system, like Python or Perl.



On Aug 29, 2006, at 8:48 PM, Steve Majewski wrote:


On Aug 29, 2006, at 6:51 PM, djl wrote:

Can anyone please advise on my previous request/post/message?

Many thanks in advance ...


I think the answer to your very specific question is: No.

Hi there,
I'm after some advice/help and would appreciate your comments.
Basically, I'm trying to create a simple application primarily using FaceSpan (and hence AppleScript, not AppleScript Studio) and I need to, if possible, call a command line executable that returns MIDI In data.
I don't need to capture any data other than the MIDI note number of the key pressed eg, I don't need velocity, after touch, note-off or volume data or even the ability to route the MIDI anywhere.
So, being that I'm no C, C++, Obj C or Java programmer is there anyway to easily create a command line executable that can be called from AppleScript's 'do shell script' command to:-


1. run in the background waiting for a key press
2. return the decimal value of the key pressed
3. exit/quit

Hoping you can help!
Kind regards,



If you want some more general advice, I think writing something in java using javax.sound.midi package
might be somewhat simpler and easier than programming CoreAudio in C/C++/Obj-C.


You can also call java packages from jython ( python in java ) or rhino/javascript, but this isn't exactly
a magic bullet. You have to understand java and the javax.sound.midi package, as well as how the
data corecions between java and the scripting language work to use it, so it's as best, a way of avoiding
having to write everything in java.



But, as Jeff Moore noted, it probably won't work to make a program that runs once to grab a key press and exits.



You seem to have decided on a set of tools and part of a solution before analyzing the problem.
That may be part of the problem.



--

Jeff Moore
Core Audio
Apple


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


This email sent to email@hidden

_______________________________________________ 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
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: Re: was: HELP!
  • Next by Date: Re: was: HELP!
  • Previous by thread: Re: was: HELP!
  • Next by thread: Re: was: HELP!
  • Index(es):
    • Date
    • Thread