artist newbie with odd problem - any help would be HUGE!

Dear scripters,

I am an installation artist working with a composer and scientist to make music from the movement of a candle. I gotten most everything I need done with applescript.
I have been able to pull off high contrast gifs for each still in a clip in final cut, then recursively process each still and histograms in photoshop to store a series of integer values in Excel. When I graph my data in the Excel both my collaborators agree it looks like sound. That’s great but… The problem is that to make music from the data the composer needs it in the form of a sound file. I need a hack to get my data written as a AIFF sound file. I have been researching for months on the file format and conceptually it’s easy, I know everything I need for the header and the sound data is just my signed intergers that I have already calculated but in a binary structured format.

Here rests the problem, Applescript does’t handle binary I/O. I been trying to use Xcode to write a program to write the correct structures for the header and data to disk with no luck. I know enough C to follow source code (although I haven’t programed in C in twenty years) but I am so lost trying to understand how to use Xcode/Carbon file management that I can’t seem to get off the ground. (the old fprintf() just doesn’t flyjavascript:emoticon(‘:shock:’)). I discovered in the API for Quicktime that there is call for making a AIFF header but I don’t see it when I look at the quicktime scripting dictionary.

In a perfect world I would like to able pass the header parameters to quicktime and let it make my header(which is the more compex structure) and have a C function that I can call inside the loop as I process each still to which pass my current integer value and the filename and it will place the integer in the correct sound data structure and append it to the file.

Any help on using quicktime APL calls or sample Xcode source code on writing binary files that I could try to use to figure out how to write to disk using carbon… I have read thru all the tutorials and apple documention I could find but none seem to address my problem (but if you know of one I would love to have the link) I know there is some elementary concept I not grasping but I have been working on this for months and I stuck…

Thanks for your help in advance

ummm… holy s**t dude thats awsome!
I wish I could help you, but Im just now getting into apple script.
maybe you could assosiate the values you get into excel into midi values, then you would have music.

As powerful as Xcode is it’s not necessary to master it to integrate AppleScript and C, of course…Is there a reason you couldn’t just develop your C in Terminal to produce the AIFF binary and invoke it via do shell script? I suppose the answer to that question is “yes” if you’re not familiar with a Unix editor such as vi :slight_smile: but if you are, well then…

  • Dan

Why dont you try REALbasic. it makes it really easy to intergrate applescripts with the realbasic code. you basically drag the applescript into the project window and then use it as a subroutene. its verry nifty. and if you’ve used applescript then picking up realbasic wouldnt be to hard.

Sounds like you’ve identified you’re limitation… If you calculated the data into binary, and Applescript doesn’t handle binary, then make an educated guess on your chances of making that work. IF you want to use Applescript you will have to put the data in a form Applescript can deal with. Trust me, there are creative ways to manipulate that data with Applescript. But I agree with Dan, why not use a more powerful language? Sounds like you could get into a shitload of variables and end up with a huge script.
The basic concept is pretty simple though. correct me if I’m wrong:
1 Translate gifs of time lapse stills of a candle
2 associate the image to a predermined set of parameters
3 associate the parameters to pre-existing AIFF files
:?: (Or if you’re crazy associate the sound to parameters to build AIFF’s…no…) :?:
4 when a parameter is met, the pre-existing AIFF triggers
SC

Ok, this thread is old, old, OLD!
but WOW! is this project available to view anywhere online? I’m guessing that after 5 years perhaps you’ve gotten it to work. I’d LOVE to see this in action!