StandingWave: Live Musical Audio Synthesis in AS3

December 4, 2007 on 7:16 pm | In Flex, Music, Programming | 10 Comments

I’ve been working on a funky new homebrew software project called StandingWave: a musical audio processing engine built entirely in Flash. My goal in doing this is to explore a world of online interactive music applications in which audio is not merely played back, but generated on the fly — performed, in fact — from an underlying representation of musical events. Such applications might range from a traditional music notation editor to game-like music composition environments to… knows?

Computer music performance is hardly something new, of course. But embedding the capability in Flash, at this point in the world, can make musical applications accessible on the web and amenable to community use in a way that’s never been possible before. Think about what applications like Buzzword and Google Spreadsheets are doing for traditional “productivity apps”.

I’ve started with the audio engine because it’s an interesting technical challenge, although I’m working on some of the other pieces concurrently. I’ve put up an initial crude example that demonstrates sample-based waveform synthesis. This toy application can play back single notes, a chromatic scale and a sample MIDI file at various transpositions, tempos and volumes, and all of this is accomplished by actually synthesizing digital audio signals on the fly, starting from a set of recorded guitar samples and applying gain envelopes, frequency shifting and mixing. Musically, it’s hardly exciting, but it’s a start on the capabilities needed to concretely deliver music in the Flash Player with no external add-ons, and without leaning on the crappy, highly variable MIDI playback delivered by the browser’s native OS.

There’s no waveform audio output API in Flash, so how is this done? Read on…

[Continued…]

10 Comments

The TSA Has Determined That My Cheese Is Not Explosive

November 30, 2007 on 4:44 am | In Miscellaneous, Travel | 8 Comments

Mt Tam Cheese In Bag

Before leaving San Francisco for home in Cambridge, I stopped at the Ferry Building on the Embarcadero to pick up a few gifts for home. Among them was a small muffin-sized package of delicious, creamy Mount Tam cheese from Cowgirl Creamery in Point Reyes, CA, a favorite of my wife’s. I stashed it in my shoulder bag before catching the BART train to the airport.

Arriving at SFO I pleasantly breezed through the metal detector on my way to the gate and waited for my bag and laptop to come through the X-ray machine. The pleasant breezing sensation then came to an abrupt halt, as did the X-ray conveyor belt. My bag went back and forth through the machine several times.

“Can I please open your bag, sir?” a TSA contractor asked me. Her shoulder insignia read “Centurion Security Services, S.A.F.E.S.K.I.E.S.” emblazoned on a ferocious eagle-and-flag backdrop. I wondered what on earth the super-sized acronym could possibly stand for.

“No problem.” I’m not inclined to be overly protective of my bags’ privacy in these sad police-state times we live in. I assumed that the shape or size of something in my bag reminded someone of a sample X-ray they remember from the TSA X-ray Analysis training seminar. I didn’t want my behavior to remind someone of something they saw in some other TSA seminar, such as that fascinating Strip-Search Profiling Criteria class they took. I put my shoes back on and waited while, after several rummages, the cheese emerged. Much examination and discussion took place as the cheese was passed around and looked at from many angles. It received several prods and squeezes.

“We’ll run your bag through again, sir.”

[Continued…]

8 Comments

Going to (and speaking at) Flex Camp Boston

November 8, 2007 on 3:45 am | In Flex, Programming | No Comments

Developer Brian Rinaldi is organizing a nice, cheap, fun, local event called Flex Camp Boston at Bentley College just outside of Boston. With a single track of speakers, limited enrollment, and targeting an intermediate/advanced audience, it should be a nice intimate event and a great way to exchange information with other Flex practitioners. Tim Walling and I will be speaking there about the AIR prototype of Allurent Desktop Connection that we worked on a couple of months ago. Not only am I happy to be going to a pleasingly small mini-conference, but the travel time there will be pleasingly short for me and other Bostonians. Waltham is considerably closer than Chicago, Seattle, Atlanta or Milan. Besides, it’s $10 — how can you not go? Case closed.

No Comments

Flex Builder Source Folders Need to Go Back in the Oven

October 31, 2007 on 2:56 pm | In Flex, Uncategorized | 7 Comments

“The pain, the pain…”
Jonathan Harris as Dr. Zachary Smith in the original Lost in Space

Dr. Smith was famous for whining, and so am I. Here’s my latest: Flex Builder does not work very well with multiple source folders in a project’s path. Probably the worst breakage is that integrated SVN source control (via the Subclipse plugin) doesn’t work inside them (FB-9989). Second worst would be that library projects can’t compile classes from multiple source folders (FB-9988). Yet another baddie: FB-5564: if you use Ctrl-click to navigate to a definition in a class which is in a linked source folder, a new window is opened unnecessarily, as if FB didn’t know that two files were actually the same. All this is too bad, because source folders are a really good solution to another serious problem with Flex Builder, and one that is probably harder for Adobe to fix: poor performance with multiple library projects.

If you’re using Flex Builder on some large applications with a number of library projects, you may have noticed it gets real slow. Yeah, I’ve noticed that too. It’s too bad, because using lots of small-to-medium libraries forces developers to be much more careful about dependencies between packages.

At Allurent, our approach to this problem has been to structure our Flex Builder projects for speed rather than strict dependency checking. We use Ant for all production builds (it builds multiple .swcs for dependency checking), while developers can use Flex Builder for incremental builds while they work on a project, if they want. To get around the big slowdown problem, we create mega-projects that include all the libraries’ source code directly via multiple source paths. While such projects are slow to open and start up, once you build them and warm up Eclipse’s caches they perform quite well.

The big fly in the jam jar — I know it’s usually ointment that metaphorical flies get stuck in, but that phrase gets kind of old, doesn’t it? — is that source folders are kind of semi-functional in Flex Builder. The fact that Subclipse doesn’t treat the contents of source folders as versioned (even if they are) is really frustrating. Maybe some folks out there are frustrated too. If you are please consider voting on the above bugs!

7 Comments

More about Barcelona

October 20, 2007 on 8:22 pm | In Travel | 1 Comment

As I mentioned in my previous post, I just returned from a 3-day trip to Barcelona. My wife and I had a truly wonderful time there, and I really have to recommend it as a destination. It has a unique flavor as a city, with a lot of cultural, visual and culinary delights. Three days (with much of them occupied by a conference) hardly makes for a panoramic sense of such a rich place, so I’m just going to set down some of my impressions and experiences without trying to do the place justice.

I’ve put together a small photo album with a few of my favorite pictures from the trip. I’m not going to embed them all in this post, but here’s one emblematic building by the architect Gaudi:

Gaudi's Casa Batllo at night

There’s a lot I don’t know about Gaudi, but when I experience his work close-up I see a mixture of iconoclasm and daring coupled with tremendous patience, craft and respect for his materials. And this kind of spirit seems to be present a lot in the city in some form or other. It’s an exciting social nexus where people seem to rush around, shop like mad and party until late at night (just try eating dinner before 9 pm), but at the same time attention is paid to the details of civic life. Things seem to work in Barcelona, and work well.

There’s a great variety to the look of the city. It includes broad avenues with spacious Parisian-style intersections, lined with graceful stucco apartments sporting fantastic wrought-iron balconies. It also has medieval warrens of narrow Gothic alleys, mad modernista Art Deco storefronts, and of course some drab blocky buildings. In most places there are many delightful details and touches: someone cared how something looked. And like my hometown, Chicago, there’s a willingness to be playful with civic art and architecture. Playfulness counts for a lot in my book.

The food is truly great (especially if you like seafood), but I recommend getting away from the main drags and finding somewhere a little less geared to tourist tastes. I have to mention one fabulous dinner we had, at a restaurant called Passadis Del Pep. We heard about it from a friend who used to live in Barcelona and got its address on the web, but had some trouble finding it. We finally located it purely by address — there is no sign out front, just an anonymous doorway with no restaurant visible inside. You have to have faith that something is there and just keep walking further into the building. Eventually we wound up in a wonderfully intimate and friendly space with sort of a cellar-bistro look. There was no menu; the waiter simply started bringing food to the table. Eight small and intense courses of local seafood later (I think there were three different varieties of shrimp, each with its own distinct preparation and taste), we barely managed to get out of our chairs and leave. One of the best meals ever! Not for people who don’t like looking at the faces of the animals they’re eating, though.

I have to give the Barcelona Metro some props on their user interface (and on the fact that the trains run very frequently). On some of the lines, there’s a little linear map over each door showing the stations on that particular route. On one side of the car, the map runs in one direction, while on the other side of the car, the map runs oppositely — that is, it’s flipped horizontally. They apparently went to this trouble so that the map’s orientation would always match the train’s direction of travel. On some other lines, the same linear map has an indicator light set in each station. As the train approaches a station, the light for that station blinks. After the train leaves that station, the light remains on (so you can see where the train has been, as opposed to where it’s going). Good design there!

People were exceedingly friendly and there were no logistical problems on the trip. The city seems safe even in its less inviting regions. The prevailing language is Catalan, not Spanish — but everyone speaks some Spanish, and most people speak some English.

I’ve always wanted to go to Barcelona. It took me decades, but I’m glad I finally made it.

1 Comment

MAX 2007 in Barcelona: Talk Materials Online

October 18, 2007 on 10:45 pm | In Flex, Programming | 3 Comments

I just got back tonight from a very pleasant 4 day stay in Barcelona, where I spoke at the MAX Europe conference. I’ll be posting soon on some of the touristic and cultural aspects of Barcelona (with several observations on the Barcelona Metro’s user interface); this is just a quick note to let attendees and other interested parties know that the materials from my talks are available.

The sessions I gave this time were:

  • The Euro-edition of an interactive panel on Flex Best Practices featuring myself, Steven Webster, Sascha Wolter and Dirk Eismann. This one was considerably less formal than the American version and had a lot more give and take; I feel I was able to apply some good lessons and feedback from the first one. I don’t have notes on the panel, since I was moderating it — you just had to be there!
  • A presentation called Practical Patterns in Flex, which I adapted from Jim Echmalian’s talk at 360Flex earlier this year. This features a brand new take on the Model-View-Controller-Service architecture, and highlights the use of specific design patterns to remedy problems of encapsulating responsibility, dealing with asynchronous operations, and gaining access to the “right” controller without using messy singletons. I put together a working sample application in source code form that accompanies the talk.
  • Another talk entitled Continuous Integration for Flex with Ant and FlexUnit, originally assembled by Daniel Rinehart for MAX North America.

I don’t have a lot of news about the conference that’s any different from my earlier observations on MAX North America. The food was better at MAX Europe (when there was some), and the sessions were smaller which made them more intimate. However, as a number of speakers noticed, people ask many fewer questions during the session in Europe — but more of them come up afterwards to talk.

Like the Chicago MAX, this conference was situated in a part of town where there are basically no amenities or activities besides hotels and the conference center. And unlike Chicago, there was a distinctly seedy feeling to the neighborhood once outside the immediate neighborhood of the conference. But… it was really easy to get into town on the Metro and see the sights. Barcelona is a truly wonderful city: more on that later!

3 Comments

UrlKit 0.70 with various fixes and Flex 3 Support on Google Code

October 9, 2007 on 8:44 pm | In Flex, Programming | 5 Comments

I’ve finally moved UrlKit over to Google Code, in the course of which I applied a number of contributed bug fixes (thanks to Tom Ortega and Cyprian Kowalczyk for their help with IE and Opera). It now lives on its very own UrlKit Google Project Page complete with bug database, wiki, browseable SVN repository, and everything that an open source project ought to have. I also did a bunch of work on build scripts to make it much easier to build, test and cut new distributions.

Apart from these fixes, the other main work that took place in 0.70 was the introduction of support for the new Flex 3 deep linking features provided by BrowserManager. Basically, the Flex 3 framework takes care of all the browser-dependent Javascript history support for UrlKit, which is great because I absolutely hate working on that part of it! In this scenario, UrlKit provides the URL parsing/generation logic on top of the basic, unadorned deep linking support you get with Flex 3.

I ran into a bug with Flex 3, unsurprisingly since it’s in Beta — the BrowserManager interface appears not to work in a key case (although I think it used to). This bug is logged as SDK-12955 if you care about such things — and you should, since you can boost the likelihood of it getting fixed by voting on this bug!

By the way, this is the first time I’ve used Google Code personally, and I must say it’s a breeze. And I feel so much better about the project, knowing that people consuming open source projects expect the kind of features that Google Code and Sourceforge offer as a minimum. I wish it had been around when I first hosted the project (Sourceforge was there, of course, but I’m glad I was lazy, I mean I’m glad I waited.)

5 Comments

« Previous PageNext Page »

Entries and comments feeds. Valid XHTML and CSS.
All content copyright (c) 2006-2007 Joseph Berkovitz. All Rights Reserved.