From c7821c7cb9026a96367e5301e5b848b29f73eb44 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sat, 25 May 2024 16:06:34 -0400 Subject: Build: cleanup --- .build.yml | 13 +-- HexBoard.ino | 6 +- Makefile | 4 +- Presets.h | 336 --------------------------------------------------------- README.md | 11 +- makeLayout.py | 65 ----------- makePitches.py | 18 ---- 7 files changed, 13 insertions(+), 440 deletions(-) delete mode 100644 Presets.h delete mode 100755 makeLayout.py delete mode 100755 makePitches.py diff --git a/.build.yml b/.build.yml index 19fb30e..0569aea 100644 --- a/.build.yml +++ b/.build.yml @@ -4,24 +4,17 @@ packages: - python3 - make - git -sources: - - https://github.com/buxtronix/arduino tasks: - libraries: | - mv arduino buxduino arduino-cli --additional-urls=https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json core update-index # Install the core for rp2040 arduino-cli --additional-urls=https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json core install rp2040:rp2040 arduino-cli lib install "MIDI library" "Adafruit NeoPixel" "U8g2" "Adafruit GFX Library" "GEM" sed -i 's@#include "config/enable-glcd.h"@//\0@g' ~/Arduino/libraries/GEM/src/config.h # remove dependency from GEM - cd buxduino - git apply ../Hex*/Rotary.patch - cd .. - mv buxduino/libraries/Rotary ~/Arduino/libraries/ - build: | cd Hex* make - mv build/build.ino.uf2 ../hexperiment.ino.uf2 - sha256sum ../hexperiment.ino.uf2 + mv build/build.ino.uf2 ../hexboard.ino.uf2 + sha256sum ../hexboard.ino.uf2 artifacts: - - hexperiment.ino.uf2 + - hexboard.ino.uf2 diff --git a/HexBoard.ino b/HexBoard.ino index 59232eb..9f2a87f 100644 --- a/HexBoard.ino +++ b/HexBoard.ino @@ -1643,7 +1643,7 @@ byte arpeggiatingNow = UNUSED_NOTE; // if this is 255, set to off (0% duty cycle) uint64_t arpeggiateTime = 0; // Used to keep track of when this note started playing in ARPEG mode - uint64_t arpeggiateLength = 65'536; // in microseconds. approx a 1/32 note at 114 BPM + uint64_t arpeggiateLength = 65536; // in microseconds. approx a 1/32 note at 114 BPM // RUN ON CORE 2 void poll() { @@ -2535,8 +2535,10 @@ the rotary knob and physical hex buttons. Documentation: - Rotary knob code: + Rotary knob code derived from: https://github.com/buxtronix/arduino/tree/master/libraries/Rotary + Copyright 2011 Ben Buxton. Licenced under the GNU GPL Version 3. + Contact: bb@cactii.net when the mechanical rotary knob is turned, the two pins go through a set sequence of diff --git a/Makefile b/Makefile index 9f7c1d3..39d36d7 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ # Copied fqbn from build.options.json build/build.ino.uf2: build/build.ino arduino-cli compile -b rp2040:rp2040:generic:flash=16777216_0,freq=133,opt=Small,rtti=Disabled,stackprotect=Disabled,exceptions=Disabled,dbgport=Disabled,dbglvl=None,usbstack=tinyusb,boot2=boot2_generic_03h_2_padded_checksum --output-dir build build -build/build.ino: Hexperiment.ino - cp Hexperiment.ino build/build.ino +build/build.ino: HexBoard.ino + cp HexBoard.ino build/build.ino /run/media/*/RPI-RP2/INFO_UF2.TXT: echo "Mounting device" diff --git a/Presets.h b/Presets.h deleted file mode 100644 index ffc4c87..0000000 --- a/Presets.h +++ /dev/null @@ -1,336 +0,0 @@ -// 1/8192 of a whole tone pitch bend accuracy ~ 0.025 cents. -// over 128 possible notes, error shd be less than 0.0002 cents to avoid drift. -// expressing cents to 6 sig figs should be sufficient. -// notation -- comma delimited string. -// first entry should be the label for A=440. -// last entry should be C, i.e. the "home key". -// the rest of the scale C thru G will be spelled using the same pattern. -// the number of commas is used to count where A and C are located in step space. -tuningDef tuningOptions[] = { - { "12 EDO", 12, 100.000, - {{"C" ,-9},{"C#",-8},{"D" ,-7},{"Eb",-6},{"E" ,-5},{"F",-4} - ,{"F#",-3},{"G" ,-2},{"G#",-1},{"A" , 0},{"Bb", 1},{"B", 2} - }}, - { "17 EDO", 17, 70.5882, - {{"C",-13},{"Db",-12},{"C#",-11},{"D",-10},{"Eb",-9},{"D#",-8} - ,{"E", -7},{"F" , -6},{"Gb", -5},{"F#",-4},{"G", -3},{"Ab",-2} - ,{"G#",-1},{"A" , 0},{"Bb", 1},{"A#", 2},{"B", 3} - }}, - { "19 EDO", 19, 63.1579, - {{"C" ,-14},{"C#",-13},{"Db",-12},{"D",-11},{"D#",-10},{"Eb",-9},{"E",-8} - ,{"E#", -7},{"F" , -6},{"F#", -5},{"Gb",-4},{"G", -3},{"G#",-2} - ,{"Ab", -1},{"A" , 0},{"A#", 1},{"Bb", 2},{"B", 3},{"Cb", 4} - }}, - { "22 EDO", 22, 54.5455, - {{" C", -17},{"^C",-16},{"vC#",-15},{"vD",-14},{" D",-13},{"^D",-12} - ,{"^Eb",-11},{"vE",-10},{" E", -9},{" F", -8},{"^F", -7},{"vF#",-6} - ,{"vG", -5},{" G", -4},{"^G", -3},{"vG#",-2},{"vA", -1},{" A", 0} - ,{"^A", 1},{"^Bb", 2},{"vB", 3},{" B", 4} - }}, - { "24 EDO", 24, 50.0000, - {{"C", -18},{"C+",-17},{"C#",-16},{"Dd",-15},{"D",-14},{"D+",-13} - ,{"Eb",-12},{"Ed",-11},{"E", -10},{"E+", -9},{"F", -8},{"F+", -7} - ,{"F#", -6},{"Gd", -5},{"G", -4},{"G+", -3},{"G#",-2},{"Ad", -1} - ,{"A", 0},{"A+", 1},{"Bb", 2},{"Bd", 3},{"B", 4},{"Cd", 5} - }}, - { "31 EDO", 31, 38.7097, - {{"C",-23},{"C+",-22},{"C#",-21},{"Db",-20},{"Dd",-19} - ,{"D",-18},{"D+",-17},{"D#",-16},{"Eb",-15},{"Ed",-14} - ,{"E",-13},{"E+",-12} ,{"Fd",-11} - ,{"F",-10},{"F+", -9},{"F#", -8},{"Gb", -7},{"Gd", -6} - ,{"G", -5},{"G+", -4},{"G#", -3},{"Ab", -2},{"Ad", -1} - ,{"A", 0},{"A+", 1},{"A#", 2},{"Bb", 3},{"Bd", 4} - ,{"B", 5},{"B+", 6} ,{"Cd", 7} - }}, - { "41 EDO", 41, 29.2683, - {{" C",-31},{"^C",-30},{" C+",-29},{" Db",-28},{" C#",-27},{" Dd",-26},{"vD",-24} - ,{" D",-24},{"^D",-23},{" D+",-22},{" Eb",-21},{" D#",-20},{" Ed",-19},{"vE",-18} - ,{" E",-17},{"^E",-16} ,{"vF",-15} - ,{" F",-14},{"^F",-13},{" F+",-12},{" Gb",-11},{" F#",-10},{" Gd", -9},{"vG", -8} - ,{" G", -7},{"^G", -6},{" G+", -5},{" Ab", -4},{" G#", -3},{" Ad", -2},{"vA", -1} - ,{" A", 0},{"^A", 1},{" A+", 2},{" Bb", 3},{" A#", 4},{" Bd", 5},{"vB", 6} - ,{" B", 7},{"^B", 8} ,{"vC", 9} - }}, - { "53 EDO", 53, 22.6415, - {{" C", -40},{"^C", -39},{">C",-38},{"vDb",-37},{"Db",-36} - ,{" C#",-35},{"^C#",-34},{"D",-29},{"vEb",-28},{"Eb",-27} - ,{" D#",-26},{"^D#",-25},{"E",-20},{"vF", -19} - ,{" F", -18},{"^F", -17},{">F",-16},{"vGb",-15},{"Gb",-14} - ,{" F#",-13},{"^F#",-12},{"G", -7},{"vAb", -6},{"Ab", -5} - ,{" G#", -4},{"^G#", -3},{"A", 2},{"vBb", 3},{"Bb", 4} - ,{" A#", 5},{"^A#", 6},{"C", -52},{" C+",-51},{"C#",-46},{" Dd",-45},{"D", -40},{" D+",-39},{"Eb",-34},{" Ed",-33},{"E", -28},{" E+",-27},{"F", -22},{" F+",-21},{"F#",-16},{" Gd",-15},{"G", -10},{" G+", -9},{"G#", -4},{" Ad", -3},{"A", 2},{" A+", 3},{"Bb", 8},{" Bd", 9},{"B", 14},{" Cd", 15},{" 0: - a[row].append(a[row][col-1] + across) - else: # col == 0 - if row%2: - ref = a[row-1][0] - else: - ref = a[row-1][1] - a[row].append(ref+downleft) - return a - -def print_qmk(layout): - # Mapping to QMK constants - start = ["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"] - start = ["MI_"+x for x in start] - arr = start.copy() - for n in range(1,6): - arr += [x+str(n) for x in start] - row = 0 - print("LAYOUT_inorder(") - for Row in layout: - if row%2 == 0: - n = int(row/2)+1 - print(f"_______, ", end='') - else: - print(" ", end='') - for entry in Row: - print(arr[entry] if entry < len(arr) else 'KC_NO', end=', ') - print() - row = row + 1 - print(" ),") - -if __name__ == '__main__': - layout = makeLayout(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3])) - if len(sys.argv)==5: - print_qmk(layout) - exit() - #print(layout) - row = 0 - for Row in layout: - if row%2 == 0: - n = int(row/2)+1 - print(f" ROW_FLIP(CMDB_{n}, ", end='') - else: - print(" ROW_FLIP(", end='') - col = 1 - for entry in Row: - end = ', ' if col < (oddCols if row%2 else evenCols) else '' - print(entry, end=end) - col = col + 1 - print(')' if row +1 == rows else '),') - row = row + 1 diff --git a/makePitches.py b/makePitches.py deleted file mode 100755 index 7829e52..0000000 --- a/makePitches.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 -import sys - -pitches=128 - -# calculate integer values in hertz for equal-temperament scales -def makePitches(root, tones, offset): - a = [] - for index in range(offset, pitches+offset): - a.append(round(root*(2**(index/tones)))) - return a - -if __name__ == '__main__': - offset = 0 - if len(sys.argv) > 3: - offset = int(sys.argv[3]) - pitches = makePitches(float(sys.argv[1]), int(sys.argv[2]), offset) - print(pitches) -- cgit 1.4.1