Starting afresh

After four years as Head of Department (of Musicology at UiO), I am going back to my regular associate professor position in January. It has been a both challenging and rewarding period as HoD, during which I have learned a lot about managing people, managing budgets, understanding huge organizations, developing strategies, talking to all sorts of people at all levels in the system, and much more.

I am happy to hand over a Department in growth to the new HoD (Peter Edwards). We have implemented a new bachelor’s program, launched UiO’s first MOOC (Music Moves), and hired a number of new people, just to mention a few of the things I have worked on over the last years. I am also proud that we just got our new appointment plan approved before Christmas, aiming at hiring up to seven new professors within the next five years. Humanities departments are under a lot of pressure these days, so I am very grateful that we are in a position to expand in the coming years!

I have only been teaching sporadically while being HoD, so I am excited about getting back to running the course Interactive Music that I started up a while back. This is a so-called “practical-theoretical” course, aiming at giving students a holistic perspective on designing musical instruments and systems. I published a paper on the design of this course a few years ago (An action–sound approach to teaching interactive music), and have since gathered some more ideas that I want to test out when it comes to teaching students a combination of music cognition and technology focused around some concrete designs. I also hope that these ideas will turn into my next book project, if successful.

I am also excited about starting up ny new research project MICRO – Human Bodily Micromotion in Music Perception and Interaction, in which we will focus on how music influences us when at rest. Fortunately, the fourMs lab is really getting up to speed now, so we will really be able to study micromotion in great detail.

In getting ready for my new working life, I decided to wipe my main computer (a Lenovo Yoga Pro 2) yesterday. I have been running various versions of Ubuntu over the last years (Ubuntu Studio, Ubuntu GNOME, and Linux Mint), but decided to go for the regular Ubuntu 16.10 this time around. I think Unity has matured quite a bit now, and works very well on the Yoga’s multitouch HiDPI display. This was my first complete reinstall since I got the laptop almost three years, and was definitely needed. I always test a lot of different software and settings, so the system had gotten clogged up by lots of weird stuff on top of each other. The new clean system definitely feels smooth and well-functioning. It feels like a digital and mental “shower”, getting ready for the new year!

Shell script for compressing PDF files on Ubuntu

ubuntu-logo112Back on OSX one of my favourite small programs was called PDFCompress, which compressed a large PDF file into something more manageable. There are many ways of doing this on Ubuntu as well, but nothing really as smooth as I used to on OX.

Finally I took the time to figure out how I could make a small shell script based on ghostscript. The whole script looks like this:

#!/bin/sh
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile="compress_$@" "$@"

and by saving it in the nautilus scripts directory:

 ~/.local/share/nautilus/scripts

It shows up when I right click on a file. For most of the files I have tried so far today (uncompressed PDF files), it compresses the files to at least 1/10th of the original size. Very useful, particularly when I only need screen resolution for files.

Screenshot from 2016-06-29 16-55-49

Finally moving from Apple’s Keynote to LibreOffice Impress

Apple’s Keynote has been my preferred presentation tool for about a decade. For a long time it felt like the ideal tool, easy to use, powerful and flexible. But at some point, probably around the time when the iOS version of Keynote came along, the Mac version of Keynote started loosing features and became more limited than it had used to be. Since then, I have experienced all sorts of problems, including non-compatibility of new and old presentation file versions, problems with linked video files, crashes, etc.

Even with its increasing amount of shortcomings, Keynote has been one of the few programs that I have been missing after my move to Ubuntu as my main OS three years ago. Keynote has also been one of the few reasons I have often decided to bring along my old MacBook rather than my current Lenovo Yoga 2 Pro workhorse.

Over the years, I have been trying other presentation software. I was an early user of Prezi, and still like the looks and non-linear approach that it affords. However, the lack of a native Prezi client for Linux has been a turn-off, particularly since I never trust the network connections when I am out traveling. I am also somewhat skeptic about not being able to use local media in Prezi presentations, particularly since I often use a lot of video material.

I have also been excited about trying out some markdown-based presentation solutions, including reveal.js and Remark. This has been refreshing, and I like such an approach when working mainly with text-based presentations. I do realize, however, that many of my presentations rely heavily on images, sounds and videos, which make the markdown-based approaches less ideal.

I have been trying Impress, the presentation part of OpenOffice/LibreOffice, on and off for several years, and have, to say it mildly, never been impressed. The design of the software has been ok, not even close to as intuitive as Keynote, but not so far away from MS PowerPoint. The biggest drawback, however, has been its performance, both when it comes to editing presentations, but also when presenting. After all, a presentation software has to be efficient to work with and needs to perform flawlessly in presentation mode.

Luckily, I decided to give Impress yet another try before giving a presentation in Hamburg this week. I exported a Keynote presentation to a .pptx file, and opened it up in LibreOffice Impress on my Ubuntu laptop. To my big surprise it worked very well! Not only did the graphical elements look good, but also the embedded videos worked well. There must have been some major update to the software recently, because suddenly the speed of editing also worked quite fine. There are still some issues when scrolling through a large presentation with lots of multimedia content, but not more than I can live with.

The conclusion: today I held my first multimedia-rich conference presentation using my Ubuntu laptop. Not only did the projector connection work flawlessly (which has not always been the case with Linux systems…), but also the presentation ran without any performance issues whatsoever. A new era has begun in my presentation life! LibreOffice Impress is still not as smooth and solid as Keynote was a few years back, but it is now at a point where it is stable and easy enough that I actually want to use it professionally.

Add date to files in Ubuntu

Even though I have been running Ubuntu as my main OS for more than a year now, I am still trying to figure out a good workflow. One thing I have been missing from my former OSX setup was the ability to quickly and easily prepend the date to a number of files. Having moved my files between many different OSes, hard drives, network drives, etc. over many years, I know that the files’ creation dates will break at some point. For that reason, I prefer to prepend the date to filenames of photos, random text files, etc. That way I am able to quickly search through the files easily.

On OSX I have made a small Automator script called add-date that does exactly this: prepends a file’s creation date to the filename. It has worked like a charm for many years, and still works, so feel free to try it out if you are on OSX.

In Ubuntu there are, of course, numerous terminal based methods to do something like this. But I haven’t really been that eager to mess around with mv, rename and regexp just to rename a bunch of files once in a while. In the quietness of the Norwegian summer I finally got around to look a little more into how to do this in Ubuntu, and it turned out to be very easy. Nautilus, the file manager on Ubuntu, actually sports the ability to run scripts from the GUI. The scripts, of any programming flavor (python, perl, etc.) just need to be put in the folder:

 ~/.local/share/nautilus/scripts

There are many examples of adding today’s date to the files, such as this python example, but it took a little while to figure out how to do it using the modification date of the file. I finally got this to work as a little bash script:

#!/bin/sh
for f in "$@"; do mv "$f" "$(date -d@$(stat --printf='%Y' "$f") +%Y-%m-%d)-$f"; done

Save this as a file in the scripts folder, make it executable (chmod a+x), and restart nautilus. Then I can easily add the date to all files I want directly from the GUI.

Screenshot from 2015-08-03 21:53:02

Simple video editing in Ubuntu

I have been using Ubuntu as my main OS for the past year, but have often relied on my old MacBook for doing various things that I haven’t easily figured out how to do in Linux. One of those things is to trim video files non-destructively. This is quite simple to do in QuickTime, although Apple now forces you to save the file with a QuickTime container (.mov) even though there is still only MPEG-4 compression in the file (h.264).

There are numerous linux video editors available, but most of these offer way too many features and hence the need to re-compress the files. But I have found two solutions that work well.

The first one, ffmpeg, should be obvious, although I hadn’t thought that it could also do trimming. However, I often like GUI software, and I have found that Avidemux can do what I need very easily. Just open a file, add start and stop markers for the section to be trimmed, and click save. As opposed to QuickTime, it also allows for saving directly to MPEG-4 files (.mp4) without recoding the file.

There was only one thing that I had to look up, and that was the need for starting the trim section on a keyframe in the video. This is quite obvious when wanting to avoid re-encoding the file, but unfortunately Avidemux doesn’t help in explaining this but only gives an error message. The trick was to use the >> arrows to jump to the next keyframe, and then the file saved nicely.