Skip to content
/ Notator Public

musicXML File Writer for SuperCollider with its own music notation, similar to LilyPond. When writing a musicXML file, it also converts the input code to standard sclang code for playback via scserver. It also supports Pitch Class Set and Scientific Pith Notation to get MIDI pitch numbers (MIDI notes) or frequencies from pitch names and vice versa.

License

Notifications You must be signed in to change notification settings

prko/Notator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[WARNING] This quark is still under test and is not listed in the Community Quark Directory for SuperColllider. The feature, help documents and manual may be modified without a change log until it is listed in the Community Quark Directory.

musicXML File Writer for SuperCollider with its own music notation, similar to LilyPond. When writing musicXML from the input music notation, it also writes an SCD file by converting the input into a standard SuperCollider code block, so that you can play it back via scserver.

The included Pitch Class Set and Scientific Pitch Notation classes allow you to get MIDI pitch numbers (MIDI notes) or frequencies from pitch names and vice versa.

Hits


Table of Contents

(Table of contents generated with markdown-toc)


1. How to Install

To install Notator Library, copy and paste the following code into the SC-IDE editor window, and evaluate it:

(
// "https://github.com/telephon/Strang".include; // It will be installed automatically.
"https://github.com/prko/Notator".include
)

2. Classes

2.1. Notator

Using the Notator class, you can play the score via the sc-server and create musicXML files to seamlessly edit the score created in sclang in your favourite music notation software that supports musicXML 4.0 (or higher) import. It provides the following automated functions:

  1. export a musicXML file and automatically open it in a music notation program,
  2. create an SCD file and automatically load and open it to play music:
    • all standard and abbreviated notation is rewritten;
    • adds a new code block to play the transcribed code;
    • tied notes and articulation are applied for playback;
    • tries to associate the staff label with the same name as SynthDef. Synth(\default) will be used if the same defname is not found with the staff label.

You can print (or make a PDF of) the musicXML file without editing it, but you should edit and modify the score, since the Notator class is not intended for engraving music, but for composing seamlessly from music designed with SuperCollider.

[NOTE] The musical notation for the Notator class can be opened as a form of score in any music software program that supports musicXML 4.0 (or higher) import and a score view functionality. The scores used in the examples in this help document are encoded by Dorico 4 Pro for some examples that do not display the musicXML file correctly, but are otherwise encoded by MuseScore 4.

[WARNING] The way musicXML is decoded varies from software to software, so a musicXML file may look different in different software that opens it. Also, if the decoding is not correct, the score may look incorrect. You should therefore be familiar with the musicXML import characteristics of the software you use.

2.1.1. Examples
2.1.1.1. Eighth-tone Scale through algorithmic construction
Code Results
(
var title = "Eighth-tone Scale", score;
score = [
(title: title, composer: 'a composer', right: '©'),
(
bar: 1, p1: (
lbl: \Violin,
atr: (key: [0, \none], time: [4, 4], staves: 1, clef: [[\g, 2]]),
v1: []
)
)
];

(0, 1/4 .. 12).mirror.clump(4).do { arg notesInBar, index;
var bar = index + 1;
if (bar > 1) {
score = score.add((bar: bar, p1: (v1: [])))
};
notesInBar.collect { arg aNote;
score[bar][\p1][\v1] = score[bar][\p1][\v1].add([aNote + 60]) }
};

x = Notator.notate(
score,
("~/Downloads/" ++ title ++ ".musicXML").standardizePath,
'MuseScore 4'
)
)
Score in MuseScore 4:
Eighth-tone_Scale-1HelpSource/Classes/resources/Eighth-tone_Scale.musicXML

SCD file: HelpSource/Classes/resources/Eighth-tone_Scale.scd
2.1.1.2. Twelve-tone matrix through algorithmic construction
Code Results
(
var title = "twelve-tone series", matrix_12tone;
matrix_12tone = { arg array;
var matrix = 12.collect { arg i; array[i]; array - (array[i] % 12) };
matrix.do { arg item; item.replace(11, \e).replace(10, \t).postln }
};
matrix_12tone = matrix_12tone.((0..11).scramble) + 72;

x = (
[(title: '12-tone series matrix', composer: 'randomised', rights: '©')] ++
matrix_12tone.collect { arg series, index;
if (index == 0) {
(
bar: index + 1,
p1: (
lbl: '',
atr: (key: [0, \none], time: \x, staves: 1, clef: [[\g, 2]]),
v1: series.collect { arg aNote; [aNote, \w] }
)
)
} {
series.postln;
(
bar: index + 1,
p1: (v1: series.collect { arg aNote; [aNote, \w] })
)
}
}
).notate(("~/Downloads/" ++ title ++ ".musicXML").standardizePath, 'MuseScore 4')
)
Score in MuseScore 4:
twelve-tone_seriesnotationHelpSource/Classes/resources/twelve-tone_series.musicXML

SCD file: HelpSource/Classes/resources/twelve-tone_series.scd
2.1.2. Preview of Online Help Document and Guideline

2.2. PitchClassSet

This is a Pitch Class Set implementation. Quarter tones are supported for the name system used in LilyPond and the musician-friendly naming convention. The sixteenth tones are supported for its own style \ez.

2.2.1. Examples
\a.pitchClassNum // -> 9.0
\a.pcnum // -> 9.0

9.pitchClassName // -> [ a, gx, bff, a♮, g𝄪, b𝄫, an, a, gS, bF ]
9.pcname // -> [ a, gx, bff, a♮, g𝄪, b𝄫, an, a, gS, bF ]
2.2.2. Preview of Online Help Document

2.3. SPN

Scientific Pitch Notation

This is an implementation of Scientific Pitch Notation (SPN). For the name system used in LilyPond (N.B.: the octave number follows the SPN.) and the musician-friendly naming convention, quarter tones are supported. For its own style \ez, sixteenth tones are supported.

In scientific pitch notation, middle A at 440 Hz is defined as A4. It is identical to the middle A at 440 Hz of A4 on Roland instruments, but 1 octave higher than the middle A at 440 Hz of A3 on Yahaha instruments. A4 in scientific notation is identical to A1 or A' in Helmholtz Pitch Notation.

2.3.1. Examples
\a4.midi // -> 69.0
\a4.cps // -> 440.0

69.midispn // -> [ a4, gx4, bff4 ]
440.cpsspn // -> [ a4, gx4, bff4 ]
2.3.2. Preview of Online Help Document
  • SPN class (Note: hyperlinks in the preview do not work!)

3. to do

  • implementing the following methods
\a4.pitchClassName
\a4.pcname
\aqf4.pitchClassNum
\a4.pcnum
\a4.octave

//69.pitchClassName
//69.pcname
69.octave

\a.pitchClassName
\a.pcname
//\a.pitchClassNum
//\a.pcnum
\a.octave

//9.pitchClassName
//9.pcname
9.octave
  • transcribing Chopin's piano prelude e-minor op. 28-4

About

musicXML File Writer for SuperCollider with its own music notation, similar to LilyPond. When writing a musicXML file, it also converts the input code to standard sclang code for playback via scserver. It also supports Pitch Class Set and Scientific Pith Notation to get MIDI pitch numbers (MIDI notes) or frequencies from pitch names and vice versa.

Resources

License

Stars

Watchers

Forks

Packages

No packages published