Midi division fixes

MusE is a MIDI/Audio sequencer with recording and editing capabilities, aiming to be a complete multitrack virtual studio for Linux. https://muse-sequencer.org/

Moderators: MattKingUSA, khz, spamatica

Post Reply
Tim E. Real
Established Member
Posts: 407
Joined: Sat Sep 15, 2012 12:36 am

Midi division fixes

Post by Tim E. Real »

In a previous post a user was trying to import a high-resolution midi file,
which had linear time format instead of normal metric time format.
I did some fixes which allowed the import to occur.

I mentioned that he might get better resolution and accuracy from the import if he
adjusted the Settings > Midi Division to a higher value.

But I also noted that my tests showed the Midi Division did not appear to work correctly
if set to anything other than 384 Ticks Per Quarter Note.
'Snap' seemed incorrect and division lines were not drawn correctly.

I was right. It surely was not working correctly.

So here we go with some major fixes, in git master now.
The fixes allow you to set a very high Midi Division (max 12288) such that the resolution and accuracy is now very good,
either with midi importing or just general snap and grid lines. Resolution so high, that it rivals that of single-audio-frame linear-time editing !
The 'Snap' boxes now change dynamically and now have more selectable values with higher Midi Division values.
And the Wave Editor now has a Snap box !

There are a few more things TODO, here are some of them:
When you change the Midi Division, I need to re-adjust any existing open song, you will find the time values change, they shouldn't.
Similarly, we do automatically adjust any imported midi file to match the current Settings > Midi Division - but we don't adjust
our very own muse song files when opened if they were recorded with a Midi Division different than the current Settings value !
So I'll have to do that.

Here are the details:

- Settings > Midi Division fixes: Full re-work of grid raster and snap system:
- Replaced INCORRECT hard-coded snap/raster fixed-value tables throughout,
with new class MusEGui::Rasterizer, provides CORRECT dynamic raster tables
that change values, and dimensions, when global Midi Divison changes.
There is one single global instance of this new class.
- New class MusEGui::RasterizerModel works with class Rasterizer to provide a
Qt model for use with combo boxes for example. Specific columns and maximum
number of rows can be specified. Model is specially designed for rasters
(for ex. in pianoroll the first row is three columns wide and says 'off').
- New class RasterLabelCombo replaces hard-coded raster snap combo boxes.
Works with class RasterizerModel. With a high Midi Division more rows appear,
meaning HIGH-RESOLUTION editing is possible, rivaling that of frames.
New classes RasterizerListView, RasterizerTableView, and RasterizerTreeView
provide three types of views for RasterLabelCombo.
- Wave Editor: Added a 'Snap' combo box (RasterLabelCombo).
- Grid lines: Fixed problems with unwanted red grid line colours.
- Removed never-used GUI Division from Settings.
- Canvases: Area before bar # 1 now FIXED WIDTH regardless of Midi Division
or magnification, by rearranging xorg/yorg origin stuff in class View,
ie. origin is no longer magnified.

Post Reply