@dsebastien/music-notation 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -166,6 +166,7 @@ if (!result.ok) console.warn(result.error)
166
166
  - **Tabs and scores**: `@dsebastien/music-notation/tab` draws `tab` and `score` blocks (alphaTex, or Guitar Pro and MusicXML files) with [alphaTab](https://alphatab.net), and adds a player. It also converts score files, text tabs and chord sheets, and exports Guitar Pro 7 and MIDI.
167
167
  - `generateVoicings(symbol, options)` finds every playable voicing of a chord on any tuning, easiest first, with fingers and shape names; `fingerVoicing(frets)` fingers any voicing. `fingeringInWords(chord)` writes a guitar or piano chord's fingering in plain sentences, as `caption: fingering` shows it under a diagram.
168
168
  - The renderers (`renderGuitarDiagram`, `renderKeyboard`, `renderFretboard`, `renderChart`, `renderStrum`, `renderPicking`, `renderCircle`), the parsers and the theory helpers (`parseChord`, `transposeChord`, `chordNoteSet`, `scaleNoteSet`…) are exported too.
169
+ - Note names in solfège (Do Ré Mi) or German (H for B): `naming: solfege` or `naming: german` in a block, or as an option; notes may be written in any of the three systems.
169
170
  - A pick layer for drills: with `pick`, every string × fret of a fretboard and every key of a keyboard is a target that a click or the keyboard picks; the app marks picks right or wrong (`attachPick`).
170
171
  - Styles: `injectStyles(document)`, or ship `@dsebastien/music-notation/music-notation.css`. Colors follow Obsidian's theme variables, with fallbacks for any page.
171
172
 
@@ -3,6 +3,7 @@
3
3
  * show, or throws an Error whose message is meant for the user.
4
4
  */
5
5
  import type { PickOptions } from '../render/pick.js';
6
+ import type { Naming } from '../theory/naming.js';
6
7
  import type { VoicingLookup } from '../voicings/index.js';
7
8
  import type { PlayOptions } from '../playback/controls.js';
8
9
  import { type LayoutDefaults } from '../render/layout.js';
@@ -45,6 +46,11 @@ export interface RenderOptions extends LayoutDefaults {
45
46
  * diagrams are not playable. Off by default.
46
47
  */
47
48
  pick?: boolean | PickOptions;
49
+ /**
50
+ * How note names show (#12): `letters` (default), `solfege` (Do Ré Mi) or `german` (H for B).
51
+ * A block's `naming:` line wins. Input reads all three.
52
+ */
53
+ naming?: Naming;
48
54
  }
49
55
  export type Renderer = (doc: Document, source: string, options: RenderOptions) => Element;
50
56
  /** Renders one diagram from a parsed block (the parts of a row share settings, see renderBlock). */
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export { soundingChord, soundsLike, fretsFromCapo, capoTuning, parseCapo, parseF
7
7
  export { generateVoicings, fingerVoicing, voicingShape, MAX_GENERATED_STRINGS, type GeneratedVoicing, type VoicingOptions, type VoicingShape } from './chord/generate.js';
8
8
  export { sequenceOf, scaleRun, lengthOf, lightPlayer, pluckedString, pianoTone, DEFAULT_SEQUENCE, DEFAULT_STRUM, type NoteEvent, type NotePlayer, type PluckOptions, type PlayHandle, type PlayKind, type Sound, type SequenceOptions } from './playback/player.js';
9
9
  export { attachPlayback, type PlayOptions, type TimedBar } from './playback/controls.js';
10
+ export { volumeChanged } from './playback/live-volume.js';
10
11
  export { followNotes, noteTargets, PLAYING_CLASS, START_WAIT, type Follower } from './playback/follow.js';
11
12
  export { transition, smoothProgression, type TransitionStep, type TransitionOptions, type ProgressionStep, type ProgressionOptions } from './chord/transitions.js';
12
13
  export { fingeringInWords, type GuitarFingering, type PianoFingering } from './chord/fingering-words.js';
@@ -15,6 +16,7 @@ export { renderKeyboard, parseKeyRange, keyRangeOf, type KeyboardOptions } from
15
16
  export { pianoVoicing, pianoPitches, triadFingering, type PianoVoicing, type PianoVoicingOptions, type PianoVoicingStyle, type PianoHands, type RootlessForm, type ShellForm } from './keyboard/piano-chord.js';
16
17
  export { standardScaleFingering, scaleFingers, type ScaleHand } from './keyboard/scale-fingering.js';
17
18
  export { renderFretboard, type FretboardOptions } from './fretboard/fretboard.js';
19
+ export { NAMINGS, parseNaming, namingOf, toLetters, lettersInBlock, quoteAsWritten, noteInNaming, chordInNaming, shownText, withNaming, type Naming, type BlockReading } from './theory/naming.js';
18
20
  export { attachPick, type Pick, type PickAt, type PickLayer, type PickOptions, type PickResult } from './render/pick.js';
19
21
  export { parseTuning } from './fretboard/tuning.js';
20
22
  export { parseChordPro, parseLyrics, type Song, type Section, type Line, type Segment, type ChordDefinition } from './chords/chordpro.js';