Sound installation using SCAMP

Hi everyone—fairly new user here. I’ve really been enjoying working with this library for the past few weeks. In addition to being a composer, I have some background as a programmer, and was really happy to come across SCAMP. Thank you so much, @MarcEvanstein!

I thought I’d share a project I’m currently working on using SCAMP. It’s an online, binaural sound installation, with the ultimate goal being to make it available as a live YouTube stream of theoretically indefinite length. The idea is that characteristics of the sound will change in real time according to data, such as the number of people currently listening to the installation. In essence, I’ve built an instrument in Max/MSP consisting of a bank of sound generators as well as a spatialization engine, and I’m then using SCAMP/Python to play that instrument.

For now, I’ve been making some draft prototypes of the installation. To do this, I’ve simply been using some sample data for current stream viewership, letting the software run for a few minutes, and recording the results. Here’s one of them:

(Please listen with headphones!)

And here’s the Python script which is controlling everything, in case anyone wants to have a peek:

It’s still a work in progress, but just thought I’d share in case it’s of interest to folks on here (comments/questions welcome, of course!).

Look forward to chatting more about SCAMP!



that is very cool. does your script also stream to youtube live?

Thanks! The script doesn’t currently handle streaming the resulting sounds to YouTube, no (to do that I was thinking of routing the audio from Max to streaming software such as OBS).

This is great—welcome Alex! I love the hacking together of different tools, since that’s kind of what I designed SCAMP to allow you to do. Also, I’ve been curious about doing this kind of thing myself, and hadn’t thought of routing to OBS.

I notice in the code some hacks designed to overcome the fact that the clock gets upset when the Google API call takes a while. One thing you might try is changing s.fork(update_parameters, args = [s]) to s.fork_unsynchronized(update_parameters, args = [s]). This would cause it to operate outside of the clock system, which I think would be okay in this case?

Another possibility in situations like this is to use s = Session().run_as_server(). This causes the Session to run on a separate thread from the main script, which can be useful when doing more “live coding” style stuff.

One other thing: I see you made your own classes for chords and stuff like that, which is awesome and very much in the spirit of the build-your-own-tools philosophy behind SCAMP. That said, in case it’s useful to you, you should know about the scamp_extensions package, and in particular the scamp_extensions.pitch.Scale class. It’s super flexible, and can load from and save to scala files.

Oh, also: since you’re doing SCAMP to max, you might find these examples useful: I’m not a big max person, but maybe it will be of use. :slight_smile:

Oooh, thank you so much for all of this, Marc! Yes, calling fork_unsynchronized() here seems to work like a charm—no more warnings being thrown in the terminal about the clock being behind schedule. It’s really good to know about the scamp_extensions package and Max demos, too. I’m realizing how provisional a lot of my SCAMP knowledge is at the moment (mostly it’s based on having watched just a few of your tutorial videos)—looking forward to digging into the documentation a bit more!