Skip to main content
Home
This release is 3 versions behind 8.2.1 — the latest version of @musodojo/enharmonic-note-selector. Jump to latest

Built and signed on GitHub Actions

A web component for selecting common spellings of enharmonic notes and dispatching an event with the selected note's name and integer.

This package works with Node.js, Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 weeks ago (8.1.0)
class EnharmonicNoteSelector
extends HTMLElement

A web component for selecting a musical note from its enharmonic equivalents.

Constructors

new
EnharmonicNoteSelector()

Properties

writeonly
noteColorGroup: ColorGroup | null

Sets the color group for note pitches. This will automatically calculate and apply high-contrast text colors for each background.

Sets whether the selector should be restricted to common root notes.

writeonly
selectedNoteName: string | null
readonly
noteColorGroup: ColorGroup | null

Gets the currently configured color group for note pitches.

Gets whether the selector is restricted to common root notes.

Gets the integer representation (0-11) of the selected note.

readonly
selectedNoteName: string | null

Gets the currently selected note name (e.g., "C♯", "D♭").

Methods

attributeChangedCallback(
name: string,
oldValue: string | null,
newValue: string | null,
): void

Selects a new, random note from the available options. Ensures the newly selected note is different from the current one.

Static Properties

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@musodojo/enharmonic-note-selector

Import symbol

import { EnharmonicNoteSelector } from "@musodojo/enharmonic-note-selector";
or

Import directly with a jsr specifier

import { EnharmonicNoteSelector } from "jsr:@musodojo/enharmonic-note-selector";

Add Package

pnpm i jsr:@musodojo/enharmonic-note-selector
or (using pnpm 10.8 or older)
pnpm dlx jsr add @musodojo/enharmonic-note-selector

Import symbol

import { EnharmonicNoteSelector } from "@musodojo/enharmonic-note-selector";

Add Package

yarn add jsr:@musodojo/enharmonic-note-selector
or (using Yarn 4.8 or older)
yarn dlx jsr add @musodojo/enharmonic-note-selector

Import symbol

import { EnharmonicNoteSelector } from "@musodojo/enharmonic-note-selector";

Add Package

vlt install jsr:@musodojo/enharmonic-note-selector

Import symbol

import { EnharmonicNoteSelector } from "@musodojo/enharmonic-note-selector";

Add Package

npx jsr add @musodojo/enharmonic-note-selector

Import symbol

import { EnharmonicNoteSelector } from "@musodojo/enharmonic-note-selector";

Add Package

bunx jsr add @musodojo/enharmonic-note-selector

Import symbol

import { EnharmonicNoteSelector } from "@musodojo/enharmonic-note-selector";