# My guitar homework

**URL:** <https://forum.kx.com/t/my-guitar-homework/12789>\
**Category:** Community Support\
**Tags:** blogs\
**Created:** [February 2, 2023, 1:50pm UTC](https://forum.kx.com/t/my-guitar-homework/12789 "2023-02-02T13:50:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SJT1](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@SJT1](https://forum.kx.com/u/SJT1)\
**Post date:** [February 2, 2023, 1:50pm UTC](https://forum.kx.com/t/my-guitar-homework/12789/1 "2023-02-02T13:50:00Z")

</div>

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 didnt. Well, said the farmer, you wont learn it younger.&nbsp;

Amending past folly, Ive hired someone to teach me guitar at last. Part of my homework is to map notes to the frets on the guitar neck. Heres my assignment. Can you complete it as a single expression in q?

&nbsp;

---

<div class="post-metadata">

**Author:** ![RoryK1](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@RoryK1](https://forum.kx.com/u/RoryK1)\
**Post date:** [February 2, 2023, 9:57pm UTC](https://forum.kx.com/t/my-guitar-homework/12789/2 "2023-02-02T21:57:00Z")

</div>

Is it possible to have an example? Notes can map to multiple spots, so it is unclear.

---

<div class="post-metadata">

**Author:** ![cillianreilly1](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@cillianreilly1](https://forum.kx.com/u/cillianreilly1)\
**Post date:** [February 2, 2023, 11:08pm UTC](https://forum.kx.com/t/my-guitar-homework/12789/3 "2023-02-02T23:08:00Z")

</div>

q)progression:“C#D#EF#G#A#B” q)notes:flip progression mod[;12]til[13]+/:progression? q)notes"EADGBE" “EADGBE” “F###CF” “#BEA##” “GCF#DG” “###B##” “ADGCEA” “####F#” “BEAD#B” “CF##GC” “##BE##” “DGCFAD” “######” “EADGBE”

First row is the open strings, and runs as far as the 12th fret, at which point the pattern repeats. Also works for alternative tunings:

q)notes"DADGBE" // Drop D q)notes"DADGAD" // DADGAD

---

<div class="post-metadata">

**Author:** ![davidcrossey1](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@davidcrossey1](https://forum.kx.com/u/davidcrossey1)\
**Post date:** [February 3, 2023, 6:50am UTC](https://forum.kx.com/t/my-guitar-homework/12789/4 "2023-02-03T06:50:00Z")

</div>

Very nice&nbsp;&nbsp;!  
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&nbsp;&nbsp;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.

---

<div class="post-metadata">

**Author:** ![SJT1](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@SJT1](https://forum.kx.com/u/SJT1)\
**Post date:** [February 3, 2023, 9:49am UTC](https://forum.kx.com/t/my-guitar-homework/12789/5 "2023-02-03T09:49:00Z")

</div>

Love the train of unaries,&nbsp;&nbsp;!

My teacher made something of C# also being D?, so&nbsp;

&nbsp;

q)note:{flip(x?`$'y)rotate\:x}[`$“`"vs"C`C#|Db`D`D#|Eb`E`F`F#|Gb`G`G#|Ab`A`A#|Bb`B”] 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

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![JudithSmith511](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@JudithSmith511](https://forum.kx.com/u/JudithSmith511)\
**Post date:** [November 17, 2023, 6:13am UTC](https://forum.kx.com/t/my-guitar-homework/12789/6 "2023-11-17T06:13:00Z")

</div>

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,&nbsp;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.
