getDuration = function(type){
        var duration;

        if (type == "whole"){
            duration = 1;