Sending and Storing Data


When sending and storing data on-line, Urb relies on Python and MySQL to preform the tasks. The Python module works as an outside agent, responsible for building a query out of a float package put together by Pure Data, and sending it to a MySQL database.



The Database


It is well established for now that each location, each sound recollection point will have its own table on the database, being that each table will take the name of its actual urban location. The structure of each table is rather simple. Thirteen columns, one for each audio feature plus a first row that is using Unix Timestamp as a mean of identification and time localization of the event described in the row. Urb’s database, a series of data visualization and retrieval tools are being designed in order to keep the dialogue sustainable even for the non-technical user. It is of the most importance that Urb’s data remains relevant and useable for the musician, composer or citizen without computational expertise, furthermore, all records are intended to be cleared of any composition methodology. Are two different PHP scripts that play a small part on what is expected to be a stable and refined project of data visualization and retrieval. For now, these two scripts are responsible for the following outputs:

Displaying the data of a specific table as an HTML table.  Regarded as a production tool, this allows monitoring the data flux without needing to log in to the host control panel.

Export the data of a specific table as a .csv file.

For now, the main intention is to keep Urb as an inviting platform for the users of the so-called creative programming frameworks such as Max/MSP, Pure Data, Processing, ProcessingJS, openFrameworks, Cinder, Nodebox, Shoebot, among others.






Sound Analysis and information for the Database


All the sound analysis is made on the Pure Data patch.

The patch analyzes 12 different elements or descriptors of the sound. The first two are Pitch and Amplitude.

Pitch: using the native Pd-extemded object sigmund~.

Sigmund~ analyzes an incoming sound into sinusoidal components, which may be reported individually or combined to form a pitch estimate.

Amplitude: using another native object avg~ that computes the mean amplitude of its input signal since it last received a bang. The mean amplitude is the sum of the absolute values of the input divided by the number of samples received.

The other 10 features are from the timbreID.

timbreID is a Pd external collection developed by William Brent. It is composed of a group of objects for extracting timbral features, and a classification object that manages the resulting database of information. The objects are designed to be easy to use and adaptable for a number of purposes.

It implements a collection of low-level spectral audio descriptors, such as:

Centroid is defined as the center of gravity of the magnitude spectrum,

Kurtosis gives a measure of the flatness of a distribution around its mean value,

Flatness is the ratio of the geometric mean of magnitude spectrum to the arithmetic mean of magnitude spectrum. A very noisy spectrum without clear shape should have a high flatness value,

Flux is defined as the squared difference between the normalized magnitudes of successive spectral distributions,

Irregularity is the comparison of how much each frequency bin compares to its immediate neighbors. A jagged spectrum, irregularity will be high, and for smooth contoured spectra, it will be low,

Mfcc represents the shape of the spectrum with few coeficients,

Roll-off is a measure of spectral shape, which is used to distinguish between voiced and unvoiced speech.

Skewness is a measure of the asymmetry of a distribution around its mean value,

Spread is the spread of the spectrum around mean value,

Zero-crossing rate is the number of times the signal cross the zero axe.

Such complete timbral features increase the project ability to respond to future demands or needs leaving the project scope flexible to ecological or artistic exploration and investigation.

Every five minutes the patch calculates the main value of each feature of that time and sends that value for the database, figure 6. During our tests we realize that the five minutes window is a sustainable amount of time to provide a clear “image” of the urban soundscape in a larger scale of time. It is a manageable number of entries to the database and doable to its storage in a long-term situation.

SOFTWARE & SOUND ANALYSIS

Downloads


Python Script (without pass ): urbsql.py


URBbox image for Raspberry Pi:

URB03062013ns.img


    content:

    OS - 2013-02-09-wheezy-raspbian

    MySQL

    Python

    PD extended ( witn boxv04.pd )

    timbreID





   

   

   




Note

                 .pass: urbbox

           .this image has the Python Script without connection and without boxv04.pd auto lunch.

to activate the auto start go to

sudo nano /etc/xdg/lxsession/LXDE/autostart

and delet the “ # “ from the 4th line.

          

Help

            SD card setup

            Connecting to a Rasberry Pi via SSH

            Building Pd-extended for RasberryPi