The World - Bird Architecture

The biggest aspect of this patch that I wanted to build into it is scalability. Which is why I rely on creating abstractions and making use of the poly~ object rather than trying to get everything working through sub-patches. The current working bird patch is an abstraction titled “TempBird2” and you can see in the image all the aspects that are being routed into it as a means of influencing its parameters: bang, toggle, temperature, sunrise bang, sunset bang, daytime bang, night time bang, a metronome, as well as the current latitude and longitude.

The overall idea for how the birds work is this, Cornell’s eBird is accessed through their API and a list of the 20 most recent birds logged within a radius to the latitude and longitude of the input location. The audio filed for the birds logged are each loaded into an abstraction that granulated the call.

This patch works somewhat for now. The logic of it works but I had a little trouble getting the data for it. The big issue right now is that the eBird API doesn’t have a function to download the audio files of the bird calls. For it to work the way I want it to, I’d have to create a web-scraping program that would fish out the correct audio files for each bird spotted based on the name received. I still need to write that program or change the way I want this to work. But I believe that for it to work in any environment it would need to function this way.


Bird Logic

This image details the inside of the “TempBird2” abstraction. This patch uses a coll file to store the names of the audio files received. It then uses that list to retrieve the audio files from a folder and place them into the polybuffer~ object. Based on the length of the coll file, a number of poly~ objects are created, each one will assign an audio files from the polybuffer~ into a discrete granulator patch. Every 10 minutes this list would refresh and load new birds in. The sunrise and sunset parameters are fed in because I want to build in the functionality of recognizing nocturnal birds.

Inside the poly~ patcher.

To get the logic of the dishing out individual audio files to discrete voices of the poly~ object, I used the uzi object to essentially count up really fast. Everything after that was essentially taking advantage of the placement influencing the order of operations in Max. This patch works in tandem with the insides of the poly~ patch to organize everything.

Here are the logic steps of the patch:

  1. Load Coll file with names of audio files

  2. Gets the length of the coll file to send to the uzi object

  3. Uses the length to set the number of active voices in the poly~ object

  4. Uzi object then sends out numbers through its right-most outlet starting with objects on the right and then going left. I also use the forward and receive objects to send messages between patches. You can see in the image that the order is numbered with comments.

    1. The index targets an object

    2. Sets the forward to the correct receive

      1. I use thispoly~ object to receive the current number of each poly and combine that in a sprintf object then the receive object is sent the correct message based on the uzi index with the forward object in the outer patch.

    3. The next step is appending the correct audio file into the polybuffer~

    4. Lastly, a set message goes through to a groove~ object inside of the poly~ object with the name of the correct audio file.


The only step I’m missing is getting the audio files dynamically. I’ve been in contact with Cornell’s library and they said that there is no organization to their audio files in the eBird database. The only way they really want you getting their audio files is through asking them directly and they’ll send you the specific ones you ask for, but this is not an automated process. Someone actually has to go and collect the audio files that you’re looking for. This system inherently won’t work for what I’m trying to do, so now I’m left with two options.

  1. Code a web-scraper to find and download the audio files for each bird directly, this may not work perfectly 100% of the time though.

  2. Figure out the list of the most likely bird for the region this is set up in and collect all the audio files myself and access the necessary ones on a case by case basis.

For now, I’m happy with the fact that the system works and I’ve turned my focus in the project towards other aspects. I feel like whenever I’m at the point of installation is when I’ll decide between the two option above, or I’ll have an even better third option I haven’t thought of yet.

Michael MatsakisComment