Skip to content

Tutorial: Using APE with Flash 10 in CS5

Note: There is a tuturial buried in here, but the first portion of this article is background on my recent project. To find out how to compile a flash 10 movie with APE, scroll down the page a bit.

I recently spent some time in CS5 attempting to realize a concept for a new interactive web instrument. I did my first one in Java via Processing. I’m crazy about Processing because it makes fleshing out ideas fast and simple. A lot of the more complex bits of initialization and library integration are built into the development environment. The one thing I didn’t quite like was how it dealt with audio. Afterall, Processing is primarily aimed at graphical functions. As much as I dislike how bloated flash applications can become, I ultimately decided that I would need to give flash another shot.

I had spent some time in college working in flash – mostly doing silly things, although I did make one little app for our school’s composition department website

[Click the keys and be amazed.]

One big issue I had to face was where to even begin. ActionScript3 was very different than the original back when I was using Macromedia Studio. After spending quite some time grappling with the language (and in the end actually feeling quite comfortable with the new OOP bent) eventually I figured out that I would need an external library for the physics simulation I wanted. My searching paid off when I found the ActionScript Physics Engine (APE) for AS3. Many people were writing about how natural and straightforward it was, and now after using it I can agree that it’s pretty slick. After working out the simulation and everything else needed to make it functional I started to think about the audio engine. My original plan was to just use files that could be triggered and played back whenever necessary, although I had started to think of how large the movie would be to have all the files I wanted. Out of nowhere I sort of stumbled upon an audio library called SiON. I’m planning on making another post about SiON because it’s really quite an amazing library and I’ve got a lot to say about it. For now, the main thing I need to point out is that because of changes to audio handling in flash 10, SiON is not usable in any earlier flash version.

One thing I had ended up doing initially in trying to make APE work was to set the flash version to flash 9 under the publish settings. This made APE work like a dream, but as soon as I started to prototype with SiON things fell apart. What I came to understand was that APE was built to work first and foremost in flash 9, while SiON worked only in flash 10. Not something you might expect to be a big issue, but it really was.

How to configure APE to work in Flash 10

Because it took me some trial and error to get this worked out, I thought I’d spell it out here as clearly as I can for anyone else having the same problems I had. Let me say up front that the root of my problems was a compatibility issue between flash 10 and earlier versions. If you’re getting thrown some compile errors that are a little unclear, play around with the publish settings. That’s what eventually led me to this solution. This is not something I discovered myself – I’m taking what I’ve read on some different forums and putting it all here.

What you will need to do to make APE compile into flash 10 is to open up the .as files and replace all occurrences of the “Vector” function call. Apparently flash 10 introduced it’s own function called “Vector” and now everytime APE tries to call it it will throw up an error. I would recommend using a text editor such as Notepad++ for this job. This program in particular has a feature that allows you to search and replace for multiple documents at once. Even without this functionality this is still an easy fix, it’ll just take a little more time.

Look in the folder that has all of the APE files you use to link with your project (should be under org/cove/APE). Open all of the files with the extension “.as” in Notepad++ (or if using another editor just one file at a time). Search and replace for the word ‘Vector’ and replace with something unique, such as ‘APEVector’. I’m a bit paranoid when editing stuff like this so rather than using the “replace all” option I instead elected to verify each one. Once I’d replaced each occurrence, I recompiled the movie and everything worked smoothly in flash 10.

I know that was a lot of information for such a quick fix, but I always appreciate it when people provide a little perspective to help set the context.

Next time I’ll talk a bit about SiON and why it’s the only sound library flash will ever need.

Bookmark and Share

07.01.2011 – Online Score Editor: Noteflight

Noteflight online score editing software – http://noteflight.com

Years ago as online cloud document creation began to take off, I found myself constantly wishing for a portable online score editing solution. Well a couple of years ago I was lamenting this exact situation via facebook and someone responded with this site – Noteflight. At the time, it lacked a few things I had grown accustomed to on my big fat Sibelius workstation. But more recently, I have begun to regard this site as an indispensable part of my creative workflow. Due to recent updates, Noteflight continues to close the gap between itself and it’s more fully featured desktop counterparts. And it’s free.

Here’s why I love Noteflight right now: it is an ideal sketchpad. I consider myself quite old fashioned in that I am infatuated with paper and print and sketching in the physical medium, but this program does one thing my paper cannot – it is cloud based. No matter where I am now, as long as I have a flash capable and internet connected computer, I can access scores of varying degrees of completion. And when a score starts to get to the level completeness that I need to start formatting and editing, I can (if i haven’t already) export the piece as MIDI or music XML and import directly into Sibelius. Plus, their most recent update added the ability to input using a MIDI controller (a beta that I am proud to say I was invited to participate in). I can assure you that Noteflight is nowhere near being ready to replace Sibelius for me, especially as a self-published composer. But a subscription, which opens up more features and greater storage space, will set you back $50 a year. One of the most inhibiting steps along a young composer’s path is figuring out how to get your hands on a very pricey copy of the software that you need. Now for $50 (or free!) anyone can have access to some rather impressive notation/sequencing/engraving tools.

If I could have just one gripe, it’s that I wish there was more of a mature community with which to interact. The site has a social networking element to it which I think has the potential to make this a really amazing site, but most of the people with whom I’ve interacted don’t really seem to be on a very high level of discourse on the topic of composition. Additionally, you have the option (not mandatory) to share your scores with other users. This would be another great feature if I could find some people on there with constructive insights. I don’t have anything against the users who make the site like this, in fact it’s great to see so many people involved in composing, but many of them seem to be very young and without experience.

Regardless of my subjective complaint, the editor is fully featured and the community is friendly (and you don’t have to make any of your scores public if you don’t want to). I would highly recommend Noteflight.com whether you need an on-the-go bank for your ideas or can’t yet afford Sibelius or Finale and need a fully capable editor.

Bookmark and Share

02.26.2011 – Guitar Project: Codename “Eternity”

Guitar hardware

So here is the full historical rundown of my guitar-making shenanigans. The tone is a little clinical, but I had a lot of information to put out there, so if that bothers you then you can just look at the pretty pictures :)

When I started building this guitar a year ago, I had pretty high hopes. I felt pretty good after successfully building the hammer dulcimer, and if anything felt like the guitar would be simple in comparison. 3 guesses how I’m feeling about it now. I’ve teased it with some pictures on facebook, but I wanted to more or less keep it under wraps until it was finished. Well, I don’t think I could really say that it’s “finished”, but I think I’m at the point where I’m going to set it aside strategize how to improve/revamp the original design. I predict that it will be a long time before it’s completely optimized, thus the “eternity” project title!

One reason that I wanted to do this in the first place is that I felt like I could come up with a design that used custom components to create some kind of super guitar that would be really versatile and have a great sound. The body was built out of pieces of ash. I was really inspired by looking at the design of PRS guitars and thought a body based on the Les Paul shape with the curves of the PRS would be a good place to start. I was using a really great book as a guide but as soon as I started reading about the work involved in making the neck, I made the decision that I would rather order a stock neck that was already fitted with a truss rod and fretted. All I had to do on the neck was drill the tuner holes and carve out the shape. I had some fun designing the shape of the head – I gave the under-side sort of a mobius curve so that when I painted the face black, you would see this subtle transformation in the geometry.

One big problem I had was when I started cutting out the shape of the body. Let me say at this point that I do not own my own set of shop tools yet so a lot of the carpentry was done in my Dad’s garage with his help. The first thing I tried was a bandsaw. I realized pretty quickly that the wood was heavier and thicker than our saw could handle – it kept jamming up every 30 seconds. We ended up rip cutting a close rectangular shape on a table saw, which even then was a constant struggle. After that, I cut some angles that got pretty close to the outline. Once I had done that, the bandsaw was finally able to handle the contour with some versatility. When it was close enough, I fired up the router to clean up the curves. I had used the bandsaw earlier to cut out a plywood template so that I could use a deep cutting router bit and smooth the edges. Finally the body was done.

For the body cavities (pickups, electronics, whammy bar) I probably should have tried to make some more templates. I found out that I need more practice on the router to be able to cut things freehand, so I ended up using a drill press and a chisel to make the cavities. Super rough, but in the end it was super effective. At this point I was ready to paint it, which once completed would take around a month or two to cure completely. I fitted the hardware components to make sure everything lined up the way it was supposed to. I actually strung it up and played it for a couple of weeks before finally finding a place where I could let it hang for a couple of months without being disturbed. During this time I was thinking about what I would need to do with the finish once it was dry. I researched a lot of options for polishing and finishing and whatnot, but when it dried the glossy enamel I used turned out to be hard and smooth enough to stay on its own. Apparently I didn’t do a good enough job of sealing the wood before applying the paint because after it had dried there was still a faint suggestion of the grain visible. Eventually I came to terms with it and decided that the grain gave it a unique look, so it remains.

Now let me tell you about the electronics. In a way, working on the carpentry was a nice diversion because as long as I was cutting or chiseling or painting, I didn’t have to think about the insane work of wiring all of the components together. I ordered two humbuckers from guitarfetish.com, 2 double pots, a 4-pole 5-way selector switch, 2 orange drop caps for a creamy vintage tone, and an active electronics circuit that includes overdrive and EQ presets. So basically I combining all the best assets from gibson and fender design and added as many configuration options as I could. With the 5-way switch, I was able to wire the pickups in a way that you get standard humbucking but also single coil action. The problems came when I realized what kind of frankenstein monster I would have to hide inside the control cavity. It took a lot of research and planning to come up with my theoretical wiring diagram. Eventually, I was able to come up with a design that preserved 99% of my conceptual objectives. The only thing I lost was the individual volume control for each pickup. I just couldn’t figure it out, so I ended up sending the master output through a single volume pot.

Circuit "diagram"

I have never had a huge amount of experience with wiring and soldering, although I felt comfortable enough to give it my best shot. Using my super amazing diagram I drew up earlier, I spent about a week soldering when I had the time. It wasn’t the cleanest job in the world, but it seemed pretty solid and the solder points didn’t fall apart when I finally installed everything into the cavity. I must admit that I was a little apprehensive because during my reading I had read a few cautionary tales about electrical safety when hooking up the amp. After trying it out with a pair of gloves for an extra layer of safety, I felt confident enough to give it a proper test. The kitchen wasn’t on fire and I was still alive, so the test proved to be mostly a success. What I discovered, though, was that I was getting sound out of one pickup but not the other. There’s also this nasty hum whenever I touch the strings, so I guess I’ve got a bad ground somewhere.

Cavities

I have cavities

At any rate, version 1 of the Eternity guitar is about a 60% success. I can hear it in the amp, and what I hear sounds pretty nice, but more work needs to be done. I think I will probably take it down to a bare-bones wiring setup and after I get each stage of it working, I’ll add the next component. For now, I just need some more time to think and plan before I come back to it.

If anyone has any ideas or input, I’d love to hear your thoughts. Stay tuned for more developments!

Bookmark and Share

02.08.2011 Promotional Consideration

Well folks, it’s been a crazy few months. In my blogging absence, plenty of exciting things have been happening in my personal and professional life. I continue to be proud of the balance I’m able to strike between my teaching, directing, and composing. Recently I sent out a slew of marketing materials as I prepare to accept the role of publisher and distributor of my own works. So if you want to know where you can buy copies of my work, come straight to me. It’s fresher that way. I’m like a farmer and my website is the farmer’s market.
All in all, I’m moving the direction I want to be moving. So really this post is more of an update than anything else; I hope you won’t mind! Keep an eye out as I’m constantly working on new things and expanding my range. What’s next, you might ask? World domination. Right after I finish building my guitar.

Bookmark and Share

05.26.2010 – Self-reliant Printing

One small step for me, one giant kick in the face to Kinkos. My new coil-binding machine came in the mail to day, which is the perfect companion to the boxes of coils that came a few days earlier.

bind01

With this one machine, I will never have to listen to a print-shop employee try to explain to me why he can’t bind my 17″ score, when someone a week earlier at the same location was able to do so easily. Not to mention that each score costs on average $6 to bind at the shop while now all I have to pay for is the coils and covers (probably about 25 cents per score). Here is my first attempt on a 17″ score:

bind02

Clean and easy. If you are a composer and are currently printing your own scores, there is no reason not to purchase one of these machines. While I have a staple binder I use for orchestral parts and choir pieces, other types of scores are better coil bound. Comb binding machines cost marginally less, however it is not so easy to turn the pages in a comb-bound score and they often bunch up at exactly the wrong time. Coil binding allows fluid turning of the pages and generally looks a bit nicer.

Seriously – you need one of these.

Bookmark and Share

04.17.2010 – A Life Alive

You would think that having narrowly escaped the past few months with my life (and my jobs) following my recent and massive projects that I would want to spend some time away from composition. You know, “let’s give it two to three months” or something. Instead, I have volunteered – that’s right: there are no maniacs holding me at gunpoint – to compose a brand new work for an upcoming benefit concert. My wife’s friend Violeta Trapcheva (who the astute reader will remember helped me record some pristine samples for my Passion thesis) has decided to participate in the Susan G. Komen Race for the Cure, a race and fundraiser meant to benefit breast cancer research. As a part of her efforts to raise money, she is organizing a benefit concert featuring a handful of very talented local musicians (see the Facebook event page for details). When I was invited to participate, it occurred to me that this is a great opportunity to premiere a new piano piece; after all, I’ve been meaning to get a new piano piece going for some time, and as they say, no time like the present.

I had some very specific goals, though, for this piece. One thing I have been forced to face since finishing my studies is the issue of accessibility. While studying, I had all around me an audience that had a great appreciation for all sorts of contemporary smoke and mirrors as far as technique goes. Now, the audience that I have access to is filled with regular people – people who are certainly capable of appreciating music but have little patience for academic rhetoric and technique-centered works. For that reason, my most recent works have balanced elements of faux-tonality with engaging counterpoint and unexpected harmonic architecture. The piece has a lot of energy, a good deal of pathos, and makes for an interesting listen. Essentially what it comes down to is my ongoing objective to refine this aesthetic so that I can compose music that people can really enjoy while I avoid feeling like I’ve pandered.

One parting bit of trivia: the title of the piece is meant to reflect my motivation behind the work. Jonathan Swift is know for saying, “May you live all the days of your life.” It entreats the listener to be conscious of the fact that every second of our life is a gift not meant to be squandered. I hope you all will live A Life Alive.

Bookmark and Share

03.31.2010 – Film and Liturgy

I have again become remiss in keeping this site fresh with my latest thoughts. It’s just that when I usually have important projects with impending deadlines – the time I would most like to post about the details of my craft – it is most difficult. So now I will try to summarize my two latest projects that have taken up so much of my life.

One of my recent opportunities was something I’ve dreamed of since I received my first composition notebook as a child. I was approached by a friend who asked me if I would be interested in providing a score for a movie he was involved in. We talked for some time about the film and what the director’s vision was for the original score. In some ways, the experience was slightly different from what I had expected. My understanding is that typically film composers come into the picture at nearly the end of the process. I was invited before the first full draft of the film had been edited together, which actually turned out to be a great thing because I was able to spend lots of time up front churning out concepts and demos and getting plenty of feedback along the way so that when I did finally get the rough cut of the film, it did not take long at all to adapt my ideas to the scenes. The main texture that the director kept emphasizing his interest in was a sort of gritty guitar/drum driven arrangement. I ended up using Logic for the whole process, from sequencing to sampling and synth as well. I was actually surprised at how life-like Logic’s instrument samples are, in particular their guitar samples. Once I actually started scoring to the picture it didn’t take more than a month and a half to complete. Working on it was so much fun and so fulfilling. Sometimes it was a bit tricky getting the timing just right, especially when attempting to sync with some visual cue in a place where a smooth rhythmic connection was nearly impossible. And even though the score was more rock/alternative, I assure you that I did not betray my contemporary classical roots. The main theme for the titular computer program called Zero One is written in the key of C-sharp, and for the sake of continuity each time it returns it appears in the same key. If you know your set theory, you know that c-sharp is denoted as pitch 01. Take that! It was really terrific to have such an opportunity and I hope I will have to chance to do more like this in the future. I don’t know anything about release dates or anything but I will post again when I hear something.

My second big project is my cantata I’ve been working on for our good Friday service. It is a setting of The Seven Last Words of Christ. For more information about the history and technical layout of the piece, I’ve written a brief essay here.To be quite frank, it all started because I could not find anything in the current literature that was particularly interesting and at the same time was technically approachable. I tend to stay away from overly-sappy musical offerings, which most of what I looked at had in spades. I consider my setting to be very thoughtful and intelligent. I did stay away from the dissonant textures I’ve favored recently and instead went for a sort of re-engineered tonality. The movements themselves are in tonal keys, but the rules governing chord progression and harmony are a little different than traditional theory. In some cases, the rules may represent alternately deconstructions and reinterpretations of the rules, while at others they may play off them as a caricature. As I mention in the essay, the high-level organization is based on a 12-tone row, one of my recent obsessions. While the textures do not reflect this, the form as a whole progresses through 12 key areas linked to the row. Numeric symbolism also plays a part, as the row itself is built entirely on thirds. What is interesting to me, looking back on my finished project is that my Passion which remains unfinished (I only completed the first half for my thesis) and unpremiered (it is extremely difficult to sing and even more difficult to find a choral group willing to give it a chance) is quite literally completed by the Seven Last Words. Not only does it complete the narrative from where the first half left off, but it represents a more approachable standpoint, both technically and aurally, in effect balancing the difficulty of the Passion.

I’m super excited for Friday night’s premiere of this work; it’s been a while since I’ve had a chance to present such a long composition to the general public and I look forward to seeing how people receive it. I’m also looking forward to seeing the final version of the film after it emerges from the other side of syncing and mastering. Most of all I am thrilled and count myself so blessed that I am able to balance my life as a music teacher and choir director with that as a composer. I find all of my work to be extremely fulfulling but would be devestated if I was unable to compose.

Hope to see some of you Friday night at Cornerstone Methodist in Garland. If you can’t make it out, I will try to post some clips this weekend.

Oh, and lest I forget: I gave the website a minor update so you can once again hear my music. Just go to the main page and look at the bottom. Also have some new pics on the photo page.

Bookmark and Share

01.27.2010 – iPad

Say what you will about Apple’s new touch-pad computer, the iPad, but consider for a moment the amazing possibilities for interactive musical applications. Anything from practical control surfaces such as mixer-boards or piano-style input to conceptual instruments and interfaces that utilize the accelerometers and multitouch technology in astounding ways. My head is just full of possibilities. I’d better go start filing patents.

Bookmark and Share

12.24.2009 – A PureData Christmas

So, this is what I was working on last night as I drifted off to sleep. Some will dream of gumdrops and candycanes. I dream of object boxes and midi connections.

I wanted to apply myself to a gift I knew teh internets would appreciate. What better way to say Happy Holidays than with a Christmas tree that sings Carol of the Bells when you click on the lights? I rigged it so that every time you click one of the circles it will loop a portion of the carol until you click it again to unloop it. Check it out:

merryxmas.mp3 <- download

Festive, no? If you have PD and would like Santa to bring you the source code, write a letter and give it to me, and I will make sure he gets it. :)

Bookmark and Share

11.28.2009 – In C++

Ever wished you could have your own 10-piece ensemble that lived in your house and would play “In C” for you whenever you had the desire? Well, I’ve just completed a project that may make that dream a reality. Well… maybe not reality, but pretty darn close.

I’m satisfied that at least one of the many projects I’ve started recently seems to be coming to a conclusion. Not too long ago I had the notion to start a project that would combine my hobbyist-level programming skills, my appreciation for Terry Riley’s modern classic “In C”, and my penchant for witty project titles into a software tribute to this masterpiece of minimalism. I’m surely not the first person whose mind has wandered while listening to “In C” and made the connection to popular programming languages C and C++. As a matter of fact, in order to save myself a little embarrassment I googled it to see if anyone had tried something like this before. I discovered one such project, but decided that I could take it to a different level and provide a different perspective. Besides, it really sounded like fun.
So I started to lay out my my goals for the end-product: I wanted to write a program that would present the user with their own personal and unique performance of Riley’s venerable piece. When you start the program, you have three controls: relative length of performance, start, and stop. When you press “Start”, the program reads the placement of the “length” setting and begins to work through the score. It chooses a random configuration of instruments and octave displacement for those instruments and begins to play. From there it’s pretty simple: each instrument is programmed to make it’s own decisions regarding the established rules of the piece. Pacing and dynamics are decided on the fly, making the program seem surprisingly non-artificial. I can actually start the program while I’m working on something and enjoy listening for several hours as my computer provides a personal interpretation of this great work.

If anyone has an Intel mac and would like to demo the program, I would be happy to pass it along.

Bookmark and Share