Development log

Code, tricks, quick technical ideas, recipes, progress reports, bash, ffmpeg and more…

Processing: slice and blend

Here’s a little sketch in Processing that does the following: loads an image, takes a horizontal and vertical 1px slice, multiplies each slice into an image off-screen, and blends the two images together and displays the original and blended one side by side. Each frame this is calculated dynamicaly, the slices are determined by the position of the mouse.

Note: the image must be in the folder where your sketch is saved and it must be in dimension of 300×300 pixels.

Processing: slice and blend screeshot

I still need to test this in a fullHD/1080p situation. I wonder if the CPU can take it at 60 frames per second. I actually suspect not. So many pixels and not on the GPU.

Granular synthesis in SC

This morning I started to work on a granular machine in SuperCollider. This is what I got so far:

Interface Fractures III: Silicon log #1

These days I started some work on a new chapter of my audio-visual series called “Interface Fractures”.

Bought a new graphic card – Nvidia-based GTX960.
Also a fullHD multitouch screen is here for exploitation in next couple of years.

SuperCollider for multitouch

Somebody (Scott Cazan) on the supercollider-users list mentioned a fork of SuperCollider with multitouch support (which will be included in main with 3.8 release). I cloned git fork from Cazan’s github, installed build dependencies, couple of twiddles, and compilation went through.

 

Continue reading

Garmin Nüvi 255 on Linux

Was asked by my family if I can update their Garmin device, so I searched the net how to do it without getting into buying much software and possibly work with free maps.

Get the maps

Go to garmin.openstreetmap.nl and select what data you want on your map.

Start by choosing a type of map – for example “Generic Routable” (seems good for this model of Garmin), then select a predefined country from a dropdown menu (for example in a dropdown “Europe” you can choose Austria, or Slovenia).

If you want more territories add some additional tiles, click “Enable manual selection” checkbox and click around the map to select or deselect tiles. You can also click+drag to select multiple tiles. Once you are done, add your email address above the map and click “Build my maps” and follow instructions.

When you open the link in the second email, download the “Compressed file that contains a single image that can be placed directly onto the SD-card of the GPS.“, usually called something like osm_generic_new_gmapsupp.zip.

Add the maps to your Garmin

Plug your Garmin Nüvi 255 to your computer using a simple mini-usb cable (it looks like this).

Wait till it ‘boots’ – wait for progress bar and a beep.

After that there should appear two possibilities to mount in your Nautilus. One of them is the Garmin device itself and the other is the microSD card plugged into the Garmin. If names of devices don’t give enough clues about which one is which one, you can recognise them by their contents if you mount them. The microSD card will have only one folder called ‘garmin’ while Garmin device will have more folders and files. Mount the microSD card. (Alternatively, you can take the microSD card out of Garmin and mount it on computer using an SD card reader).

Backup (copy) the file or the ‘garmin’ folder from microSD card onto your computer just in case something goes wrong.

Unzip the contents of the zip file you downloaded from OpenStreetMap – this will give you a single file: gmapsupp.img. Copy it to the microSD card into folder ‘garmin’, overwriting the file that is there.

Wait for the transfer to complete and properly unmount the microSD card and the Garmin device. Once you are sure they are unmounted you can unplug the Garmin device from your computer.

That’s all. When Garmin starts it will include the new data together with old data for areas that you didn’t choose (or so it seems – untested yet). If you want to use just the new map, and not the old data (or just to test if the new map is installed), go to Tools > Settings > Map > Map Info where you can turn on and off maps as desired.

Alternative method: replace the maps

The above method seems to “add” new data for selected areas. In other words, what you put on the microSD card is then used in addition to the maps that are already on the device.

It seems that it is possible to replace the maps that are already on the device by actually replacing gmapprom.img file on folder ‘Garmin’ on the device (not on microSD card!) with the contents of gmapsupp.img. That is, rename gmapsupp.img to gmapprom.img and with it overwrite the file on the device (do not forget to backup anything you will override).

Sources

http://askubuntu.com/questions/377599/update-garmin-n%C3%BCvi-255-maps
http://wiki.openstreetmap.org/wiki/Garmin.OpenStreetMap.nl:Manual
http://forums.linuxmint.com/viewtopic.php?f=18&t=133042

Ubuntu Studio 14.04 (Trusty Tahr) on ThinkPad X220

I went and installed a fresh install from the USB: first I downloaded a DVD image of Ubuntu Studio 14.04.1 and then used UNetBootin to create a bootable USB stick. I was able to boot into live version (Try Ubuntu Studio without installing) and then installed directly from that session.

I was able to shrink the root partition from existing install (also Ubuntu Studio, 12.04) which was 28 GB into 14GB and that left me with new 14GB space for a new install. This way I could dual boot and boot back into old system in case of emergency.

After install I had a problem connecting to my home WiFi with the default NetworkManager. I’m already used to using WICD network manager, so I booted back into old system and downloaded packages: python-urwid_1.1.1-1build2_amd64.deb, wicd-curses_1.7.2.4-4.1ubuntu1_all.deb, python-wicd_1.7.2.4-4.1ubuntu1_all.deb and wicd-daemon_1.7.2.4-4.1ubuntu1_all.deb into a fresh empty folder, booted back into new system and installed them with

Then you can control your wifi in terminal with wicd-curses

It’s cool to stop NetworkManager (first) and remove it after wicd is working ok (sudo apt-get remove network-manager) and possibly restart wicd with

Window Manager

I use awesome window manager

and enable text-only login by setting in /etc/default/grub:

don’t forget to

start your awesome WM with startx (part of xinit package), with your ~/.xinitrc containing something like

audio setup

a jackd instance in a terminal (jackd -d alsa -d hw:0 -r 44100 -p 512 -n 3 -i 2 -o 2)
pulseaudio (currently not autospawned – echo "autospawn = no" > ~/.pulse/client.conf)
jack-module for pulse audio

in fact a big problem was an old ~/.asoundrc file. once removed, jack was easy to start. jack_control still not behaving right, but i wrote a little script to start jackd and pulseaudio:

jack_pulse.sh, put it in ~/bin and make it executable:

Firewire (using an ExpressCard) sound card (Edirol FA-101) works out of the box. Just use:

Also, EchoAudio Indigo xDJ express-card works out of the box. After pluging it in it’s usually found as hw:1, so:

more system tweaking

Some necessary tools:

I (quite haphazardly by opinion of some) turn of sudo password check, by adding the following into /etc/sudoers file:

Suspend through xfce4-power-manager does not work. the solution with installing pm-utils as per http://askubuntu.com/questions/460101/xfce4-power-manager-suspend-not-available-for-lid-close makes this problem go away. So,

Returning from suspend sometimes makes certain programs lagging in display updates (Chromium browser and Renoise, observed). This can be eliminated by simply switching to text console (Ctrl+Alt+F1) and back to Xorg (Alt+F7).

audio/video stuff

install renoise

install SuperCollider:

Click [Configure] and then [Generate]. You might get some submodules via git (git submodule update, +..)

quirky Pure Data

If your PD patches use [plugin~], nothing will be shown. This can be avoided by starting PD with a unset LANG. This means that before you run pure data (pd-extended), you first do

Gtk grey/green theme is not applied well to all different widgets

the main culprit is the gtk3.
everything is solved if one takes a good theme that includes gtk2 and gtk3 themes, download and extract into ~/.themes/ and creates symlinks like this:

one can fix font size using lxappearance and qt/kde apps using qtconfig

suspending from within LightDM doesn’t work. Reports “No kernel support”

my workaround is not using lightdm at all. i turn it off with wajig stop lightdm and start my awesomeWM session using startx. Fonts seem nicer (more correct to my eyes). I don’t know exactly why is the font different tho. However, this brings some other problems, usually connected to permissions – especially sudden inablity to mount usb keys through nautilus for example (pmount works) and scanning.

Slovene keyboard

My custom slovene/en keyboard layout – see slovenian keyboard layout.

other software checklist

sylpheed

  • dropbox: just apt-get install nautilus-dropbox. It includes an autodownload of dropbox from their site.
  • mega client: mega.co.nz
  • nautilus-open-terminal
  • pidgin
  • skype

    Things to fix:

    * permissions to be able to mount usb keys via nautilus
    * permission to be able to scan

What If SenseStage notes/log [sept 2014]

With a new system (Ubuntu Studio 14.04.1, 64bit) suddenly the SenseStage didn’t want to run. Especially the ./run_local.sh script was giving me pain. It turned out the culprit was virtualenv which had to be setup anew. Since I’m not fluent in python and/or virtualenv it took me a while, but thanks to online community (stackoverflow.com, virtualenv.readthedocs.org) I managed to fix it:

backup old virtualenv:

install a systemwide virtualenv tool:

create a new virtual environment:

copy some packages into new environment:

don’t forget to re-install pyOSC:

plug the controler bee, make it (/dev/ttyUSB0) accessible:
either add user to group dialout

or change permissions (temporarily):

run the controller script run_local.sh in ~/src/SenseStageLeben/transmittance/minibee

Troubles with SuperCollider

Due to change of system, a LADSPA plugin for SC was not found. Had to compile it.

Prepare audio for YouTube with avconv

How to create a video file from a single image and audio track using avconv:

Thanks to a question/recipe from SuperUser:
superuser.com/questions/571100/avconv-video-from-single-jpg-and-ogg

PostScript: make an A6 broshure (8 pages/sheet)

Had this lovely pdf (Music Marketing Handbook, 2007) and had difficulty reading it on screen and wanted to print it in a small (tiny?) broshure format. So, in Linux, I used this:

first convert PDF to postscript file

now the crazy command-line monster (this will take 8 pages in a block, scale them by 0.5, offset their position on a page and rotate four of them upside down):

convert postscript back to pdf, but make sure that GhostView doesn’t try to figure out the correct rotation!

This process will create pages with four pages on each, which you can print double-sided. It is then very simple to fold each of A4 sheets two times and just cut the top two folds.

bookletmaking2
booklet making

Booklet making

Switch CapsLock and Ctrl using xkb

Using CTRL as a modifier is quite frequent, especially in EMACS. Since it is usually (and definitely on my Thinkpad) placed in a position that can cause “Eamcs Pinky”, one of possibilities is to remap CapsLock to another Ctrl. Following a recipe on Emacs Wiki, this is one possible way:

Bash: download from camera and convert to webm

So, M. works on this piece with students of Duncan Centre and SVŠGL, currently in Prague. Later rehearsals will happen in Ljubljana. Anyway, she’s documenting rehearsals on HD camera, which produces HD h264-encoded clips, that are practically unwatchable on her X200 thinkpad. So I wrote a little script that downloads the clips to an external drive and converts them to WEBM format. I think it’s one of the neatest scripts so far from me, as it even uses little error checking (for existence of folders for example).

Continue reading