~hp/muslua

239db7998fc984a4b57eaf926fc5edd01bc37a78 — Hanspeter Portner 2 months ago b59cd71
Shift gatekeeper button mask one octave up
1 files changed, 13 insertions(+), 9 deletions(-)

M lua/gatekeeping.lua
M lua/gatekeeping.lua => lua/gatekeeping.lua +13 -9
@@ 5,10 5,9 @@ local tooling <const> = require('tooling')
local interfacing <const> = require('interfacing')

local lookup <const> = {
	11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -- o-2
	11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -- o-1
	16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -- o-2
	16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, -- o-1

	11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 16, 17, -- o+0
	21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 26, 27, -- o+1
	31, 31, 32, 32, 33, 34, 34, 35, 35, 36, 36, 37, -- o+2
	41, 41, 42, 42, 43, 44, 44, 45, 45, 46, 46, 47, -- o+3


@@ 17,7 16,8 @@ local lookup <const> = {
	71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 76, 77, -- o+6
	81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, -- o+7

	87, 87, 87, 87, 87, 87, 87, 87 -- o+8
	87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, -- o+8
	87, 87, 87, 87, 87, 87, 87, 87 -- o+9
}

local Gatekeeper <const> = interfacing.Page:new {


@@ 28,9 28,11 @@ local Gatekeeper <const> = interfacing.Page:new {
			for j = 1, 7 do
				local num <const> = i*10 + j

				self[num] = interfacing.Toggle:new {
					page = self
				}
				if num >= 16 then
					self[num] = interfacing.Toggle:new {
						page = self
					}
				end
			end
		end



@@ 45,7 47,7 @@ local Gatekeeper <const> = interfacing.Page:new {
					for j = 1, 7 do
						local num <const> = i*10 + j

						if self.page[num].active then
						if num >= 16 and self.page[num].active then
							active = false
							break
						end


@@ 54,7 56,9 @@ local Gatekeeper <const> = interfacing.Page:new {
					for j = 1, 7 do
						local num <const> = i*10 + j

						self.page[num].active = active
						if num >= 16 then
							self.page[num].active = active
						end
					end

					self.page:refresh(time)