Skip to content

Commit

Permalink
Release v0.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert committed Jun 22, 2024
1 parent 356cbfd commit 5c5211a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "music21j",
"version": "0.16.1",
"version": "0.16.2",
"description": "A toolkit for computer-aided musicology, Javascript version",
"main": "releases/music21.debug.js",
"typings": "releases/src/main.d.ts",
Expand Down
30 changes: 25 additions & 5 deletions releases/music21.debug.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* music21j version 0.16.1 built on 2024-06-11.
* music21j version 0.16.2 built on 2024-06-22.
* Copyright (c) 2013-2024 Michael Scott Asato Cuthbert
* BSD License, see LICENSE
*
Expand Down Expand Up @@ -13945,6 +13945,15 @@ class NotRest extends GeneralNote {
this.activeVexflowNote = vfn;
return vfn;
}
vexflowAccidentalsAndDisplay(vfn) {
let _options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
super.vexflowAccidentalsAndDisplay(vfn, _options);
if (this.stemDirection === 'noStem') {
vfn.glyphProps.stem = false;
vfn.glyphProps.flag = false;
// vfn.render_options.stem_height = 0;
}
}
}
/* ------- Note ----------- */
/**
Expand Down Expand Up @@ -14057,10 +14066,7 @@ class Note extends NotRest {
if (_debug__WEBPACK_IMPORTED_MODULE_8__.debug) {
console.log(this.stemDirection);
}
if (this.stemDirection === 'noStem') {
vfn.glyphProps.stem = false;
// vfn.render_options.stem_height = 0;
} else {
if (this.stemDirection !== 'noStem') {
// correct VexFlow stem length for notes far from the center line;
let staveDNNSpacing = 5;
if (stave !== undefined) {
Expand Down Expand Up @@ -21349,6 +21355,17 @@ function setStemDirectionForUnspecified(s) {
single_clef_context = s.getContextByClass(_clef__WEBPACK_IMPORTED_MODULE_2__.Clef);
}
for (const n of s.rc(_note__WEBPACK_IMPORTED_MODULE_3__.NotRest)) {
if (n.pitches.length > 1) {
const pitchSet = new Set(n.pitches.map(p => p.diatonicNoteNum));
if (pitchSet.size < n.pitches.length) {
// bug in Vexflow v4 at least -- chords with augmented seconds
// and down stems do no render properly.
// set their stems to 'unspecified' which Vexflow will currently
// render as upstems.
n.stemDirection = 'unspecified';
continue;
}
}
if (n.stemDirection !== 'unspecified') {
continue;
}
Expand All @@ -21366,6 +21383,9 @@ function setStemDirectionForUnspecified(s) {
}
const _up_down = ['up', 'down'];
const _up_down_unspecified = ['up', 'down', 'unspecified'];
/**
* Set stem directions for all notes in a beam group.
*/
function setStemDirectionOneGroup(group) {
let {
setNewStems = true,
Expand Down
2 changes: 1 addition & 1 deletion releases/music21.debug.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions releases/src/note.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export declare class NotRest extends GeneralNote {
* clef to set the stem direction of.
*/
vexflowNote({ clef }?: VexflowNoteOptions): VFStaveNote;
vexflowAccidentalsAndDisplay(vfn: VFStaveNote, _options?: {}): void;
}
/**
* A very, very important class! music21.note.Note objects combine a music21.pitch.Pitch
Expand Down
2 changes: 1 addition & 1 deletion releases/src/note.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion releases/src/pitch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export declare class Accidental extends prebase.ProtoM21Object {
* @type {string}
* @readonly
*/
get vexflowModifier(): "#" | "##" | "###" | "bb" | "b" | "n" | "bbb";
get vexflowModifier(): "n" | "#" | "##" | "###" | "bb" | "b" | "bbb";
/**
* Returns the modifier in unicode or
* for double and triple accidentals, as a hex escape
Expand Down
3 changes: 3 additions & 0 deletions releases/src/stream/makeNotation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ export declare function setStemDirectionForBeamGroups(s: stream.Stream, { setNew
* they should have already had their stem directions set in setBeams
*/
export declare function setStemDirectionForUnspecified(s: stream.Stream): void;
/**
* Set stem directions for all notes in a beam group.
*/
export declare function setStemDirectionOneGroup(group: note.NotRest[], { setNewStems, overrideConsistentStemDirections, }?: StemDirectionBeatGroupOptions): void;
//# sourceMappingURL=makeNotation.d.ts.map
2 changes: 1 addition & 1 deletion releases/src/stream/makeNotation.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c5211a

Please sign in to comment.