In: Instruction
14 Jun 2009I’ve received a couple of mails asking me about the details of the facilities freesound provides for easy sample search and retrieval from programs one can write in different languages to incorporate the system in ones own programs. When I first started looking at this some months ago, I found it hard to find info about this, and I had to dissect other peoples codes that do the job, I can’t really remember what they were but there were 2 source files (one in python and one in C++), both were not functioning correctly but with countless trial and error I managed to get things right. I’ve coded the freesound class for SuperCollider last week, and figured things were changed by then, so I’ve searched for the changes in the freesound forum, and found info about the little changes. Anyway, I’ll summarize the whole thing for anyone who is interested.
We’ll be using cURL for the examples, you can deal with the URL’s using the faciliites your programming language provides, or just pipe through cURL. Here we go…
Freesound uses a login system, so you need a username and password that can be obtained for free from the freesound website. Once you have your username and password ready, your program needs to login to the system, and store the cookie freesound provides for you. You’ll be using this cookie for your future queries. The way to go with this using cURL is:
curl -c cookie.txt -d "username=<username>&password=<password>&redirect=../index.php&login=login&autologin=0" http://www.freesound.org/forum/login.php
You should change the <username> and <password> with your own username and password. Once you run this, you will get a cookie from the freesound site called cookie.txt. We’ll need that cookie to make queries. But first we need to check if login was successful. A way to find it out is trying to fetch this page: http://www.freesound.org/searchTextXML.php and see if the header for the returned page lists text/xml as content type. The way to do this with cURL is:
curl -b cookie.txt -I http://www.freesound.org/searchTextXML.php
Parse the returning response. If you see Content-Type: text/xml; somewhere, that means your login was successful.
Once you make sure you have a valid login, you can make searches. There are many parameters available for directing search results. This is an example:
curl -b cookie.txt -d "search=train&start=0&searchDescriptions=1&searchTags=1&searchFilenames=0&searchUsernames=0&durationMin=0&durationMax=20&order=0&limit=100" http://www.freesound.org/searchTextXML.php
This searches for the samples with keyword train in descriptions, tags but not in filenames and usernames, which has a duration between 0 and 20 seconds, and limits the maximum number of resulting samples to 100. The “order”, according to the info I found at the freesound forum means this:
ORDER_DEFAULT = 0;
ORDER_DOWNLOADS_DESC = 1;
ORDER_DOWNLOADS_ASC = 2;
ORDER_USERNAME_DESC = 3;
ORDER_USERNAME_ASC = 4;
ORDER_DATE_DESC = 5;
ORDER_DATE_ASC = 6;
ORDER_DURATION_DESC = 7;
ORDER_DURATION_ASC = 8;
ORDER_FILEFORMAT_DESC = 9;
ORDER_FILEFORMAT_ASC = 10;
You can tweak the other search options for your own liking. When you make this query, the freesound server will return you an XML file with the list of sample ids matching your criteria. It may look something like this:
<freesound nresults="335">
<sample id="74054" />
<sample id="74053" />
<sample id="74052" />
<sample id="74051" />
<sample id="74050" />
<sample id="74049" />
<sample id="74048" />
<sample id="74047" />
<sample id="74046" />
...
...
....
.....
<sample id="71687" />
<sample id="71686" />
</freesound>
Although number of found samples are 335 here, you will get 100 id numbers as dictated by your limit=100 choice above. You’ll need to get the sample ids from this XML file. If you need more info about a sample, you should do this:
curl -b cookie.txt http://www.freesound.org/samplesViewSingleXML.php?id=<id number for your sample>
You should put the id you want at the place of <id number for your sample> above. This will return some useful info about the sample you’ve chosen like duration, samplerate, bitrate, bitdepth, filesize, extension, geotag etc. in XML format.
If you find a sample that seems fit for you, you might want to download it.
Freesound redirects download requests so we need the get the exact URL of the file first, parse the header response from this to get the URL:
curl -b cookie.txt -I http://www.freesound.org/samplesDownload.php?id=<my sample id>
When you parse the URL (let me know if there is an easy way to get this when there are redirects) store it somewhere, and use this to download the file:
curl -b cookie.txt URL > filename
Where URL is the URL of the file you want to download and filename is the name of the file you want to download. When cURL finishes, you should have the file ready to be used in your programs.
In: News
5 Jun 2009Some of you might know about the Freesound project ( http://www.freesound.org ). The website is a collaborative database of Creative Commons licensed “sounds”. By “sounds”, they mean “samples only”, that are snippets of recorded stuff which are not to be identified as “songs”. It has a quite big community and they provide an API for software developers to access and get sounds from the database, which I think is great!
Last year when I was coding deQuencher, I made a freesound agent for it, which grabbed a random sample from the freesound database (based on a provided keyword) that would make it readily available for usage in a live performance / improvisation situation. Today I released a SC Quark which provides similar functionality for the sclang environment. Choose a keyword, set your search options, the quark handles the necessary searching and downloading operations for you, and you can use the downloaded file right away in a live performance. Yummy. You can get it from the official Quarks repository.
In: News
3 Jun 2009Hadron is received well and I’m a happy man. Thanks to all for the suggestions. Especially to Erik Skogen for feature suggestions, Wouter Snoei for detailed usage improvement suggestions, and Ali Bilgin Arslan for testing the app and plugin interface before release(s)!
I have an update and full change log is here:
http://quarks.svn.sourceforge.net/viewvc/quarks/Hadron/Help/Hadron-Changelog.html
Update your quarks if you are interested.
In: News
28 May 2009I’ve released a SuperCollider Quark called Hadron (the one I was talking about earlier). It is a graphical patching environment that lives inside SC.
Go to the project page. There is a screencast there. And maybe other info.
In: Doodle| Personal| Train of Thought
28 May 2009I guess I’m still too young for being content with using commercial music making software to produce sounds, which usually in its own rights try to make things easier for “most people” (in order to become a commercial success) by compromising from the organizational control over sound and live performance in favor of the majority of music making people (as there is a big trade off between ease of use and number of options (or number of different paradigms of working with sound organization)).
This is not to say that they are bad and useless, most serve well for a good number of paradigms, and as interest in computing rises among musicians, they will get even better (for example, the upcoming Max for Live is promising, I like the idea and implementation strategy of Ableton Live and although I stopped using them some years ago, I like the aim of PD and Max/MSP too). “More options” does not necessarily mean enhanced creative options for musicians, but that should not be the main job of a software anyway… Setting self imposed limits and driving creativity using that limits by using them as a ladder to a goal is a part of the craft of musicianship, and I think that part should not be left for centralized software companies alone.
Open communities, especially open source communities has a big role on helping one to get out of this chain. The tools are developed by many contributors, who are also using them on a daily basis, and they prioritize their own musical needs.
Anyone who knows a bit about me knows about my admiration for SuperCollider (and the community!). 2 weeks ago, I had a live gig after a long hiatus, so I developed an interface for the performance (I hate writing non-reusable code so I had a design, and now it seems like it will be a long term project), something I had in mind for a long time, but I needed a deadline to get started so anyway, I kept coding for a week, and it was ready by the performance, though it was quite glitchy and unreliable at that time. I knew what the problems were, and knew how to solve them but didn’t have time. It was, umm… in an alpha state. And I actually quite liked using it in that state. And it’s not my first time trying this sort of stuff either, naturally, there has been some occasions where that state contributed to the heart of the performance, but I’m happy as long as I have some sound rolling… Things can get fixed if you know what is broken. I like the quality of sensations it produces I guess…
This was how my screen was looking like, at the day of performance:
Oh and there is this irony, a part of my performance was relying on some guitar playing, as I said, I spent a whole week of coding for this, but forgot to tune my guitar prior to the performance. Things went downhill when guitar came into play so I had to skip some stuff… Tuning the instrument is an essential thing and I’ve managed to forget it.
Anyway I’ve been coding this thing for 2 more weeks now, added whole lots of new functionality now that it’s fairly stable, usable and documented; it’s waiting for its release soon. I like sharing, and I like it when people share. Going off the tangent now, I guess I need to get back to work. Here is the recording for the complete performance if you are interested. Sorry for the guitar part…
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
And as a final note, the other performer that day was bubblyfish, she makes some cool 8 bit music with authentic hardware. Check her myspace profile if you are into cool blips blops: http://www.myspace.com/bubblyfishmusic
Here is a cool concept.
I think many of you are familiar with the Twitter service; even if you aren’t using it yet, you probably are aware of the fact that there are millions of people all around the globe twitting like frenzy using this service (defined by some as the SMS of the Internets) as it’s the 3rd most used social networking site standing right after the Facebook and MySpace.
It’s a micro-blogging site where registered users can update their status in a minimal fashion, for the people following them to see, and where people can stay up to date about the status of their buddies, work related info, status of various projects etc. by simply following the account providing the relevant info. Some people use it to keep in touch with busy friends without much hassle in their busy day schedules, and it is also being used for following status of projects provided that they use Twitter to announce their stuff. I’m pretty sure there are many other active purposes of usage, people are inventive.
A cool (if not coolest) purpose of usage (for me anyway) is, I think, germinated from the SuperCollider codes Dan Stowell started to post on his own Twitter blog as status messages, a concept which later evolved into a SCTwitting collaboration as the act of posting little code chunks (called “SCTwits”) that make cool sounds is found interesting by other SuperCollider users. The fun comes from the limitation Twitter employs: Your posts can not be longer than 140 characters! This limitation tickles the creative mind and influences the creative process in a way that one strives to find the balance between simplicity, humor, coolness and of course the subjective beauty of the end result, but in the end, it’s all limited by 140 characters.
SuperCollider is a very expressive language with its generic tool set and various syntax shortcuts, yet its still surprising to see what people can fit into 140 characters of code. SCTwitting people typically follow each other on Twitter, and the experience is fun, inspiring and educating.
Here is the link for the mailing-list topic where it all started:
http://www.nabble.com/sctwitt-td22745438.html
You can find the blog addresses of some of the contributors to follow under the topic in the mailing list. And here is mine if you want to follow me:
http://www.twitter.com/earslap
This is so fun and brain twitching that I want to keep on doing it forever (unless everyone quits and I start to feel retarded for posting stuff there for some long time by myself without anyone following, of course). Here are my contributions so far; with the resulting sounds embedded in case if you don’t have a machine with SuperCollider around, or if you reached to this page while searching for what SuperCollider is all about. This is an expressive language!
{a=LocalIn.ar;LocalOut.ar(Mix.ar(x=SinOsc.ar((Decay.ar(Impulse.ar( [4,4.005]),1e3*a.abs)*50), a).distort));x;}.play;//tryingharder_to_noavail
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
{f=LocalIn.ar(2).tanh;k=Latch.kr(f[0].abs,Impulse.kr(0.5));LocalOut.ar( f+AllpassN.ar(Pulse.ar([2,3],k*0.01+1e-6,0.9),1,k*0.3,100*k));f}.play
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
play{f=LocalIn.ar(2).tanh;k=Latch.kr(f[0].abs,Impulse.kr(1/4));LocalOut.ar( f+CombC.ar(Blip.ar([4,6],100*k+50,0.9),1,k*0.3,50*f));f}//44.1kHz
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
play{f={LocalBuf(512)};r={|k,m|RecordBuf.ar(Pulse.ar(8,m,6e3),k)}; r.(a=f.(),0.99);r.(b=f.(),0.99001);Out.ar(0,IFFT([a,b]).tanh)};//44.1kHz:)
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
play{t=Impulse.ar(75);Sweep.ar(t,150).fold(0,1)*PlayBuf.ar(1, Buffer.read(s,"s*/*".pathMatch[2]),1,t,Demand.ar(t,0,Dbrown(0,2e5,2e3,inf)))!2}
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
play{Mix({a=LFNoise1.ar(0.2.rand);DelayC.ar(BPF.ar( WhiteNoise.ar(Dust2.ar(a*a*4**2).lag(8e-3)),10e3.rand+300,0.09),3,a*1.5+1.5,45)}!80).dup}
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
play{AllpassC.ar(SinOsc.ar(55).tanh,0.4,TExpRand.ar(2e-4, 0.4,Impulse.ar(8)).round([2e-3,4e-3]),2)};// #supercollider with bass please…
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Please follow and contribute if you like monkeying around with SC!
In: Instruction| Review
8 Apr 2009Those of you familiar with linux-audio hackery might know the great time-frequency analyser software called baudline. It is an amazing tool for frequency domain visualization of sound, and it also has scientific measurement tools and time domain visualization features built-in.
The application runs on Linux and Solaris SPARC natively, and is not open source. The GPL source is for sale though but the site says “The source code is expensive and it is intended for qualified corporate or institutional buyers” about the price.
And unfortunately there is no port of this beautiful piece of software for the Mac OS X platform yet, so Mac users are out of luck on running this one natively on their computers. Frankly, this was the one and the only one software I happened to miss after my switch from Linux to Mac OS X for doing audio stuff (the things I was using in Linux are mostly also available for OS X so the transition was smooth for the most part).
Being frustrated about the lack of proper realtime frequency domain analyzer software for my platform of choice, and feeling the slight irritation of the awarence of doing little about it for some long time, last week, I decided to try to run this beast in a virtual machine running Linux inside Mac OS X, and to my surprise, it ran quite well; so I wanted to share my experience.
The worst thing about this is that you need to own a virtualization software called VMware Fusion (Parallels Desktop might also work, I haven’t tried it). There are many great free and open source virtualization softwares out there (like Qemu, VirtualBox etc.), but none of the free ones support audio input under Mac OS X, and audio-in support for your virtual machine is a must, if you want to run a software like Baudline that relies on incoming audio. If there is a better option, I’d like to know!
The Linux distro of my choice was Damn Small Linux, which is only 50megs in size, and it “just works”. It even has a premade VMware Fusion virtual machine image available for downloading from its site. Plug it in and it works (it works as a Live CD, and the distro is based on Knoppix).
You will also need a software to route audio from your applications to VMware Fusion. I usually use JackOSX for audio routing but VMware seems to have issues with it so instead, I used SoundFlower, which seemed to work fine.
Now let’s get our hands dirty:
cd /home/dsl tar -xzvf baudline_1.07_linux_i686.tar.gz
cd baudline_1.07_linux_i686
./baudlineYou can now open an audio application on your mac, and if you route its outputs to SoundFlower, you will see the STFT analysis of it on Baudline spectrogram view.
(Spectral image excerpt from Ryoji Ikeda - Matrix 2.6 1111011111)When you are done with it, right click on the screen, select pause and suspend the machine from VMware Fusion. When you need the tool again, just start the machine and it will be ready for the job in a few seconds. Enjoy…
In: Links
12 Jan 2009Great remarks from Cage, about the experience of “listening to sounds” as opposed to “listening to music”… And how “listening to sounds” itself is a source of pleasure, even present in the act of sole “listening to music” consciously or subconsciously.
I love this moment:
Cage: …I love sounds, just as they are… (pause)
Car: hoooooooonnnnnkkkkkk! (meaning we love you too)
Today, I see that the controversial and much talked-about piece of Karlheinz Stockhausen, the Helicopter String Quartet, is scheduled for its “4th time ever” real performance at January 18, 2009, in Rome. The first 3 performances were held at the premier day of the piece[1], at June 26, 1996 with the Arditti Quartet playing the strings, then there is the CD recording from 1996, that was actually done in a mobile studio with the helicopter sounds mixed into the 4 separate recording rooms[2], which I frankly find kind of “lame”, but there is no doubt that it is really hard and expensive to get all the things done right for performing and recording this piece so its understandable.
The 2009 performance will also feature the Arditti Quartet. If you are around Rome, I think you can get your tickets from here:
http://www.auditorium.com/eventi/4929777
[1]: http://www.stockhausen.org/helicopter_intro.html
[2]: http://en.wikipedia.org/wiki/Helikopter-Streichquartett
In: Links
8 Jan 2009One of the most impressive performances I’ve ever seen! Thanks goes to Candas Sisman.
Great ideas and stunning musicianship!
Hello there, I'm Batuhan Bozkurt, a sound artist and programmer from Turkey. This is my personal hub site where I regularly try to blog and share my projects and interesting things I stumble upon. For more info about me click here.