8e0aeaa579
Supports 'standard' configuration for bass string notations in historic tablatures (lutes and other plucked instruments, as well as viols), both of the French and of the Italian style. This should fill the last 'big hole' in historic TAB support. Bass strings (or bourdons) are extra strings in addition to the 6 'standard' strings, which are not represented by tab lines and were indicated by other typograhic devices in historic sources. Among the innumerable variations shown in sources, this implementation supports the following styles, chosen to be general enough to suit the majority of cases, without requiring new parameters in the TAB style dialogue box: - French: the first 4 bass courses are indicated by a fret mark in the 'seventh' TAB position (below bottom string) with 0, 1, 2 or 3 slashes prefixed; other bass courses are indicated, also in the 'seventh' TAB position, by the string number (from 4 on) and cannot contain a fret mark (as they didn't in historic sources). - Italian: the first 2 bass courses are indicated by a fret mark in the 'seventh' TAB position (abover top string) with 1 or 2 'ledger lines' underneath; other bass courses are indicated, also in the 'seventh' TAB position, by the string number (from 9 on) and cannot contain a fret mark (as they didn't in historic sources). Rhythm marks above these indication are raised to leave room for them. Both styles do not blindly assume that French style is top-to-bottom and Italian is 'upside-down' -- as historic sources are -- but adapt to the actual string order of the TAB. The choice between the two styles depends on the TAB using numbers or letters for the fret marks. The implementation does not try to detect if the TAB is really of a historic style and applies either bass string notation whenever more strings are used than there are TAB lines. If this proves unsuitable to modern usage, some better heuristics can probably be found. For a discussion and some screen shots, see: https://musescore.org/en/node/67261 **Note entry** During TAB note entry, if the instruments has more strings than the TAB has lines, the string cursor can be moved outside of the TAB body, one position below for 'top-to-bottom' TAB's and one position above for 'upside-down' TAB's. Further up or down movements add, to the 'blue cursor rectangle', markers indicating which is the actual target string (the cursor does not actually move), equal to the marks a note in that string will receive (slashes, ledger lines or string ordinal, according to the style and the string); during input the user will then receive the same info as when reading entered notes. Other Notes: - the `InputStatus::_string` variable, holding the current target TAB string in TAB note entry, changed meaning from the __visual__ string index to the __physical__ string index: this allows a better containment of the peculiarities of the individual TAB styles within the `StaffStyle` class, leaving other classes somehow freer of concern about TAB visual order and other peculiarities. As this variable is only used with TAB's, this change should not affect other functions. - Some calculation for rhythm symbols have been moved from `TabDurationSymbol::draw()` to `TabDurationSymbol::layout()`, hopefully speeding up the drawing process. - In fonts for historic styles, '10' has been replaced by 'X' both in fret numbers and in string ordinals, as this is more common in historic sources. Currently, this is not configurable; an additional style parameter could be added in future, if there will be enough request for it.
109 lines
3.2 KiB
C++
109 lines
3.2 KiB
C++
//=============================================================================
|
|
// MuseScore
|
|
// Music Composition & Notation
|
|
//
|
|
// Copyright (C) 2010-2011 Werner Schweer
|
|
//
|
|
// This program is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License version 2
|
|
// as published by the Free Software Foundation and appearing in
|
|
// the file LICENCE.GPL
|
|
//=============================================================================
|
|
|
|
#include "shadownote.h"
|
|
#include "score.h"
|
|
#include "drumset.h"
|
|
#include "sym.h"
|
|
#include "mscore.h"
|
|
|
|
namespace Ms {
|
|
|
|
//---------------------------------------------------------
|
|
// ShadowNote
|
|
//---------------------------------------------------------
|
|
|
|
ShadowNote::ShadowNote(Score* s)
|
|
: Element(s)
|
|
{
|
|
_line = 1000;
|
|
sym = SymId::noSym;
|
|
}
|
|
|
|
//---------------------------------------------------------
|
|
// draw
|
|
//---------------------------------------------------------
|
|
|
|
void ShadowNote::draw(QPainter* painter) const
|
|
{
|
|
if (!visible() || sym == SymId::noSym)
|
|
return;
|
|
|
|
QPointF ap(pagePos());
|
|
#if 0 // yet(?) unused
|
|
QRect r(abbox().toRect());
|
|
#endif
|
|
|
|
painter->translate(ap);
|
|
qreal lw = point(score()->styleS(StyleIdx::ledgerLineWidth));
|
|
InputState ps = score()->inputState();
|
|
int voice;
|
|
if (ps.drumNote() != -1 && ps.drumset() && ps.drumset()->isValid(ps.drumNote()))
|
|
voice = ps.drumset()->voice(ps.drumNote());
|
|
else
|
|
voice = ps.voice();
|
|
|
|
QPen pen(MScore::selectColor[voice].lighter(SHADOW_NOTE_LIGHT), lw);
|
|
painter->setPen(pen);
|
|
|
|
drawSymbol(sym, painter);
|
|
|
|
qreal ms = spatium();
|
|
|
|
qreal x1 = symWidth(sym) * .5 - (ms * mag());
|
|
qreal x2 = x1 + 2 * ms * mag();
|
|
|
|
ms *= .5;
|
|
if (_line < 100 && _line > -100 && !ps.rest()) {
|
|
for (int i = -2; i >= _line; i -= 2) {
|
|
qreal y = ms * mag() * (i - _line);
|
|
painter->drawLine(QLineF(x1, y, x2, y));
|
|
}
|
|
for (int i = 10; i <= _line; i += 2) {
|
|
qreal y = ms * mag() * (i - _line);
|
|
painter->drawLine(QLineF(x1, y, x2, y));
|
|
}
|
|
}
|
|
painter->translate(-ap);
|
|
}
|
|
|
|
//---------------------------------------------------------
|
|
// layout
|
|
//---------------------------------------------------------
|
|
|
|
void ShadowNote::layout()
|
|
{
|
|
if (sym == SymId::noSym) {
|
|
setbbox(QRectF());
|
|
return;
|
|
}
|
|
QRectF b(symBbox(sym));
|
|
qreal _spatium = spatium();
|
|
qreal lw = point(score()->styleS(StyleIdx::ledgerLineWidth));
|
|
|
|
qreal x1 = symWidth(sym) * .5 - (_spatium * mag()) - lw * .5;
|
|
qreal x2 = x1 + 2 * _spatium * mag() + lw * .5;
|
|
|
|
InputState ps = score()->inputState();
|
|
QRectF r(x1, -lw * .5, x2 - x1, lw);
|
|
if (_line < 100 && _line > -100 && !ps.rest()) {
|
|
for (int i = -2; i >= _line; i -= 2)
|
|
b |= r.translated(QPointF(0, _spatium * .5 * (i - _line)));
|
|
for (int i = 10; i <= _line; i += 2)
|
|
b |= r.translated(QPointF(0, _spatium * .5 * (i - _line)));
|
|
}
|
|
setbbox(b);
|
|
}
|
|
|
|
|
|
}
|
|
|