Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 | |
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions lib/library.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
91 changes: 91 additions & 0 deletions lib/library/_crow_er301.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
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, 35) + 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 tot_note = transpose_tab[note] + octave

if self:neighbor(self.x, self.y, "*") then
crow.ii.er301.cv(channel, tot_note /12)
crow.ii.er301.tr_pulse(channel)
end
end

return crow_er301
17 changes: 6 additions & 11 deletions lib/library/i.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
return I
2 changes: 1 addition & 1 deletion orca.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down