Note

part of wslib


a placeholder for musical notes, based on the midiname methods in wslib


Note( name, midi, freq, cents )

from the first three arguments only one should be not nil.


Note( "G4" );  // -> will show as a name string in the post window (asString)

Note( "G4" ).asCompileString;  // -> will show as a name string in the post window (asString)


Note( midi: 65 );

Note( freq: 456 ).asCompileString;



n = Note( "G#3", cents: 25 );


// all the folowing methods can also be used as setter:

n.cents;

n.name;

n.oct;

n.note;

n.sign;

n.alt; // + 1 means #


n.alt = 3;


n.simplifyName; // enharmonic shift


// possible binary operators

// +, -, *, /, min, max, wrap, clip, rand, round 


n + Note( "A1" );

n + 1;

(n / 2).asCompileString;

n.rand; // only whole notes; no cents