[cheat codes 2] (rev 220524: LTS6.2)

Oh yes you’re right it’s probably easier to trim and edit inside a DAW, but what I had in my mind was to tweak the length of the clip on the fly and auto-chop to get into granular/glitchy territory :slight_smile: Love these ideas you mentioned, it would be grand!
Thank you so much for your energy and care!


I am trying to launch cheat codes 2 with my new Launchpad Mini MK3. I immediately get an error message:

/home/we/dust/code/midigrid/lib/vgrid.lua:147: attempt to index a nil value (field '?')
stack traceback:
	/home/we/dust/code/midigrid/lib/vgrid.lua:147: in method '_set'
	/home/we/dust/code/midigrid/lib/vgrid.lua:173: in method '_relative_set'
	/home/we/dust/code/midigrid/lib/vgrid.lua:98: in function </home/we/dust/code/midigrid/lib/vgrid.lua:95>
	(...tail calls...)
	/home/we/dust/code/cheat_codes_2/cheat_codes_2.lua:4319: in global 'grid_redraw'
	/home/we/dust/code/cheat_codes_2/cheat_codes_2.lua:1364: in global 'draw_grid'
	/home/we/dust/code/cheat_codes_2/cheat_codes_2.lua:1918: in field 'event'
	/home/we/norns/lua/core/metro.lua:164: in function </home/we/norns/lua/core/metro.lua:160>

I’ve reinstalled midigrid and CC2 with the same result. I am seeking advice to troubleshoot this. Thanks.

EDIT: I am running the latest norns firmware.

hi kevin! hope all’s well otherwise :slight_smile:

i’m curious if you run into trouble loading the script without the launchpad plugged in? if you can load the script on its own, then please try heading to parameters > GRID and toggle midigrid? to yes and restart the script. that should get you into a good zone.

lemme know how it goes!

(@JaggedNZ , I’m having a hard time finding it, but I feel like you tagged me in a note somewhere about not needing the midigrid toggle with the latest midigrid lib?)

D’oh! Thank you for your assistance.

1 Like

rev 210706: long term support (phase 1)

requires norns update 210706+

as I’ve been preparing the next and final major revision of cheat codes, I wanted to trickle back a few changes and fixes which will help keep cheat codes 2 stable + performant :slight_smile:

new (overdue) stuff

more crow destinations for PARAMS > pad to note setup, under each bank

  • crow v/8 output: choose an output to send MIDI-note-to-v/8 signals from a bank’s pads
  • crow pulse output: choose an output to send MIDI-note-on-to-pulse signals from a bank’s pads
  • Just Friends pulse ch.: choose a channel on an i2c-connected Just Friends to send MIDI-note-on-to-pulse signals from a bank’s pads (best in transient mode, since cc2 has no real concept of a “release” event)

(many thanks to @vicimity for proving the value of addressing crow outs with v/8 as part of a lovely performance he gave earlier this year)

external input on delay page

  • 128: the keys above + diagonal to the 4x4 pad (2,9 + 7,9)
  • 64: keys 2,4 + 7,4 (the first three above it toggle on each bank, icymi)

external note toggle

  • in pad focus mode, the key to the right of the last pad indicates whether the selected pad will send note data to the external sources specified for the bank
  • ALT (global or local) + toggling this key will set state for all pads in bank

home screen metronome

metronome graphic on main screen indicates whether transport is running or not, to help avoid confusion

fixed stuff

  • rec mode: beats now performs as it ought to! this was the longest-standing cc2 bug, so i’m really glad to have it addressed :slight_smile: but please lmk if any wonk returns!
  • crow v3 syntax (ty @Galapagoose!!)

FANTASTIC! Thank you!

1 Like

so good Dan. Thanks for this

I meant to request something like this!! this will be amazing for fine tuning random sequences and for clock modulation (in my set up).


really silly question:
is it possible to delete all functions that encoders and buttons do?
i would like to use cheat codes + eyesy on my fates on a live show, but eyesy controls are hardcoded to fates hardware. so as i move encoders or press buttons on my fates both eyesy and cheat codes 2 respond, which is kinda funny but not reliable for a live show.

Getting back into this after a bit of a break and still feels cool and inspring!

A little question: Did you consider adding velocity input? I know this would not work with the grid, but for those using other types of controllers (e.g. launchpad) it would open up new possibilities being able to map velocity to things like the filter, or even just the level.

sure! comment out these lines:

(as an aside, this all gets majorly cleaned the heck up in the next version, woof. it’s wild what you can get done in norns with brute force, but it’s so nice to have clean code :sweat_smile: )

yes! the final version of cheat codes will feature velocity control over macros, which feels like it’d be the best place for it. i really love the pad-smoosh gesture of the Analog Rytm’s performance mapping :slight_smile:


thank you so much!!!

1 Like

Never had an Analog Rytm in my hands, but this sounds amazing!!!

1 Like

Just an observation but the revision number on the app home page on norns is still saying 210315. I thought it wasnt installing properly but then realised I have the metronome on the main screen. I dont have my grid with me to confirm the other additions but I assume the metronome graphic means Im on rev 210706.

1 Like

good catch, thank you! pushed a fix :slight_smile:
and yep, metro graphic = 210706!


it appears that the collection isn’t saving the setting for timing > rec: bars, every time I launch the script, it defaults back to loose. (extremely) minor issue.

i just realized it would be useful to me to add midi note octave control to the grid – how feasible would it be to add that to the rate up/down grid gesture?


ah, yeah, i fixed in the next version and forgot to trickle that one back – will get a fix out next week :slight_smile:

this is a good idea! i do want to avoid coupling the MIDI and sampling layers this heavily, though. i often put a melodic sample on one of the bank’s clips and simul-trigger a MIDI note to a drum machine with a snippet of the melodic sample – a lot of times i want to manipulate the rate of the sample playback without affecting my MIDI notes, because those need to stay fixed to trigger the correct channel on a connected drum machine.

but, all to say, the last UI hurdle for the next version of cheat codes is a grid interface for every screen menu, so this’ll be easy to add to that grid page :slight_smile:


excellent! I’m willing to hack something in myself for that too, because your use makes a ton of sense, if you could just point me in the direction of where that would live in the code

for sure:

  • here’s where the zilchmo gesture for rate mul/div lives
  • there’s a global table which holds MIDI notes for each pad: mc.midi_notes[bank].entries[pad]
  • the way that the zilchmo file is formatted, you can get a pad’s bank ID with pad.bank_id and a pad’s pad ID with pad.pad_id

so you should be able to do something like:

function zilchmos.rate_mul( pad, mul )
  pad.rate = pad.rate * mul
  local base_midi_note = mc.midi_notes[pad.bank_id].entries[pad.pad_id]
  if mul = 2 then
    mc.midi_notes[pad.bank_id].entries[pad.pad_id] = base_midi_note + 12 -- raise an octave
  elseif mul = 0.5 then
    mc.midi_notes[pad.bank_id].entries[pad.pad_id] = base_midi_note - 12 -- drop an octave
  -- NOTE: here we ensure speed doesn't surpass 4, but don't clamp, drop an octave
  if math.abs(pad.rate) > 4 then
    pad.rate = pad.rate / 2
    mc.midi_notes[pad.bank_id].entries[pad.pad_id] = base_midi_note - 12
  if math.abs(pad.rate) < 0.125 then
    pad.rate = pad.rate * 2
    mc.midi_notes[pad.bank_id].entries[pad.pad_id] = base_midi_note + 12

that ought to get you where you wanna be, but ymmv! you probably wanna add a bit of clamping so that MIDI notes don’t go outside of the 0-127 range, instead of co-opting the clamping logic for pad rate, but lmk if it’s fun :slight_smile:

1 Like


Hi Dan,

installed CC2 a couple of days ago and have been having lots of fun with it! Being able to live sample my guitar and manipulate it in creative ways all while being clocked to Ableton Link has been really creatively fulfilling for me. Thanks so much for the script, I think it will become an essential part of my live-looping setup for guitar.

However, when trying to use CC2 to lay down some basic loops I’ve unfortunately been encountering some difficulties. I’ve been able to recreate those roadblock on my Norns on different occasions:

  1. live recording in 1-shot mode does not quantize correctly: turn on metronome in Ableton Live and sync Norns to Ableton via Link; set live buffer to 1-shot synced to next bar with enc resolution of 1 bar; set length of live buffer 1 to 4 bars and record a 4-bar sequence; now set pad A1 to live buffer 1 and set start point to min and end point to max with the zilchmo row 4; loop pad A1 and trigger it on the downbeat with the help of the arp → the loop does not stay in time with the metronome in Ableton Live
  2. pad looping does not quantize correctly: turn on metronome in Ableton Live and sync Norns to Ableton via Link; record a sequence in live buffer 1; now set pad A1 to live buffer 1 and set pad-length to 1/16th with the zilchmo row 4; double loop length 4x to set pad A1 length to 1 bar; loop pad A1 and trigger it on the downbeat with the help of the arp → the loop does not stay in time with the metronome in Ableton Live
  3. A minor thing: when loading CC2 the global pitch offset sometimes load with a -24.0 st offset and sometimes with a -12.0 st offset; when changing it to a 0.0 st offset the subsequently recorded samples are then pitched up accordingly and need to be pitched down again with the zilchmo row 4

As a side note: the visual metronome stays in sync with Link and as fas as I can tell the arp/pattern/delay do as well - the problem must thus be with the live buffer and pad loop quantization. Are those known bugs or is my Norns acting out? If bugs, will they be fixed in the coming update and when will that approximately drop (would simply like to know when I’ll approximately be able to jam with friends with CC2)?

hi hi! hope all’s well + glad cc2 is vibing with your workflow!

issues 1 + 2 sound like the same issue of loop lengths being slightly off in specific workflows – i’ll investigate! i believe i spent a bit of time on this in the coming major version update, but then didn’t trickle those changes back, so i think i can bring this into cc2 pretty easily.

issue 3 sounds like a byproduct of changing the live recording duration to 16 or 32 seconds – in cc2, this lengthening is achieved with slowing the record head which necessitates dropping the pitch of the other playheads. the coming major version update avoids this completely by providing 32 seconds of sample time by default.

i’m actually spending some time this week traveling, specifically to finish up this major update, but release still requires videos + docs and stuff. sounds like that one will give you everything you’re looking for (more generally, there are SOS looping options + quantized pad presses which’ll clean up a lot of what you’re aiming for), but i’ll be sure to trickle back the fix for 1+2 sooner, like by next weekend?

edit: actually, i remembered the fix! just delete the + variable_fade_time part of these two lines and you should be good on issues 1+2