Writing your own firmware?

I’ve been taking time off from my Yaeltex to rewrite one of my sequencers as firmware for the Launchpad Pro. the memory is limited, but otherwise it’s nice having the code right there instead of having to boot up a Raspberry Pi. So now I’m thinking about what I could do on my Yaeltex.

First, I know some people were planning on writing their own firmware. How’s it going?

Second, how much memory is available? For Hachi, I want to be able to save sequences and settings, and they’re not small (though I can do better than I’m doing in Java on the Pi!)

3 Likes

Welcome back @mike!

You can check the amount of memory available if you open a serial monitor and send the letters “t” and after that an “f” to the controller.
You should see the response on the monitor interface.

In Hachi you should have 11k of RAM approximately if you are using just one bank. Each bank will take almost 2k of RAM if ALL your buttons and encoders send different messages.

People writting firmware for their controllers have not shown up for a bit, but maybe @gc3 and @scanner_darkly can update us on their progress :slight_smile:

3 Likes

Hello all! I’ve been around, just lurking :slight_smile:

My project has been sloooow due to work and life (not at all due to the controller, which is amazing and working very well). I’m actually focused on something a little different–using the Yaeltex as a front end to a sequencer running on a computer, which handles MIDI and CV out and syncs its internal state with the controller’s display–but I am about to start firmware-hacking in a new display mode and I’ll report back on how that goes!

5 Likes

Thanks! 11k is luxurious compared to the 1k in the Launchpad! Some quick math says I could run a couple instances of my beats sequencer and a couple of my mono sequencer and save a decent number of patterns. we’ll see once I finish up the current project…

2 Likes

No kidding about work and life… and for me, working at home 24/7 in my studio room makes it hard for me to stay in there and work on fun studio things.

It sounds like you and I might be criss-crossing! it would be good to compare notes. is your code on GitHub or anything? My Java code for Hachi controller is here, and I’ll share my firmware code once it’s at a good stopping point. I’m hoping I’d be able to reuse some of it.

2 Likes

I also started to work on a sequencer, for now just as a PoC, but it may help you guys to see how I managed to read buttons and encoders and update LEDs. The sequencer.ino file handles this, I made some changes to some other files but for specific needs.

If you have any questions, don’t hesitate to reach out :slight_smile:

2 Likes

I look forward to trying to read and understand what you’re doing

With the Launchpad, I’m not really rewriting the firmware – Novation provides an API with functions you can call to light up the pads and you implement event handlers for presses, midi, timer. I’d probably try to match that basic abstraction and then build the sequencer logic into it.

1 Like

Here are the basics:

The UpdateSequencer() function runs in the loop.

The CheckUserInput() function reads the state of the buttons and the encoders and updates whatever parameter they are assigned to.

For example:

bool masterModeButtonState = digitalHw.GetDigitalState(MASTER_SLAVE_BUTTON);

the call to GetDigitalState returns the actual hardware state of each button and the parameter is the digital hardware ID, from 0 to the number of digitals your controller has.

A bit later:
seqSettings[currentSequencer].steps[step].currentNote = encoderHw.GetEncoderValue(NOTE_ENCODER);

Which is the same thing but for encoders.

You have a similar function as the GetDigitalState() for the encoder switches which is GetEncoderSwitchState(encoderIndex)

And also you have GetDigitalValue(digitalIndex) and GetEncoderSwitchValue(encoderIndex) which instead of giving you the physical state, will return the state of the input, which may differ to the physical state in the case of toggle configured switches or buttons.

To set feedback for the buttons you can use the following function:

feedbackHw.SetChangeDigitalFeedback(MASTER_SLAVE_BUTTON, MASTER_MODE_COLOR, true, NO_SHIFTER, NO_BANK_UPDATE);

  • 1st parameter is the button ID
  • 2nd parameter is the value for the feedback, for example the color table index in case of buttons that have their feedback set to Value to Color
  • 3rd parameter is true for turning it ON and false for turning the LED off (might be some redundancy there, but for now it works like this)
  • 4th and 5th parameters you’ll want to use NO_SHIFTER and NO_BANK_UPDATE most of the time.

The comms.ino file contains the handlers for the Clock, Start, Stop, etc messages which might come handy if you want to set your sequencer as slave.

1 Like

i’ve been lurking as well, been really busy interviewing for a new job and getting ready for it, didn’t have much time for anything else!

it also doesn’t help that the next thing i need to do is see how much latency i get if i update all LEDs on timer (as opposed to updating only the ones that changed) - this would simplify things for me as i could port some apps i did for monome grid without having to modify too much. hopefully will get to this soon!

here the quick game of life proof of concept i did so far: https://gitlab.com/scanner-darkly/ytx-controller/-/commit/41afe2dbd7ba9baebdde513a9426186cd6790fbb

1 Like