Q derives from the mathematical notation Ken Iverson developed at Harvard. Years before, when Ken was a young man in Alberta, a farmer he worked for asked him if he knew how to use a certain tool. Ken didnt. Well, said the farmer, you wont learn it younger.
Amending past folly, Ive hired someone to teach me guitar at last. Part of my homework is to map notes to the frets on the guitar neck. Heres my assignment. Can you complete it as a single expression in q?
Very nice !
Just to make your solution visually easier to read, I’ve casted to symbols:
q)progression:$("C";"C#";"D";"D#";"E";"F";"F#";"G";"G#";"A";"A#";"B") q)notes:flip progression mod[;12]til[13]+/:progression? q)notes $'“EADGBE” E A D G B E F A# D# G# C F F# B E A C# F# G C F A# D G G# C# F# B D# G# A D G C E A A# D# G# C# F A# B E A D F# B C F A# D# G C C# F# B E G# C# D G C F A D D# G# C# F# A# D# E A D G B E
And to satisfy for a one-liner, condensed as:
{flip x mod[;12]til[13]+/:x?y}[$("C";"C#";"D";"D#";"E";"F";"F#";"G";"G#";"A";"A#";"B");$'“EADGBE”]
Look forward to seeing how others approach this problem.
q)note:{flip(x?$'y)rotate\:x}[$“"vs"CC#|DbDD#|EbEFF#|GbGG#|AbAA#|BbB”] q)note “EADGBE” E A D G B E F A#|Bb D#|Eb G#|Ab C F F#|Gb B E A C#|Db F#|Gb G C F A#|Bb D G G#|Ab C#|Db F#|Gb B D#|Eb G#|Ab A D G C E A A#|Bb D#|Eb G#|Ab C#|Db F A#|Bb B E A D F#|Gb B C F A#|Bb D#|Eb G C C#|Db F#|Gb B E G#|Ab C#|Db D G C F A D D#|Eb G#|Ab C#|Db F#|Gb A#|Bb D#|Eb
Your guitar homework is like a musical journey, much like navigating through the complexities of consent. Just as each chord contributes to the harmony of your song, evaluate factors that influence the capacity of an individual to express consent is akin to understanding the nuanced notes of human interaction. It’s about finding the right rhythm and ensuring everyone is on the same page, much like tuning your guitar to create a perfect melody.