Harmonics Language Extension for VS Code
Overview
The Harmonics Language Extension provides syntax highlighting and language support for the Extended Roman Text Numeral Notation (ERNTXT) in Visual Studio Code. This domain-specific language enables composers, music theorists, and students to create harmonic grids in Roman numeral notation and melodies with precise beat and measure specifications.
Features
- Syntax Highlighting: Colorizes different elements of the ERNTXT syntax for improved readability
- Language Support: Recognizes
.ern
, .erntxt
, .rntxt
, and .har
file extensions
- Musical Notation: Supports Roman numeral chord notation, melody lines, accompaniment patterns, and performance events
Language Specification
Harmonics follows a context-free grammar with an Extended Backus-Naur Form (EBNF) notation. The language consists of:
Each composition begins with metadata that provides general information:
Composer: Claude Debussy
Piece: Prélude - "Brumes matinales"
Time Signature: 4/4
Tempo: 72
Instrument: V1=1, V2=1, B=1, T=1, A=1, S=1
Harmony (Measure Lines)
Chord progressions are specified using Roman numeral notation:
m1 b1 C: I b2 V6 b3 vi b4 IV
m1
indicates measure 1
b1
, b2
, etc. indicate beats within the measure
C:
specifies the key (C major)
I
, V6
, etc. are Roman numeral chord symbols
- Secondary dominants, borrowed chords, and inversions are supported (e.g.,
V7/V
, bVI
)
- Chord alterations can be specified with brackets (e.g.,
[add9]
, [b5]
, [no3]
)
Melody Lines
Melodies can be specified using absolute notation or interval notation:
mel1 V1 b1 E5 b2 G5 b3 C6 b4 B5
mel1
indicates the melody for measure 1
V1
specifies the voice (Voice 1)
b1
, b2
, etc. indicate beats
E5
, G5
, etc. are absolute note names with octave numbers
- Interval notation is also supported:
/3
(third of the chord), /#5o1
(sharp fifth, one octave up)
- Rests are indicated with
r
or R
Accompaniment Patterns
Voice participation per beat can be defined:
acc1 b1 1 b2 23 b3 124 b4 23
acc1
indicates accompaniment for measure 1
b1
, b2
, etc. indicate beats
- Numbers indicate which voices are active (1=Bass, 2=Tenor, 3=Alto, 4=Soprano)
Events
Performance parameters can be modified dynamically:
e1 b1 tempo(72) b1 velocity(pp)
e1
indicates events for measure 1
b1
indicates the beat
- Functions include
tempo()
, velocity()
, start_crescendo()
, etc.
Variables
Reusable patterns can be defined as variables:
acc = b1 1 b2 23 b3 124 b4 23
@acc
Beat Numbering
Beat numbering follows the conventions for the given meter:
- 4/4: 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5
- 2/2: 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75
- 6/8: 1, 1.33, 1.66, 2, 2.33, 2.66
- Other time signatures follow similar patterns
Example
Composer: AI Assistant (in style of Claude Debussy)
Piece: Prélude - "Brumes matinales" (Morning in Mists)
Time Signature: 4/4
Tempo: 72
Instrument: V1=1, V2=1, B=1, T=1, A=1, S=1
acc = b1 1 b2 23 b3 124 b4 23
@acc
Note: Section A - Ethereal opening
m1 b1 Db: I b3 bVI[add13] b4.5 V+65[add9]/V ||
mel1 V1 b1 F5 b2 Ab5 b3 Db6 b4 Bbb5
acc1 b1 1 b2 23 b3 124 b4 23
m2 b1.5 IV65[add9] b3 iii65[addb13]/V/V ||
mel2 V1 b1.5 Ab5 b2 G5 b3 F5 b4 Eb5
acc2 b1 124 b2.33 3 b3 12 b4 34
Requirements
- Visual Studio Code version 1.89.0 or higher
Extension Settings
This extension contributes the following settings:
harmonics.enableSyntaxHighlighting
: Enable/disable syntax highlighting for Harmonics files.
Known Issues
Please report any issues on the GitHub repository.
Release Notes
0.0.1
- Initial release with basic syntax highlighting for Harmonics language
For more detailed information about the Harmonics language syntax and usage, please refer to the documentation.
Enjoy composing with Harmonics!