// ~ Methods ---------------------------------------------------------------- // ------------------// // accidentalTextOf // // ------------------// public static AccidentalText accidentalTextOf(Shape shape) { ObjectFactory factory = new ObjectFactory(); AccidentalText accidentaltext = factory.createAccidentalText(); accidentaltext.setValue(accidentalValueOf(shape)); return accidentaltext; }
// -------------------// // getOrnamentObject // // -------------------// public static JAXBElement<?> getOrnamentObject(Shape shape) { // (((trill-mark | turn | delayed-turn | shake | // wavy-line | mordent | inverted-mordent | // schleifer | tremolo | other-ornament), // accidental-mark*)*)> ObjectFactory factory = new ObjectFactory(); switch (shape) { case INVERTED_MORDENT: return factory.createOrnamentsInvertedMordent(factory.createMordent()); case MORDENT: return factory.createOrnamentsMordent(factory.createMordent()); case TR: return factory.createOrnamentsTrillMark(factory.createEmptyTrillSound()); case TURN: return factory.createOrnamentsTurn(factory.createHorizontalTurn()); } logger.error("Unsupported ornament shape:{}", shape); return null; }
// -----------------------// // getArticulationObject // // -----------------------// public static JAXBElement<?> getArticulationObject(Shape shape) { // <!ELEMENT articulations // ((accent | strong-accent | staccato | tenuto | // detached-legato | staccatissimo | spiccato | // scoop | plop | doit | falloff | breath-mark | // caesura | stress | unstress | other-articulation)*)> ObjectFactory factory = new ObjectFactory(); EmptyPlacement ep = factory.createEmptyPlacement(); switch (shape) { case DOT_set: case STACCATO: return factory.createArticulationsStaccato(ep); case ACCENT: return factory.createArticulationsAccent(ep); case STRONG_ACCENT: // Type for strong accent: either up (^) or down (v) // For the time being we recognize only up ones StrongAccent strongAccent = factory.createStrongAccent(); if (shape == Shape.STRONG_ACCENT) { strongAccent.setType(UpDown.UP); } return factory.createArticulationsStrongAccent(strongAccent); case TENUTO: return factory.createArticulationsTenuto(ep); case STACCATISSIMO: return factory.createArticulationsStaccatissimo(ep); /** TODO: implement related shapes case BREATH_MARK : case CAESURA : */ } logger.error("Unsupported ornament shape:{}", shape); return null; }
// -------------------// // getDynamicsObject // // -------------------// public static JAXBElement<?> getDynamicsObject(Shape shape) { ObjectFactory factory = new ObjectFactory(); Empty empty = factory.createEmpty(); switch (shape) { case DYNAMICS_F: return factory.createDynamicsF(empty); case DYNAMICS_FF: return factory.createDynamicsFf(empty); case DYNAMICS_FFF: return factory.createDynamicsFff(empty); // case DYNAMICS_FFFF : // return factory.createDynamicsFfff(empty); // // case DYNAMICS_FFFFF : // return factory.createDynamicsFffff(empty); // // case DYNAMICS_FFFFFF : // return factory.createDynamicsFfffff(empty); case DYNAMICS_FP: return factory.createDynamicsFp(empty); case DYNAMICS_FZ: return factory.createDynamicsFz(empty); case DYNAMICS_MF: return factory.createDynamicsMf(empty); case DYNAMICS_MP: return factory.createDynamicsMp(empty); case DYNAMICS_P: return factory.createDynamicsP(empty); case DYNAMICS_PP: return factory.createDynamicsPp(empty); case DYNAMICS_PPP: return factory.createDynamicsPpp(empty); // case DYNAMICS_PPPP : // return factory.createDynamicsPppp(empty); // // case DYNAMICS_PPPPP : // return factory.createDynamicsPpppp(empty); // // case DYNAMICS_PPPPPP : // return factory.createDynamicsPppppp(empty); case DYNAMICS_RF: return factory.createDynamicsRf(empty); case DYNAMICS_RFZ: return factory.createDynamicsRfz(empty); case DYNAMICS_SF: return factory.createDynamicsSf(empty); case DYNAMICS_SFFZ: return factory.createDynamicsSffz(empty); case DYNAMICS_SFP: return factory.createDynamicsSfp(empty); case DYNAMICS_SFPP: return factory.createDynamicsSfpp(empty); case DYNAMICS_SFZ: return factory.createDynamicsSfz(empty); } logger.error("Unsupported dynamics shape:{}", shape); return null; }