Come work with me! Lots of new positions at University of Oslo

I recently mentioned that I have been busy setting up the new MCT master’s programme. But I have been even more busy with preparing the startup of our new Centre of Excellence RITMO Centre for Interdisciplinary Studies in Rhythm, Time and Motion. This is a large undertaking, and a collaboration between researchers from musicology, psychology and informatics. A visual “abstract” of the centre can be seen in the figure to the right.

Now we are recruiting lots of new people for the centre, so please apply or forward to people you think may be interested:

New Centre of Excellence: RITMO

The new centre directors: Anne Danielsen (years 1–5) and Alexander Refsum Jensenius (years 6-10).

I am happy to announce that the Research Council of Norway has awarded funding to establish RITMO –  Centre of Excellence for Interdisciplinary Studies in Rhythm, Time and Motion. The centre is a collaboration between Departments of Musicology, Psychology and Informatics at University of Oslo.

Project summary

Rhythm is omnipresent in human life, as we walk, talk, dance and play; as we tell stories about our past; and as we predict the future. Rhythm is also central to human biology, from the microoscillations of our nervous system to our heartbeats, breathing patterns and longer chronobiological cycles (or biorhythms). As such, it is a key aspect of human action and perception that is in complex interplay with the various cultural, biological and mechanical rhythms of the world.

The vision behind RITMO is to reveal the basic cognitive mechanism(s) underlying human rhythm, using music, motion and audiovisual media as empirical points of departure. No other interdisciplinary research environment has focused solely on rhythm and its direct and indirect impacts before. Given the fundamental role of rhythm in human life, such an endeavour is long overdue.

RITMO will undertake research on rhythm in human action and perception, and on the aesthetic and cultural ‘texts’ that such processes elicit. This venture will benefit from the combined perspectives of the humanities, cognitive neuroscience, social sciences and informatics. Now is the right time to establish such a centre, because we can finally explore some of the larger questions of the humanities via state-of-the-art technologies for motion capture, neuroimaging, pupillometry and robotics. Such a research strategy is as novel as it is essential to any engagement with the impact of human rhythm. RITMO will generate groundbreaking knowledge about the structuring and understanding of the temporal dimensions of human life. As such, it will change how we view human cognition and supply a cornerstone for the future exploitation of rhythm in applications for well-being and rehabilitation.

Calculating duration of QuickTime movie files

I have been doing video analysis on QuickTime (.mov) files for several years, but have never really had the need to use the time information of the movie files. For a project, I now had the need for getting the timecode in seconds out of the files, and this turned out to be a little more tricky than first expected. Hence this little summary for other people that may be in the same situation.

It turns out that QuickTime uses something called time units for the internal representation of time, and this is also what is output in Jitter when I run my analysis software on the files. The time unit is not very meaningful for humans, as it is a combination of frames and a timescale that defines the actual length of each time unit. Apple has posted some more technical information about Timecode Media Handler Functions, but it didn’t really help me solve the problem easily.

Fortunately, there are a few threads on this topic on the Cycling ’74 forum, including one on relating sfplay time to quicktime time, and another on converting quicktime units into time code. These threads helped me realize that calculating the duration of a movie file in seconds, is as easy as dividing the duration in frames by the timescale. And, by knowing the total number of frames it is then also possible to calculate the frames per second of the file. Now that I know this, it is obvious, but I post the patch here in case there are others looking for this information.


My main problem, though, was that I already had a lot of analysis files (hundreds) with only the QuickTime time unit as the time reference. It was not an option to rerun these analyses (which have taken weeks to finish), so I had to figure out a way to retroactively calculate a more meaningful timecode (in seconds).

After fiddling around with the time series data for a little while, I found that it is possible to use the difference between two time samples, and since I know the original fps of the movies (using QuickTime Player to check the fps), this can be used to calculate the correct duration in seconds. For my dataset there turned out to be only five different time unit durations, so it was fairly easy to write a small script for calculating the durations in Matlab. This is the part of the script that handles the time calculation, in which a is a Matlab structure with my data, hence a.time(1) is the time code of the first sample in the dataset.

    case 1001
        t = (a.time-a.time(1))/(29.97*time_diff); % 29.97 fps
    case 2000
        t = (a.time-a.time(1))/(29.97*time_diff); % 59.94 fps
    case 3731
        t = (a.time-a.time(1))/(24*time_diff);    % 24 fps
    case 3733
    case 3750
        disp('!!! Unknown timecode.')

For new analyses, I will calculate the correct duration in seconds right away, but this hack has a least helped in solve the problem for my current data set.