476548e
Pinchord · pinchord.git · Tickets · Changelog
Branches > main > 476548e > files
Format generate-mods.clj
Commit: 476548e14a2c81f8775901f43c4a471cb83b67a9
Parent: 93feb91
1 changed file:
generate-mods.clj view file
@@ -1,6 +1,6 @@ ; Map of symbols to names #_(def symbol-names- {"." "period"})+ {"." "period"}) (def symbol-names {"á" "aacute"@@ -143,8 +143,8 @@ "RPK" ")" "KF" ">" "PFS" "]"- "^PFS" "\\}"- }+ "^PFS" "\\}"}+ :shortcuts {"RK" "backspace" "^RK" "delete" "LPF" "escape"} :mod-shortcuts {"RF" {:no-mods "{^}\n"@@ -173,8 +173,8 @@ (defn apply-mods [x combos] (str "{#" (reduce (fn [acc mod]- (str mod "(" acc ")"))- x combos)+ (str mod "(" acc ")"))+ x combos) "}")) (defn ->map [xs]@@ -187,50 +187,46 @@ (def symbols-dict (->map- (let [{:keys [starter chords shortcuts mod-shortcuts]} symbols]- [(for [[mod symbol] chords- [chord combo] vowel-chords]- [- (str starter chord mod) (str "{^}" (apply-mods (symbol-name symbol) combo))- (str "+" starter chord mod) (str "{^}" (apply-mods (symbol-name symbol) combo))- ])- (for [[mod shortcut] shortcuts- [chord combo] (assoc vowel-chords "-" [])]- [- (str starter chord mod) (apply-mods shortcut combo)- (str "+" starter chord mod) (apply-mods shortcut combo)- ])- (for [[mod {:keys [no-mods with-mods]}] mod-shortcuts]- [- ; TODO need to add repitition for these?- [(str starter "-" mod) no-mods- (str "+" starter "-" mod) no-mods]- (for [[chord combo] vowel-chords]- [(str starter chord mod) (apply-mods with-mods combo)- (str "+" starter chord mod) (apply-mods with-mods combo)])- ])- (for [[mod symbol] chords]- [- ; the 4 combos of T* with and without e- (str starter "-" mod) (str "{}" symbol)- (str "+" starter "-" mod) (str "{^}" symbol)- (str starter "-" mod "e") (str "{}" symbol "=")- (str "+" starter "-" mod "e") (str "{^}" symbol "=")+ (let [{:keys [starter chords shortcuts mod-shortcuts]} symbols]+ [(for [[mod symbol] chords+ [chord combo] vowel-chords]+ [(str starter chord mod) (str "{^}" (apply-mods (symbol-name symbol) combo))+ (str "+" starter chord mod) (str "{^}" (apply-mods (symbol-name symbol) combo))]) - (str starter "-" mod "*") (str "{}" (rep 2 symbol))- (str "+" starter "-" mod "*") (str "{^}" (rep 2 symbol))- (str starter "-" mod "*e") (str "{}" (rep 2 symbol) "=")- (str "+" starter "-" mod "*e") (str "{^}" (rep 2 symbol) "=")+ (for [[mod shortcut] shortcuts+ [chord combo] (assoc vowel-chords "-" [])]+ [(str starter chord mod) (apply-mods shortcut combo)+ (str "+" starter chord mod) (apply-mods shortcut combo)]) - (str starter "-" mod "T") (str "{}" (rep 3 symbol))- (str "+" starter "-" mod "T") (str "{^}" (rep 3 symbol))- (str starter "-" mod "Te") (str "{}" (rep 3 symbol) "=")- (str "+" starter "-" mod "Te") (str "{^}" (rep 3 symbol) "=")+ (for [[mod {:keys [no-mods with-mods]}] mod-shortcuts]+ [ ; TODO need to add repitition for these?+ [(str starter "-" mod) no-mods+ (str "+" starter "-" mod) no-mods]+ (for [[chord combo] vowel-chords]+ [(str starter chord mod) (apply-mods with-mods combo)+ (str "+" starter chord mod) (apply-mods with-mods combo)])]) - (str starter "-" mod "T*") (str "{}" (rep 4 symbol))- (str "+" starter "-" mod "T*") (str "{^}" (rep 4 symbol))- (str starter "-" mod "T*e") (str "{}" (rep 4 symbol) "=")- (str "+" starter "-" mod "T*e") (str "{^}" (rep 4 symbol) "=")])])))+ (for [[mod symbol] chords]+ [ ; the 4 combos of T* with and without e+ (str starter "-" mod) (str "{}" symbol)+ (str "+" starter "-" mod) (str "{^}" symbol)+ (str starter "-" mod "e") (str "{}" symbol "=")+ (str "+" starter "-" mod "e") (str "{^}" symbol "=")