Running MIDIpal code on the Shruthi-1

This discussion was created from comments split from: Through-hole Midipal.

(the MIDIpal codebase was developed on the Shruthi-1 hardware).
Does this mean a Shruthi digital board can be turned into a midipal? If so what does it take? Is there a way to compile the midipal firmware to a midifile and upload it in a shruthi. I’m asking because i have a shruthi digital board+parts left over from a polivoks duo pcb wich i turned into a sidekick.

Yeah, this should be possible: you’ll need to tweak midipal/hardware_config.h to match Shruthi-1 digital board MCU pin assignments, rebuild midipal firmware, convert it to .syx using project tools and load it in. I’m assuming Shruthi-1 and MidiPal boot loaders are compatible.

You’ll have to change the MCU_NAME and SYSEX_FLAGS in the midipal makefile so they match the definitions from the Shruthi-1 makefile too. And spend some time rewiring stuff in hardware_config.h

OK… I’m trying to make an original shruthi sysex first… turns out i had to get … git … xcode … numpy… python… arduino(already had this one)… and learn a bit working with terminal…
I think i should be able to upload a non working version of the midipal code in a shruthi with just the makefile changes to see if i can do it… then see about the rewiring later…

@shiftr: is it really worth it? there are so many cool Shruthi-1 filters to build for your spare digital board :wink:

@kvitekp: I don’t know… Just idea that it’s possible makes me want to try it. I know there are lots of great filters out there. But i have 2 shurthi’s, 2 sidekicks an an Anushri now… I hope to get an Ambika too… maybe it’s enough then… (only the dual SVF keeps popping up on the want want want want list)
And i’ve been learning a great deal again tonight… last time i compiled something was under MS-DOS somewhere around '91…

At the moment i keep getting stuck at the ‘make’ stage… i get a list of this kind of errors :

./avrlib/op.h:538:11: error: ‘prog_uint8_t’ does not name a type

(i’m stil just trying a normal shruthi build)

> ./avrlib/op.h:538:11: error: ‘prog_uint8_t’ does not name a type

Could be arduino toolchain issue… I have no problems building Shruthi-1 and MidiPal using WinAVR-20100110 on both Windows and OS X, jsut set toolchain bin files location in avrlib/makefile.mk and it all works seamlessly.

Midipal compillation is ok with arduino, only Anushri have one fixable issue.
Check the windows path variable, it sould be c:\\arduino\\hardware\\tools\\avr\\ utils\\ bin (differs from makefile.mk path)

compiling worked with arduino libraries … MCU_NAME is easy to find and change in the midipal code … but the SYSEX_FLAGS are defined really easy in de midipal code but i can’t find the right settings for the shruthi. They seem to be all over.

Just leave an empty strings, it looks like the default settings of the hex2sysex utility are the right one for the Shruthi-1…

I can get it to load the the midipal code with this :SYSEX_FLAGS = --page_size=128 --device_id=2
I found the shruthi device id in the code and i guessed the page_size being 128 in stead of 64.
It just doesn’t finish the upload… like it is expecting more or some kind of end.

oh just saw your post before this one… will try that…
@pichenettes… maybe you can split this discussion in a new one with the title “Trying to run Midipal code on Shruthi”

Does the same thing. Starts loading and then just stays in the firmware loading mode with 4 leds burning.

(thanks for splitting)

Are you sure about your code changes? Maybe the firmware upgrade goes well but the unit crashes upon rebooting?

Should it reboot automatically at the end of the firmware loading? I don’t think it does this. It’s well possible that it just crashes when i really boot it. I’m pretty new to this so no i’m not shure.

:smiley: got it working!

It was probably booting but i had some mistakes in the hardware_config.h regarding the display.

BPM counter is running so input is working, and midi lfo is working so midi out is working too…
now see if i can build a midipal.mid that includes more apps than the usual midipal… :smiley:

The last bit of the .syx file is a SysEx command that causes the bootloader to jump into the main code. It’s not “rebooting”, just jumping to the main code as it would do if you had booted the unit without holding the button. On the Shruthi-1 and the MIDIpal, the LEDs are re-initialized in the main code. On the MIDIpal, the LEDs are hooked straight to the MCU ports. On the Shruthi-1, the LEDs are hooked to a shift register. There’s nothing in the MIDIpal code that talks to a shift register, so it’s reasonable to assume that untouched MIDIpal code booting on the Shruthi-1 will leave the LEDs in their previous state… So in your situation, there is no way to know whether the unit stays with 4 LED lit because it did not receive the “jump” command and is still waiting for more packets; or because the unit has received the “jump” command, and is booting into the MIDIpal code and does nothing from there touching the LEDs.

I think you’re at a stage where it’s much better to have an AVR programmer - especially if you have to do a lot of trial and error uploads to get the MIDIpal code to run right on your Shruthi…

Wow, that’s cool! Just make sure that you do not initialize as outputs pins that are hooked up to the 165 output.

There’s a lot of fun stuff to do with the 4 knobs, 6 switches and 8 LEDs…

There’s a lot of fun stuff to do with the 4 knobs, 6 switches and 8 LEDs…
indeed!
One killer idea may be to adapt the drum sequencer from the anushri and get it running with one knob to tempo, and the 3 other knobs for kick, snare and hihat…
Beside, you have more ram and more flash memory, so you can probably expand the midipal functionnalities… really a cool idea!
Congrats!