Created
April 20, 2019 21:29
-
-
Save datramt/03ecfc0bd4f73971b7e31fc7b84a80b7 to your computer and use it in GitHub Desktop.
method for indexing an array of chords using neo-riemannian transformations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nr_t (this_current_chord, this_transform_type) | |
case this_transform_type | |
when "t_t" #thru transformation (no transformation occurs) | |
return this_current_chord | |
when "p_t" #parallel transformation | |
return (this_current_chord+12)%24 | |
when "r_t" #relative transformation | |
return this_current_chord < 12? (this_current_chord = (this_current_chord+3)%12+12)%24 : (((this_current_chord-12)+9)%12)%24 | |
when "l_t" #leading tone transformation | |
return this_current_chord < 12? (this_current_chord = (this_current_chord+8)%12+12)%24 : (((this_current_chord-12)+4)%12)%24 | |
when "r_p" #relative-parallel transformation | |
return nr_t (nr_t this_current_chord, "r_t"), "p_t" | |
when "l_p" #leading tone-parallel transformation | |
return nr_t (nr_t this_current_chord, "l_t"), "p_t" | |
when "p_r" #parallel-relative transformation | |
return nr_t (nr_t this_current_chord, "p_t"), "r_t" | |
when "p_l" #parallel-leading tone transformation | |
return nr_t (nr_t this_current_chord, "p_t"), "l_t" | |
when "n_t" #Nebenverwandt transformation | |
return nr_t (nr_t (nr_t this_current_chord, "r_t"), "l_t"), "p_t" | |
when "s_t" #slide transformation | |
return nr_t (nr_t (nr_t this_current_chord, "l_t"), "p_t"), "r_t" | |
when "h_t" #hexatonic pole | |
return nr_t (nr_t (nr_t this_current_chord, "l_t"), "p_t"), "l_t" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment