1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633
|
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2013 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 "score.h"
#include "xml.h"
#include "bagpembell.h"
#include "sym.h"
namespace Ms {
// Embellishment names and note sequences
BagpipeEmbellishmentInfo BagpipeEmbellishment::BagpipeEmbellishmentList[] = {
// Single Grace notes
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace low G"), "LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace low A"), "LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace B"), "B" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace C"), "C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace D"), "D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace E"), "E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace F"), "F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace high G"), "HG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Single grace high A"), "HA" },
// Double Grace notes
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "D LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "D B" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "E LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "E B" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "E C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "E D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "F LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "F LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "F B" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "F C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "F D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HG LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HG LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HG B" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HG C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HG D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HG E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HG F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA B" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double grace"), "HA HG" },
// Half Doublings
{ QT_TRANSLATE_NOOP("bagpipe", "Half doubling on low G"), "LG D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half doubling on low A"), "LA D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half doubling on B"), "B D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half doubling on C"), "C D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half doubling on D"), "D E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half doubling on E"), "E F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half doubling on F"), "F HG" },
// ? { QT_TRANSLATE_NOOP("bagpipe", "Half doubling on high G"), "HG F" },
// ? { QT_TRANSLATE_NOOP("bagpipe", "Half doubling on high A"), "HA HG" },
// Regular Doublings
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on high G"), "HG F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on high A"), "HA HG" },
// Half Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on low A"), "LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on B"), "B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on C"), "C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on D"), "D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on D"), "D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on E"), "E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on F"), "F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half strike on high G"), "HG F" },
// Regular Grip
{ QT_TRANSLATE_NOOP("bagpipe", "Grip"), "D LG" },
// D Throw
{ QT_TRANSLATE_NOOP("bagpipe", "Half D throw"), "D C" },
// Regular Doublings (continued)
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on low G"), "HG LG D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on low A"), "HG LA D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on B"), "HG B D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on C"), "HG C D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on D"), "HG D E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on E"), "HG E F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Doubling on F"), "HG F HG" },
// Thumb Doublings
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on low G"), "HA LG D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on low A"), "HA LA D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on B"), "HA B D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on C"), "HA C D" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on D"), "HA D E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on E"), "HA E F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on F"), "HA F HG" },
// ? { QT_TRANSLATE_NOOP("bagpipe", "Thumb doubling on high G"), "HA HG F" },
// G Grace note Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note on low A"), "HG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note on B"), "HG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note on C"), "HG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note on D"), "HG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note on D"), "HG D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note on E"), "HG E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note on F"), "HG F E" },
// Regular Double Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on low A"), "LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on B"), "LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on C"), "LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on D"), "LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on D"), "C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on E"), "LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on F"), "E F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on high G"), "F HG F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Double strike on high A"), "HG HA HG" },
// Thumb Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on low A"), "HA LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on B"), "HA B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on C"), "HA C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on D"), "HA D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on D"), "HA D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on E"), "HA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on F"), "HA F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb strike on high G"), "HA HG F" },
// Regular Grips (continued)
{ QT_TRANSLATE_NOOP("bagpipe", "Grip"), "LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Grip"), "LG B LG" },
// Taorluath and Birl
{ QT_TRANSLATE_NOOP("bagpipe", "Birl"), "LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "D throw"), "LG D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half heavy D throw"), "D LG C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Taorluath"), "D LG E" },
// Birl, Bubbly, D Throws (continued) and Taorluaths (continued)
{ QT_TRANSLATE_NOOP("bagpipe", "Birl"), "LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Bubbly"), "D LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Heavy D throw"), "LG D LG C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Taorluath"), "LG D LG E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Taorluath"), "LG B LG E" },
// Half Double Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on low A"), "LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on B"), "B LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on C"), "C LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on D"), "D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on D"), "D C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on E"), "E LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on F"), "F E F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on high G"), "HG F HG F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half double strike on high A"), "HA HG HA HG" },
// Half Grips
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on low A"), "LA LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on B"), "B LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on C"), "C LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on D"), "D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on D"), "D LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on E"), "E LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on F"), "F LG F LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on high G"), "HG LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half grip on high A"), "HA LG D LG" },
// Half Peles
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on low A"), "LA E LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on B"), "B E B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on C"), "C E C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on D"), "D E D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on D"), "D E D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on E"), "E F E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on F"), "F HG F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half pele on high G"), "HG HA HG F" },
// G Grace note Grips
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note grip on low A"), "HG LA LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note grip on B"), "HG B LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note grip on C"), "HG C LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note grip on D"), "HG D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note grip on D"), "HG D LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note grip on E"), "HG E LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note grip on F"), "HG F LG F LG" },
// Thumb Grips
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on low A"), "HA LA LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on B"), "HA B LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on C"), "HA C LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on D"), "HA D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on D"), "HA D LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on E"), "HA E LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on F"), "HA F LG F LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grip on high G"), "HA HG LG F LG" },
// Bubbly
{ QT_TRANSLATE_NOOP("bagpipe", "Bubbly"), "LG D LG C LG" },
// Birls
{ QT_TRANSLATE_NOOP("bagpipe", "Birl"), "HG LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Birl"), "HA LA LG LA LG" },
// Regular Peles
{ QT_TRANSLATE_NOOP("bagpipe", "Pele on low A"), "HG LA E LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Pele on B"), "HG B E B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Pele on C"), "HG C E C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Pele on D"), "HG D E D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Pele on D"), "HG D E D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Pele on E"), "HG E F E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Pele on F"), "HG F HG F E" },
// Thumb Grace Note Peles
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on low A"), "HA LA E LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on B"), "HA B E B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on C"), "HA C E C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on D"), "HA D E D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on D"), "HA D E D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on E"), "HA E F E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on F"), "HA F HG F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb grace note pele on high G"), "HA HG HA HG F" },
// G Grace note Double Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note double strike on low A"), "HG LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note double strike on B"), "HG B LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note double strike on C"), "HG C LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note double strike on D"), "HG D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note double strike on D"), "HG D C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note double strike on E"), "HG E LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note double strike on F"), "HG F E F E" },
// Thumb Double Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on low A"), "HA LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on B"), "HA B LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on C"), "HA C LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on D"), "HA D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on D"), "HA D C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on E"), "HA E LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on F"), "HA F E F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb double strike on high G"), "HA HG F HG F" },
// Regular Triple Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on low A"), "LG LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on B"), "LG B LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on C"), "LG C LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on D"), "LG D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on D"), "C D C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on E"), "LA E LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on F"), "E F E F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on high G"), "F HG F HG F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Triple strike on high A"), "HG HA HG HA HG" },
// Half Triple Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on low A"), "LA LG LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on B"), "B LG B LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on C"), "C LG C LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on D"), "D LG D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on D"), "D C D C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on E"), "E LA E LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on F"), "F E F E F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on high G"), "HG F HG F HG F" },
{ QT_TRANSLATE_NOOP("bagpipe", "Half triple strike on high A"), "HA HG HA HG HA HG" },
// G Grace note Triple Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note triple strike on low A"), "HG LA LG LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note triple strike on B"), "HG B LG B LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note triple strike on C"), "HG C LG C LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note triple strike on D"), "HG D LG D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note triple strike on D"), "HG D C D C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note triple strike on E"), "HG E LA E LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "G grace note triple strike on F"), "HG F E F E F E" },
// Thumb Triple Strikes
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on low A"), "HA LA LG LA LG LA LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on B"), "HA B LG B LG B LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on C"), "HA C LG C LG C LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on D"), "HA D LG D LG D LG" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on D"), "HA D C D C D C" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on E"), "HA E LA E LA E LA" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on F"), "HA F E F E F E" },
{ QT_TRANSLATE_NOOP("bagpipe", "Thumb triple strike on high G"), "HA HG F HG F HG F" },
};
// Staff line and pitch for every bagpipe note
BagpipeNoteInfo BagpipeEmbellishment::BagpipeNoteInfoList[] = {
{ "LG", 6, 65},
{ "LA", 5, 67},
{ "B", 4, 69},
{ "C", 3, 71}, // actually C#
{ "D", 2, 72},
{ "E", 1, 74},
{ "F", 0, 76}, // actually F#
{ "HG", -1, 77},
{ "HA", -2, 79}
};
//---------------------------------------------------------
// nEmbellishments
// return the number of embellishment in BagpipeEmbellishmentList
//---------------------------------------------------------
int BagpipeEmbellishment::nEmbellishments()
{
return sizeof(BagpipeEmbellishmentList) / sizeof(*BagpipeEmbellishmentList);
}
//---------------------------------------------------------
// getNoteList
// return notes as list of indices in BagpipeNoteInfoList
//---------------------------------------------------------
noteList BagpipeEmbellishment::getNoteList() const
{
noteList nl;
if (_embelType >= 0 && _embelType < nEmbellishments()) {
QStringList notes = BagpipeEmbellishmentList[_embelType].notes.split(' ');
int noteInfoSize = sizeof(BagpipeNoteInfoList) / sizeof(*BagpipeNoteInfoList);
foreach (const QString note, notes) {
// search for note in BagpipeNoteInfoList
for (int i = 0; i < noteInfoSize; ++i) {
if (BagpipeNoteInfoList[i].name == note) {
// found it, append to list
nl << i;
break;
}
}
}
}
return nl;
}
//---------------------------------------------------------
// write
//---------------------------------------------------------
void BagpipeEmbellishment::write(XmlWriter& xml) const
{
xml.stag(this);
xml.tag("subtype", _embelType);
xml.etag();
}
//---------------------------------------------------------
// read
//---------------------------------------------------------
void BagpipeEmbellishment::read(XmlReader& e)
{
while (e.readNextStartElement()) {
const QStringRef& tag(e.name());
if (tag == "subtype")
_embelType = e.readInt();
else
e.unknown();
}
}
//---------------------------------------------------------
// BEDrawingDataX
// BagpipeEmbellishment drawing data in the x direction
// shared between ::draw() and ::layout()
//---------------------------------------------------------
struct BEDrawingDataX {
const SymId headsym; // grace note head symbol
const SymId flagsym; // grace note flag symbol
const qreal mags; // grace head magnification
qreal headw; // grace head width
qreal headp; // horizontal head pitch
const qreal spatium; // spatium
const qreal lw; // line width for stem
qreal xl; // calc x for stem of leftmost note
const qreal xcorr; // correction to align flag with top of stem
BEDrawingDataX(SymId hs, SymId fs, const qreal m, const qreal s, const int nn)
: headsym(hs),
flagsym(fs),
mags( 0.75 * m),
spatium(s),
lw( 0.1 * s),
xcorr( 0.1 * s)
{
qreal w = gscore->scoreFont()->width(hs, mags);
headw = 1.2 * w; // using 1.0 the stem xpos is off
headp = 1.6 * w;
xl = (1 - 1.6 * (nn - 1)) * w / 2;
}
};
//---------------------------------------------------------
// BEDrawingDataY
// BagpipeEmbellishment drawing data in the y direction
// shared between ::draw() and ::layout()
//---------------------------------------------------------
struct BEDrawingDataY {
const qreal y1b; // top of all stems for beamed notes
const qreal y1f; // top of stem for note with flag
const qreal y2; // bottom of stem
const qreal ycorr; // correction to align flag with top of stem
const qreal bw; // line width for beam
BEDrawingDataY(const int l, const qreal s)
: y1b( -8 * s / 2),
y1f( (l - 6) * s / 2),
y2( l * s / 2),
ycorr(0.8 * s),
bw( 0.3 * s) {}
};
//---------------------------------------------------------
// debug support (disabled)
//---------------------------------------------------------
/*
static void printBBox(const char* name, const QRectF b)
{
qDebug("bbox%s left %f bot %f right %f top %f",
name,
b.left(),
b.bottom(),
b.right(),
b.top());
}
static void symMetrics(const char* name, const Sym& headsym)
{
qDebug("%s", name);
qDebug("bbox left %f bot %f right %f top %f",
headsym.getBbox().left(),
headsym.getBbox().bottom(),
headsym.getBbox().right(),
headsym.getBbox().top());
qDebug("attach x %f y %f",
headsym.getAttach().x(),
headsym.getAttach().y());
}
*/
//---------------------------------------------------------
// mag
// return fixed magnification
//---------------------------------------------------------
qreal BagpipeEmbellishment::mag() const
{
return 0.7;
}
//---------------------------------------------------------
// layout
// calculate and set bounding box
//---------------------------------------------------------
void BagpipeEmbellishment::layout()
{
/*
if (_embelType == 0 || _embelType == 8 || _embelType == 9) {
qDebug("BagpipeEmbellishment::layout st %d", _embelType);
}
*/
SymId headsym = SymId::noteheadBlack;
SymId flagsym = SymId::flag32ndUp;
noteList nl = getNoteList();
BEDrawingDataX dx(headsym, flagsym, magS(), score()->spatium(), nl.size());
setbbox(QRectF());
/*
if (_embelType == 0 || _embelType == 8 || _embelType == 9) {
symMetrics("headsym", headsym);
symMetrics("flagsym", flagsym);
qDebug("mags %f headw %f headp %f spatium %f xl %f",
dx.mags, dx.headw, dx.headp, dx.spatium, dx.xl);
}
*/
bool drawFlag = nl.size() == 1;
// draw the notes including stem, (optional) flag and (optional) ledger line
qreal x = dx.xl;
foreach (int note, nl) {
int line = BagpipeNoteInfoList[note].line;
BEDrawingDataY dy(line, score()->spatium());
// head
addbbox(score()->scoreFont()->bbox(headsym, dx.mags).translated(QPointF(x - dx.lw * .5 - dx.headw, dy.y2)));
/*
if (_embelType == 0 || _embelType == 8 || _embelType == 9) {
printBBox(" notehead", bbox());
}
*/
// stem
// highest top of stems actually used is y1b
addbbox(QRectF(x - dx.lw * .5 - dx.headw, dy.y1b, dx.lw, dy.y2 - dy.y1b));
/*
if (_embelType == 0 || _embelType == 8 || _embelType == 9) {
printBBox(" notehead + stem", bbox());
}
*/
// flag
if (drawFlag) {
addbbox(score()->scoreFont()->bbox(flagsym, dx.mags).translated(QPointF(x - dx.lw * .5 + dx.xcorr, dy.y1f + dy.ycorr)));
// printBBox(" notehead + stem + flag", bbox());
}
// draw the ledger line for high A
if (line == -2) {
addbbox(QRectF(x - dx.headw * 1.5 - dx.lw * .5, dy.y2 - dx.lw * 2, dx.headw * 2, dx.lw));
/*
if (_embelType == 8) {
printBBox(" notehead + stem + ledger line", bbox());
}
*/
}
// move x to next note x position
x += dx.headp;
}
}
//---------------------------------------------------------
// drawBeams
// draw the beams
// x1,y is one side of the top beam
// x2,y is the other side of the top beam
//---------------------------------------------------------
static void drawBeams(QPainter* painter, const qreal spatium,
const qreal x1, const qreal x2, qreal y)
{
// draw the beams
painter->drawLine(QLineF(x1, y, x2, y));
y += spatium / 1.5;
painter->drawLine(QLineF(x1, y, x2, y));
y += spatium / 1.5;
painter->drawLine(QLineF(x1, y, x2, y));
}
//---------------------------------------------------------
// drawGraceNote
// draw a single grace note in a palette cell
// x,y1 is the top of the stem
// x,y2 is the bottom of the stem
//---------------------------------------------------------
void BagpipeEmbellishment::drawGraceNote(QPainter* painter,
const BEDrawingDataX& dx,
const BEDrawingDataY& dy,
SymId flagsym, const qreal x, const bool drawFlag) const
{
// draw head
drawSymbol(dx.headsym, painter, QPointF(x - dx.headw, dy.y2));
// draw stem
qreal y1 = drawFlag ? dy.y1f : dy.y1b; // top of stems actually used
painter->drawLine(QLineF(x - dx.lw * .5, y1, x - dx.lw * .5, dy.y2));
if (drawFlag) {
// draw flag
drawSymbol(flagsym, painter, QPointF(x - dx.lw * .5 + dx.xcorr, y1 + dy.ycorr));
}
}
//---------------------------------------------------------
// draw
// draw the embellishment centered in a palette cell
// x = 0 is horizontal cell center
// y = 0 is the top staff line
//---------------------------------------------------------
void BagpipeEmbellishment::draw(QPainter* painter) const
{
SymId headsym = SymId::noteheadBlack;
SymId flagsym = SymId::flag32ndUp;
noteList nl = getNoteList();
BEDrawingDataX dx(headsym, flagsym, magS(), score()->spatium(), nl.size());
QPen pen(curColor(), dx.lw, Qt::SolidLine, Qt::FlatCap);
painter->setPen(pen);
bool drawBeam = nl.size() > 1;
bool drawFlag = nl.size() == 1;
// draw the notes including stem, (optional) flag and (optional) ledger line
qreal x = dx.xl;
foreach (int note, nl) {
int line = BagpipeNoteInfoList[note].line;
BEDrawingDataY dy(line, score()->spatium());
drawGraceNote(painter, dx, dy, flagsym, x, drawFlag);
// draw the ledger line for high A
if (line == -2)
painter->drawLine(QLineF(x - dx.headw * 1.5 - dx.lw * .5,
dy.y2, x + dx.headw * .5 - dx.lw * .5, dy.y2));
// move x to next note x position
x += dx.headp;
}
if (drawBeam) {
// beam drawing setup
BEDrawingDataY dy(0, score()->spatium());
QPen beamPen(curColor(), dy.bw, Qt::SolidLine, Qt::FlatCap);
painter->setPen(beamPen);
// draw the beams
drawBeams(painter, dx.spatium, dx.xl - dx.lw * .5, x - dx.headp - dx.lw * .5, dy.y1b);
}
}
}
|