From 39498689022b3140b02a64350257a466668b8c12 Mon Sep 17 00:00:00 2001 From: echophon Date: Mon, 10 Oct 2022 13:32:49 -0700 Subject: [PATCH 1/6] er301 operator --- lib/library.lua | 1 + lib/library/_crow_er301.lua | 93 +++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 lib/library/_crow_er301.lua diff --git a/lib/library.lua b/lib/library.lua index e37573d..2f15708 100644 --- a/lib/library.lua +++ b/lib/library.lua @@ -19,6 +19,7 @@ ops["`"] = include("lib/library/_crow_wsyn") ops["<"] = include("lib/library/_grid_read") ops[">"] = include("lib/library/_grid_write") ops['('] = include("lib/library/_arc_read") +ops[')'] = include("lib/library/_crow_er301") ops["="] = include("lib/library/_osc_out") ops.A = include("lib/library/a") ops.B = include("lib/library/b") diff --git a/lib/library/_crow_er301.lua b/lib/library/_crow_er301.lua new file mode 100644 index 0000000..2dcf3ea --- /dev/null +++ b/lib/library/_crow_er301.lua @@ -0,0 +1,93 @@ +local crow_er301 = function(self, x, y) + self.y = y + self.x = x + self.name = "crow_ii_er301_voice" + self.ports = { {1, 0, "in-channel"}, {2, 0, "in-octave"}, {3, 0, "in-note"} } + self:spawn(self.ports) + + local transpose_tab = { + ["A"] = 9, + ["a"] = 10, + ["B"] = 11, + ["C"] = 0, + ["c"] = 1, + ["D"] = 2, + ["d"] = 3, + ["E"] = 4, + ["F"] = 5, + ["f"] = 6, + ["G"] = 7, + ["g"] = 8, + ["H"] = 9, + ["h"] = 10, + ["I"] = 11, + ["J"] = 12, + ["j"] = 13, + ["K"] = 14, + ["k"] = 15, + ["L"] = 16, + ["M"] = 17, + ["m"] = 18, + ["N"] = 19, + ["n"] = 20, + ["O"] = 21, + ["o"] = 22, + ["P"] = 23, + ["Q"] = 24, + ["q"] = 25, + ["R"] = 26, + ["r"] = 27, + ["S"] = 28, + ["T"] = 29, + ["t"] = 30, + ["U"] = 31, + ["u"] = 32, + ["V"] = 33, + ["v"] = 34, + ["W"] = 35, + ["X"] = 36, + ["x"] = 37, + ["Y"] = 38, + ["y"] = 39, + ["Z"] = 40, + ["e"] = 4, + ["l"] = 5, + ["s"] = 5, + ["z"] = 5, + ["b"] = 12, + ["i"] = 12, + ["p"] = 12, + ["w"] = 12, + ["0"] = 0, + ["1"] = 2, + ["2"] = 4, + ["3"] = 5, + ["4"] = 7, + ["5"] = 9, + ["6"] = 11, + ["7"] = 12, + ["8"] = 14, + ["9"] = 16, + } + + local channel = util.clamp(self:listen(self.x + 1, self.y) or 0, 0, 5) + 1 + local octave = (util.clamp(self:listen(self.x + 2, self.y) or 3, 0, 6) * 12) - 36 + local note = "C" + + if self:glyph_at(self.x + 3, self.y) == "." then + note = "C" + else + note = self:glyph_at(self.x + 3, self.y) + end + + local level = util.clamp(self:listen(self.x + 4, self.y) or 3, 0, 5) + local tot_note = transpose_tab[note] + octave + + if self:neighbor(self.x, self.y, "*") then + -- crow.ii.jf.play_voice(channel, tot_note / 12, level / 1) + crow.ii.er301.cv(channel, tot_note /12) + crow.ii.er301.tr_pulse(channel) + end +end + +return crow_er301 From 5fd2192a620cbd792318b530da84fea288011e37 Mon Sep 17 00:00:00 2001 From: echophon Date: Mon, 10 Oct 2022 15:02:25 -0700 Subject: [PATCH 2/6] er301 operator --- orca.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orca.lua b/orca.lua index 703d97d..be182d2 100644 --- a/orca.lua +++ b/orca.lua @@ -51,7 +51,7 @@ local keycodes = include("lib/keycodes") local library = include("lib/library") local transpose_table = include("lib/transpose") -local OPS_LIST = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "$", "?", "/", "\\", "|", "-", ":", "%", "!", "&", "^", "~", "]", "}", "`", ">", "<", "(", "=", "*", "#"} +local OPS_LIST = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "$", "?", "/", "\\", "|", "-", ":", "%", "!", "&", "^", "~", "]", "}", "`", ">", "<", "(", ")", "=", "*", "#"} local VAL_LIST = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"} local update_id From be2494368382f595f6a9b4419f206d10777eb315 Mon Sep 17 00:00:00 2001 From: Yancy Way Date: Mon, 10 Oct 2022 15:13:12 -0700 Subject: [PATCH 3/6] Update README.md Add er301 operator info to README --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 494940e..285c5c9 100755 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ Please refer to original [docs](https://github.com/hundredrabbits/Orca#operators - `]` [**crow ii jf note**(*channel* octave note level)](#-crow-jf-ii-note): Just Friends over i2c in voice mode. - `}` [**crow ii jf voice**(octave note level)](#-crow-jf-ii-voice): Just Friends over i2c in note mode. - `` ` `` [**crow w/syn**(octave note level)](#-crow-wsyn): +- `(` [**crow ii er301**(*channel* octave note)](#-crow-er301): er301 over i2c - `>` [**g.write**(*x* *y* value)](#-gwrite): Sets Grid LED on bang. - `<` [**g.read**(*x* *y*)](#-gread): Reads specific coordinates. If value > 6 outputs bang. - `(` [**a.read**(*enc*)](#-aread): Reads Arc encoder value @@ -137,7 +138,7 @@ Please refer to original [docs](https://github.com/hundredrabbits/Orca#operators | Controller | Description | Values | | ------------ | ----------------- | --------- | -| `K1 + E1` | Select operator | `A`–`Z`, `$`, `?`, `/`, `\`, `|`, `-`, `:`, `%`, `!`, `&`, `^`, `~`, `]`, `}`, `` ` ``, `>`, `<`, `=`, `*`, `#` | +| `K1 + E1` | Select operator | `A`–`Z`, `$`, `?`, `/`, `\`, `|`, `-`, `:`, `%`, `!`, `&`, `^`, `~`, `]`, `}`, `)`, `` ` ``, `>`, `<`, `=`, `*`, `#` | | `K1 + E2` | Select value | `0`–`z` | | `K1 + E3` | Select note | `A`–`G` | | `K2` | Clear character | | @@ -517,6 +518,11 @@ The **CROW JF II VOICE** operator `]` takes up to 3 parameters (*`octave`* `note The **CROW JF W/SYN** operator `` ` `` takes up to 3 parameters (*`octave`* `note` `level`). +### `)` CROW ER301 + +The **CROW ER301** operator `)` takes up to 3 parameters (*`channel`* `octave` `note`). + + ### `>` G.WRITE The **G.WRITE** operator `>` takes up to 3 inputs (*`x`* *`y`* `value`) and activates Grid LED at given `x`, `y` coordinate. From 0e7e62141efe7558a7af005a7884827405597bb8 Mon Sep 17 00:00:00 2001 From: echophon Date: Mon, 10 Oct 2022 15:48:15 -0700 Subject: [PATCH 4/6] expanded channel range --- lib/library/_crow_er301.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/library/_crow_er301.lua b/lib/library/_crow_er301.lua index 2dcf3ea..b438d87 100644 --- a/lib/library/_crow_er301.lua +++ b/lib/library/_crow_er301.lua @@ -70,7 +70,7 @@ local crow_er301 = function(self, x, y) ["9"] = 16, } - local channel = util.clamp(self:listen(self.x + 1, self.y) or 0, 0, 5) + 1 + local channel = util.clamp(self:listen(self.x + 1, self.y) or 0, 0, 35) + 1 local octave = (util.clamp(self:listen(self.x + 2, self.y) or 3, 0, 6) * 12) - 36 local note = "C" @@ -80,11 +80,9 @@ local crow_er301 = function(self, x, y) note = self:glyph_at(self.x + 3, self.y) end - local level = util.clamp(self:listen(self.x + 4, self.y) or 3, 0, 5) local tot_note = transpose_tab[note] + octave if self:neighbor(self.x, self.y, "*") then - -- crow.ii.jf.play_voice(channel, tot_note / 12, level / 1) crow.ii.er301.cv(channel, tot_note /12) crow.ii.er301.tr_pulse(channel) end From e4919ce3f285b036b383064001808c7244478258 Mon Sep 17 00:00:00 2001 From: echophon Date: Sat, 15 Oct 2022 20:25:56 -0700 Subject: [PATCH 5/6] i operator fix to align with desktop --- lib/library/i.lua | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/library/i.lua b/lib/library/i.lua index cd8c3e8..0e685c1 100755 --- a/lib/library/i.lua +++ b/lib/library/i.lua @@ -5,17 +5,12 @@ local I = function(self, x, y) self.ports = { {-1, 0 , "in-step" }, {1, 0, "in-mod" }, {0, 1, "i-out"} } self:spawn(self.ports) - local a = self:listen(self.x - 1, self.y) or 1 - local b = self:listen(self.x + 1, self.y) or 9 - local l = self:glyph_at(self.x + 1, self.y) + local step = self:listen(self.x - 1, self.y) or 1 + local mod = self:listen(self.x + 1, self.y) or 36 + local val = self:listen(self.x, self.y + 1) or 0 + val = ((val + step) % mod) - b = b ~= a and b or a + 1 if b < a then a, b = b, a end - val = (math.floor(a * self.frame) % b) + 1 - - local cap = l ~= "." and l == self.up(l) and true - local value = cap and self.up(self.chars[val]) or self.chars[val] - - self:write(0, 1, value) + self:write(0, 1, self.chars[val]) end -return I \ No newline at end of file +return I From e76c09e3f520c367fb1fbbf3b433262b73efbe2f Mon Sep 17 00:00:00 2001 From: Yancy Way Date: Tue, 21 Mar 2023 19:15:03 -0700 Subject: [PATCH 6/6] Update README.md typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 285c5c9..8fd30db 100755 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ Please refer to original [docs](https://github.com/hundredrabbits/Orca#operators - `]` [**crow ii jf note**(*channel* octave note level)](#-crow-jf-ii-note): Just Friends over i2c in voice mode. - `}` [**crow ii jf voice**(octave note level)](#-crow-jf-ii-voice): Just Friends over i2c in note mode. - `` ` `` [**crow w/syn**(octave note level)](#-crow-wsyn): -- `(` [**crow ii er301**(*channel* octave note)](#-crow-er301): er301 over i2c +- `)` [**crow ii er301**(*channel* octave note)](#-crow-er301): er301 over i2c - `>` [**g.write**(*x* *y* value)](#-gwrite): Sets Grid LED on bang. - `<` [**g.read**(*x* *y*)](#-gread): Reads specific coordinates. If value > 6 outputs bang. - `(` [**a.read**(*enc*)](#-aread): Reads Arc encoder value