Add Horizontal Scaling factor for the music score

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Add Horizontal Scaling factor for the music score

Vivian Crompton

When loading some more complex midi files, ie. those with very many notes per bar, the notes are too squashed up to be able to read easily.

I made a quick hack to my copy of the source code to add a QDoubleSpinBox widgit to the side panel, and scale the score accordingly by adding a pair of functions:
 static float horizontalScalingFactor() {
        return m_horizontalScalingFactor;
        //return 1.75;    // defines the speed of the scrolling
    }

    static void setHorizontalScalingFactor(double val){
        m_horizontalScalingFactor = val;
    }
I also replaced m_horizontalScalingFactor anywhere I could find it in the code, with the new horizontalScalingFactor() function.

All in all, the code changes were not pretty however, and I haven't really looked in detail at what it might break. All in all not a very pretty bit of coding, and the scaling is not perfect - the score is not using the entire display area (though I think this was the case originally anyway)

I only spent about an hour all in all looking at the code, and the change an not something I feel I could load up to the repository, but perhaps someone more familiar with the code base would consider adding this feature?

Another problem with the changes I made is they don't take effect until the song is restarted.


Cheers

Viv.


Reply | Threaded
Open this post in threaded view
|

Re: Add Horizontal Scaling factor for the music score

Louis B.
Administrator
Hi Viv,

This is something that I was considering doing eventually. However the fact that you have taken a stab at this allready may save me some time. Could your provide a patch (or the zipped code) and the svn version number that you started with.

The scrolling window is not so sucessfull with very complex pieces as the notes are too squashed up or the notes move too fast. For very advanced pieces I recommend that move to a printed score.

However I think the variable scaling factor is a useful addition,

L.