annotate _writetools/spellnote.m @ 9:4ea6619cb3f5 tip

removed log files
author matthiasm
date Fri, 11 Apr 2014 15:55:11 +0100
parents b5b38998ef3b
children
rev   line source
matthiasm@8 1 function outnote = spellnote(key,root,varargin)
matthiasm@8 2 if nargin > 2
matthiasm@8 3 type = varargin{1};
matthiasm@8 4 else
matthiasm@8 5 type = 'normal';
matthiasm@8 6 end
matthiasm@8 7
matthiasm@8 8 switch type
matthiasm@8 9 case 'normal'
matthiasm@8 10 if root ~= 13
matthiasm@8 11 scale{1} = {'C','C#','D','Eb','E','F','F#','G','Ab','A','Bb','B'};
matthiasm@8 12 scale{2} = {'Db','D','Eb','E','F','Gb','G','Ab','A','Bb','B','C'};
matthiasm@8 13 scale{3} = {'D','D#','E','F','F#','G','G#','A','Bb','B','C','C#'};
matthiasm@8 14 scale{4} = {'Eb','E','F','Gb','G','Ab','A','Bb','B','C','Db','D'};
matthiasm@8 15 scale{5} = {'E','F','F#','G','G#','A','Bb','B','C','C#','D','D#'};
matthiasm@8 16 scale{6} = {'F','Gb','G','Ab','A','Bb','B','C','Db','D','Eb','E'};
matthiasm@8 17 scale{7} = {'Gb','G','Ab','A','Bb','Cb','C','Db','D','Eb','E','F'};
matthiasm@8 18 scale{8} = {'G','G#','A','Bb','B','C','C#','D','D#','E','F','F#'};
matthiasm@8 19 scale{9} = {'Ab','A','Bb','B','C','Db','D','Eb','E','F','Gb','G'};
matthiasm@8 20 scale{10} = {'A','Bb','B','C','C#','D','D#','E','F','F#','G','G#'};
matthiasm@8 21 scale{11} = {'Bb','B','C','Db','D','Eb','E','F','Gb','G','Ab','A'};
matthiasm@8 22 scale{12} = {'B','C','C#','D','D#','E','F','F#','G','G#','A','A#'};
matthiasm@8 23 scale{13} = {'Eb','E','F','Gb','G','Ab','A','Bb','B','C','Db','D'};
matthiasm@8 24 scale{14} = {'E','F','F#','G','G#','A','Bb','B','C','C#','D','D#'};
matthiasm@8 25 scale{15} = {'F','Gb','G','Ab','A','Bb','B','C','Db','D','Eb','E'};
matthiasm@8 26 scale{16} = {'Gb','G','Ab','A','Bb','Cb','C','Db','D','Eb','E','F'};
matthiasm@8 27 scale{17} = {'G','G#','A','Bb','B','C','C#','D','D#','E','F','F#'};
matthiasm@8 28 scale{18} = {'Ab','A','Bb','B','C','Db','D','Eb','E','F','Gb','G'};
matthiasm@8 29 scale{19} = {'A','Bb','B','C','C#','D','D#','E','F','F#','G','G#'};
matthiasm@8 30 scale{20} = {'Bb','B','C','Db','D','Eb','E','F','Gb','G','Ab','A'};
matthiasm@8 31 scale{21} = {'B','C','C#','D','D#','E','F','F#','G','G#','A','A#'};
matthiasm@8 32 scale{22} = {'C','C#','D','Eb','E','F','F#','G','Ab','A','Bb','B'};
matthiasm@8 33 scale{23} = {'Db','D','Eb','E','F','Gb','G','Ab','A','Bb','B','C'};
matthiasm@8 34 scale{24} = {'D','D#','E','F','F#','G','G#','A','Bb','B','C','C#'};
matthiasm@8 35 outnote = scale{key}{mod(root - key,12)+1};
matthiasm@8 36 else
matthiasm@8 37 outnote = '';
matthiasm@8 38 end
matthiasm@8 39 case 'lily'
matthiasm@8 40 if root ~= 13
matthiasm@8 41 scale{1} = {'c','cis','d','es','e','f','fis','g','as','a','bes','b'};
matthiasm@8 42 scale{2} = {'des','d','es','e','f','ges','g','as','a','bes','b','c'};
matthiasm@8 43 scale{3} = {'d','dis','e','f','fis','g','gis','a','bes','b','c','cis'};
matthiasm@8 44 scale{4} = {'es','e','f','ges','g','as','a','bes','b','c','des','d'};
matthiasm@8 45 scale{5} = {'e','f','fis','g','gis','a','bes','b','c','cis','d','dis'};
matthiasm@8 46 scale{6} = {'f','ges','g','as','a','bes','b','c','des','d','es','e'};
matthiasm@8 47 scale{7} = {'ges','g','as','a','bes','ces','c','des','d','es','e','f'};
matthiasm@8 48 scale{8} = {'g','gis','a','bes','b','c','cis','d','dis','e','f','fis'};
matthiasm@8 49 scale{9} = {'as','a','bes','b','c','des','d','es','e','f','ges','g'};
matthiasm@8 50 scale{10} = {'a','bes','b','c','cis','d','dis','e','f','fis','g','gis'};
matthiasm@8 51 scale{11} = {'bes','b','c','des','d','es','e','f','ges','g','as','a'};
matthiasm@8 52 scale{12} = {'b','c','cis','d','dis','e','f','fis','g','gis','a','ais'};
matthiasm@8 53 scale{13} = {'es','e','f','ges','g','as','a','bes','b','c','des','d'};
matthiasm@8 54 scale{14} = {'e','f','fis','g','gis','a','bes','b','c','cis','d','dis'};
matthiasm@8 55 scale{15} = {'f','ges','g','as','a','bes','b','c','des','d','es','e'};
matthiasm@8 56 scale{16} = {'ges','g','as','a','bes','ces','c','des','d','es','e','f'};
matthiasm@8 57 scale{17} = {'g','gis','a','bes','b','c','cis','d','dis','e','f','fis'};
matthiasm@8 58 scale{18} = {'as','a','bes','b','c','des','d','es','e','f','ges','g'};
matthiasm@8 59 scale{19} = {'a','bes','b','c','cis','d','dis','e','f','fis','g','gis'};
matthiasm@8 60 scale{20} = {'bes','b','c','des','d','es','e','f','ges','g','as','a'};
matthiasm@8 61 scale{21} = {'b','c','cis','d','dis','e','f','fis','g','gis','a','ais'};
matthiasm@8 62 scale{22} = {'c','cis','d','es','e','f','fis','g','as','a','bes','b'};
matthiasm@8 63 scale{23} = {'des','d','es','e','f','ges','g','as','a','bes','b','c'};
matthiasm@8 64 scale{24} = {'d','dis','e','f','fis','g','gis','a','bes','b','c','cis'};
matthiasm@8 65 outnote = scale{key}{mod(root - key,12)+1};
matthiasm@8 66 else
matthiasm@8 67 outnote = 'r';
matthiasm@8 68 end
matthiasm@8 69 end