Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, 11 December 2011

birdsim - bird calls simulator for 3D audio systems

Living in a city has it pros and cons, however the main disadvantages for many people is the lack of access to the nature. Especially in winter, the view of naked trees and dirty snow may be really depressing. This situation led me to the idea of an application which could simulate bird calls (songs) using my 5.1 audio system for a 3D ambient sound-scape experience.
The goal was to create something different than bird calls recordings on CD. First of all, it is hard to find "nature sounds" CDs  with DTS surround sound. In my idea the listener should be in the center of a "virtual scene". Next I have a thought of simulating real-time behaviours, like different bird species singing at specified hours (some birds time-perception accuracy can be measured in minutes!). Finally, in real world the sound scene is very dynamic, some birds are moving, other are flying away or closer to the listener. I wanted to include all those dynamics existing in real environment.

The result of my work is the birdsim application. It is written in Python using OpenAL and pyOpenAL wrapper for 3D sound. Unfortunately the pyOpenAL for python seems no longer to be supported, but it is still downloadable as a deb package. Also I were unable to port birdsim to windows, also because of the OpenAL lib. It could be great if someone could share pyOpenAL working on windows.
Birdsim is based on XML scene and bird descriptors. Each bird have some sound samples and XML description included. It was hard to find really good quality bird calls sound samples (by good quality I mean also that the samples include ONLY sounds of one bird, which is not so common as one could imagine). I encourage you to add new birds to the database and create different scenes. Currenty there is one scene called night.xml which include some night birds and crickets. The second scene called 24hours.xml include all birds which will appear in real time of day (most of them start early in the morning).



Here is the link to sourceforge page with the whole project:
http://sourceforge.net/projects/birdsim/

Have fun !

Friday, 18 February 2011

Arduino + ikea box + flightgear = flykeaduino

Hello there. It's been some time since my last post. I got some new stuff and ideas meantime so it's time to share something.

Recently I have played flightgear a lot, it is a very good open source flightsim and it has some usefull abilities. One of the most usefull things is that flightgear provides access to simulation parameters via telnet ! Using it for making own control system was really easy.

First I've wrote a simple app for arduino to utilize six switches and one potentiometer. Arduino sends the data about switches state using serial. You can download the code here.


Next I've used a box from ikea some wires and soldering iron to make a simple control panel. The switches are connected in the most basic way. Every switch has +5V, ground and one digital input pin connected. The potentiometer is connected in the same way except that it uses  the analog input pin.



The data from arduino is parsed by python script which connects to flightgear by telnet and sets proper values for various controls. You can find the script here.

Usage:
- connect arduino, compile and flash the app
- run flightgear with  "--telnet=5401" argument
- run the python script
- done ! use switches and buttons to control flightgear

Have fun :)

Saturday, 18 September 2010

BusPirate oscilloscope python script

Some time ago I wrote a simple oscilloscope script for Bus Pirate.
Pygame and pyBusPirateLite libraries are needed to run it. Unfortunately the BusPirate firmware sends data collected by ADC very slowly so it's working rather as a live-plot than a real oscilloscope but even though it may be useful.


v 1.0

v 1.2



Usage:
edit this line in oscope.py so it points to BusPirate
BUS_PIRATE_DEV = "/dev/ttyUSB0"
Connect ADC and GND lines.
Run and have fun :)

Download here:
oscope.py

>>EDIT<<
New version: oscope_v1.2.py
Working only with modified firmware (ADC modification 20.09.2010):
BPv3-Firmware-v5.8-adc.hex.zip
New features:
- trigger on rising/falling slope
- time scaling