actually think that was a buggy bug report on my side, seems to be working now after i unplugged power and moved to a new location

Summary

1

matron

sc

8944.75077449 56

8959.5007116483 56

saved pattern 1 to slot 1

8974.25038022 56

8989.0002831583 56

new start

saved pattern 2 to slot 9

2 Likes

@dan_derks

I did my simplistic best to look through the code in “cheat_codes.lua” since the MFT is working I concentrated on the function midi_redraw I understand what’s going on (which btw says tons for your coding that a Lua newb can “get it” that quickly) but since I’m new to coding I don’t know how to trouble shoot the function to make sure the correct target is being passed etc.

I know you are so busy with other high level things so please don’t feel like you need to walk me through a trouble shooting tutorial. I’m only letting you know that I’m eager to help and I’m trying to learn Lua as fast as I can :smile:

I do have a quick question on your coding process. The reason I’m so slow at learning this is that it’s difficult for me to literally see how everything links up. That is, I process everything visually. Thus if I had to keep all of the function calls straight to know where to look in the code to track something down I’d need a mind map/flow chart like guide to see how it all connects.

So:

  1. Is there such a thing as a mind map/flow chart in programming?
  2. How do you keep it all straight?
2 Likes

hey hey! i’ll drop some legit reflections on your super thoughtful questions tomorrow AM, but wanted to confirm that i hadn’t considered that you were using grid + MFT – the midi_redraw just wasn’t being called when grid initiated a “cheat”, only when a midi keyboard initiated :slight_smile:

SO, you nailed it !! if you’re curious about the changes coming tomorrow (or want to get ahead of testing! :pray: ), here’s the fixed branch.

thank you for the kindness and positivity, paul. deeply appreciated :sparkles:

1 Like

it’s worth noting that this script is BONKERS compared to most apps on norns - because of the amount of options cheat codes has it may not be a good place to start wrapping your head around code. maybe it’s obvious but I’d recommend starting out with smaller bite size scripts as a way to wrap your head around things. if you’ve grokked the studies already, maybe check out a script like otis that more or less sticks to a single task in a concise interface

3 Likes

@andrew

That’s a great point indeed. I still have loads of syntax to figure out and you are right Otis would be a better place to start. That said I am so curious how one scales to an effort like Cheat Codes. If you have any insight, I’m all ears.

2 Likes

You could also go through and check out the scripts @dan_derks has made over time. Cranes is a great example. As is Less_Concepts.

There’s been a build up of singular concepts for scripts that have grown over time. All learning is exponential. Start small, experiment, be consistent in exploring and eventually instead of “how do I…?” You’ll say “what if I…?”

The monome stuff is DEEP and lots of folks are looking for fun ways to use the tools. I’m really excited to see how you explore this stuff!

1 Like

many early morning thoughts!

there totally is (@tyleretters is particularly adept at mapping these things out) and I probably would’ve saved a lot of time if I’d done something like that earlier in the process, but:

  1. I basically learned Lua as I went, which led to a lot of linear code. each time I wanted the script to do a thing, I added the lines until I’d amassed a Kerouac-style scroll of direct descriptors of what events I wanted to happen + how they should happen this time. this is because…
  2. cheat codes is an improvisation. this was at times literal (nearly all the v1 features were shaped by improvising with two superb and very patient musicians), but what I mean is that it has a roadmap only in retrospect.

as far as getting the idea out goes, the early process basically oscillated between drawing out what I wanted the grid interface to look like and writing lines of operations for each key. it was super painstaking and made for a ton of work later (more on this in a sec), but that’s because I didn’t know how to code efficiently – and while I was interested in learning how to, I was more interested in getting the idea out of my head and into an interface. this sort of (in retrospect) adhered to the principles of rapid prototyping but like, slower lol. all to say: it helped immensely to assume that getting it done would be better than getting it “right.”

this brute force approach got me to a releasable script. it did not get me to a script that would be easy to modify or extend. the improvisation metaphor continues – the jüj of the process is the feeling of discovery, but when you look back at it the logic is fuzzy. how did things get there? so beyond fixing up broken bits, it was really hard to conceptualize how I could add anything to the script in its sprawling, totally Id state.

that’s where @Galapagoose came in and saved the goddamn day. his direct contribution to the codebase was rewriting the zilchmo. his indirect contributions to the codebase are measured by the fact that there is a cheat codes 2. comparing his version of zilchmo to the previous version is probably the best way to chart the lessons I learned working with him, but maybe it’ll be good to outline some of the core mindset changes he gifted me.

  1. before we started, he gave me this assignment:

    • Collect a list of all the global variables (and understand where they are created & what they’re for)

    • Articulate all the data structures in a one location so it’s easier to see how the state of the program works.

    • Divide the program into ‘continuously updating’ parts (ie those with a constant clock), from the parts that respond to events (ie keys & encs, grid, osc?, midi?).

    I spent a few hours on this task and it sucked and was so so so super helpful. a small preview:

    basically, this exercise revealed how many times I was needlessly repeating the same actions with slightly different variables and how to immediately address how bloated the code had become.

  2. this allowed trent to demonstrate Lua’s strength as a functional programming language. you can easily compile the individual actions that make up an “event”, title them, and then call them up whenever you need them. that’s the difference between [this] and [this+this]. the same thing happens, but by wrapping up the events into functions you can spot issues or make changes to the behaviors much more easily. I also feel that there’s something fundamentally aligned between this approach and making music (composition or improvisation) – which makes it super rewarding for writing musical code.

  3. as I began to take on the refactor, I just ended up making a ton of hyper-specific little functions that all relied wayyyy too heavily on knowing the state of other variables far outside of their scope. ideally, functions shouldn’t need to know every detail about the other stuff happening in the script – the nouns, adjectives, verbs, etc. instead, they should be more like Mad Libs, where the structure is there to support whatever you throw into it.

    I’m still learning how to write code in this way, but it’s how I tried to approach all the new delay functions. for example, there are 4 different ways to change the rate of each delay, which I definitely would’ve spent 60 lines of deeply nested if/then code on in the past (“well, if it’s the left delay do this but what if I’m trying to double it but what if I don’t want to go past 24x but…”) – but by making this stuff a function that accepts clear arguments and routes the changes to the appropriate places, I can really easily change what happens when a “wobble” gesture occurs.

these mindset shifts not only helped me iterate/extend the old code with more agility, it helped me write the core of the new delay system in an afternoon.

anyway. that’s a lot of text, but I hope it helps fill in the picture a bit more – lmk if I can help with anything or answer any other q’s!

17 Likes

1 ghost bug report and 1 question on panning.

Ghostly delay bug. I was tooling around more with the delays this morning and after a while it seemed to be getting some serious left channel dominace action going on. I tried to make sure I was using symmetrical delay settings as well and nothing seemed to change the left channel drift. I selected another app and loaded it then went back into CC and it was working as expected again. Wish I had more info and I will certainly report back if I find anything else.

Question In regardes to panning. When I pan hard left or right via zzz I’m getting an inverse pan. Same thing happens when I nudge. It is also the case when I go into the Pan settings and manually pan via the encoder. Am I the only one getting this or is this intended behavior?

hey hey!

lmk what you can repro w/r/t that delay snag :slight_smile:

not seeing this on my side – just to confirm, hard panning is L: [x][-][-] and R: [-][-][x] on the third zilchmo row. [x][x][x] is random pan, [x][-][x] is inverse.

when you’re panning with the encoder, are you saying what looks left is actually coming out right? are you using headphones or line output? what does the LEVELS monitor in the norns system menu report?

OH, also, @CarlosUnch ftw! that might be it :slight_smile:

1 Like

If you have a Norns Shield from the first run, R and L are swapped on hardware. There’s a sw fix.

2 Likes

This maybe it! I’ll look for the update! Sweet

Yeah I do have a shield! So that is more than likely it for the panning issue! Yisss.

I’m on vacation until the 14 so I plan on putting some serious time into cc and arcologies until then. Ill repo what I can for sure if it happens again. Thanks for the quick response!

1 Like

shield fix instructions here (this happens with all scripts, no?): DIY: norns shield

1 Like

Thanks for the link! And to be honest I’m trying to think of any other app I have even fools with the panning lol. I’ll investigate

It does. I’ve been to lazy to fix it, may do it now :slight_smile:

2 Likes

oh my GLOB that was such an easy fix!

I am pretty much a hacker now right? :wink:

Unknown

3 Likes

Dan,

I grabbed my cup of coffee and hopped downstairs to my studio this morning in eager anticipation of your response. Wow, I am so humbled and happy to hear your words. The Kerouac line floored me for two reasons.

  1. Fond memories of a very pivotal time in my life. Many moons ago I had the honor/privilege to work around and document a few of his contemporaries (Ginsberg, Ferlinghetti and Anne Waldman who founded the Jack Kerouac School of Disembodied Poetics). Kerouac is one of my favorite authors who inspired me to change the course of my entire life!
  2. I had a very similar feeling of disembodiment trying to trace the function calls and organization (This is why I mentioned Waldman above).

The @tyleretters article is a superb example of what I was wondering (thanks for writing that Tyler).

Thank you for including this line it’s really vulnerable to admit and I so appreciate it. I’m trying to learn from what paths others have walked. There have been a couple of super helpful suggestions from @andrew and @kasselvania on where to start (thank you both)! I believe their sentiment to be that, swimming in the big beautiful ocean of Cheat Codes 2 is going to be overwhelming. And I couldn’t agree more. It’s why I started there. Being overwhelmed is exactly what gets me excited to learn something. That said, If you and this community weren’t so wonderfully helpful I would not have been so eager to dive in. I am very grateful to say the least.

Learning to code efficiently as possible from the start makes all the sense in the world to me. But how do you do that as a new coder? Well that’s where I bring back your reference to Kerouac (and my experience with his contemporaries). I learned all those years ago that getting together and discussing your process will help others avoid roadblocks and expand their creativity. To play off of your words, I’m trying to “get it done” while keeping an eye on what “right” looks like.

So, the before and after comparison of the Zilchmo code alone is a goldmine. I certainly don’t understand all of it but it is easy to see your journey and how others have helped you get there. I especially love the exercise @Galapagoose had you do. That is the mindset I’m hoping to instill from the beginning. I know it won’t work this way but at least it gives me a north star to aim for!

Again, MANY Thanks!

6 Likes

Yup that branch did it!

A heads up to anyone else trying this with the Midi Fighter Twister, The MFT can flash it’s indicator LED’s at different rates (super cool if you want to have a visual for a delay rate effect etc). But it does so by default on Midi Channel 3 (which is bank 3 for cheat codes). That means that when pressing a cell on the grid, the midi echo will send back a value to update the ring of LED’s around a knob AND it will also start flashing the colored indicator below the knob at a rate found in the MFT manual. This only occurs on ch3 and though I have not done it yet, you can change the rate behaviors receiving channel on the MFT with their utility.

Whoops - I misunderstood the MFT manual. You can only change the global channel you can NOT change which channel it receives its control of LED animations. That is fixed to channel 3! But you can change the bank midi channels in Cheat Codes (I used ch 9) to avoid the conflict.

1 Like

this is a bit of an obsession (/distraction) point for me & has kind of dominated my projects this year

if you like reading code wrms might be an interesting alternative to the style used in cheat codes. the entire script is hierarchically organized into a single table, with interface / screen drawing components (lib/wrms_ui.lua) split up from the sound & functionally relevant stuff (wrms.lua).

the cost/reward of all that is building a library flexible enough to interpret that organized structure, rather than maintaining lots of global variables & their relationships to each other (which point straight at the thing you need in the moment)

(OOP)

4 Likes

Ok wrms and OOP just blew the doors off my head. Taking deep breaths now. The deep end sure is DEEP!!!

Thank you for showing me this. I am a sponge and soaking all this in is my job right now. I didn’t realize that there are code “styles”. If I understand correctly wrms is an OOP style. Then what would you call the style of Cheat Codes? This is so helpful to btw!

1 Like