Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (
- var
- // all notes from C - B
- notes = 65.to(65+6).collect({|char|char.asAscii}).rotate(-2),
- // at what notes do we have half tone intervals to next note (counting notes from 0 for C)
- half_tones = [ 2, 6 ],
- // all notes including those for half-tones
- notes_with_sharp = notes.collect({|note, index|
- if(half_tones.matchItem(index), { [ note ] }, { [ note, note.asString ++ \is ] });
- }).flatten,
- // all relevant scale numbers
- scale_numbers = 0.to(8).collect({|scale| scale }),
- // all notes in all scales
- all_notes = scale_numbers.collect({|scale|
- notes_with_sharp.collect({|note|
- note.asString ++ " " ++ scale.asString;
- });
- }).flatten,
- // frequencies for each half-steps four scales down and for scales up the A4 note - C0 - B8
- note_freqs = Array.geom(12*4 + 10, 440, 2.pow(-1/12)).reject({arg f;f==440}).reverse ++ Array.geom(12*4 + 3, 440, 2.pow(1/12)),
- all_notes_with_freqs = Dictionary.newFrom( all_notes.collect({|a_note, index| [ a_note, note_freqs.at(index) ] }).flatten );
- all_notes_with_freqs.at("C 1").postln;
- all_notes_with_freqs.at("Gis 4").postln;
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement