HackTribe your E2S with a Colab Notebook

Follow-up to the post on the Hacktribe firmware project for the Electribe 2:

Colab Notebook as online step-by-step tutorial doing all the work – no need to install Python

Want to have a Hacktribe, but don’t want to install Python? You can use this Notebook – which you can run on a virtual Python environment provided by Google, called Colab. It creates a modified firmware file with Bangcorrupt’s scripts, as well as modified sample and pattern files from the existing samples and patterns on your Electribe Sampler.

Additional Python script to adapt sample bank AND pattern bank to the HackTribe firmware

There is also a new Python script the notebook uses, but which you can also run locally on your machine: It takes an e2sSample.all sample dump file, and a matching .e2sallpat pattern dump, and adapts them to the HackTribe by moving all samples to User sample space. The patterns are then modified to find the samples in their new locations.

You can find and download the script in my repository here.

Documentation

In writing the script, I had to document parts of the sample dump file. bangcorrupt did not want to have documentation as part of the main hacktribe repository to be on the safe side of hacking/reengineering regulations, so I created a separate documentation repository. It’s quite empty so far.

Link to electribe2 doc repository.

Free-for-all Filters And VPM – How The Hacktribe came to be

I really like my Electribe 2. I know, it gets a lot of hate from the EMX/ESX lovers, but the workflow really suits me, and, as you might know, I’ve got a heart for underdogs, especially when they are from Korg – don’t you think that even Korg’s blunders are more interesting than Roland’s successes?

A mutant Electribe

StableDiffusion 1.5 hallucinating the hell out of an Electribe with IMG2IMG and „Superman Drum Machine“ as prompt

Which doesn’t mean that Korg does everything right. As Electribe users know, you have to make up your mind: 

  • Do you want the (blue or grey) E2 synth („BlueTribe“), or
  • the (red or black) E2S sampler („RedTribe“)? 

The RedTribe sampler, gravitating a bit more towards hip-hop compared to the dancefloor-oriented BlueTribe, is generally more flexible – but you have to sacrifice the BlueTribe’s many additional filter types and synth oscillator models.

Which is a real shame considering that the hardware for BlueTribe and RedTribe is absolutely identical – apart from the colour scheme and the built-in samples. You can even crossgrade from BlueTribe to RedTribe and vice versa (involves a bit of hex editor manipulation and a sizeable risk of bricking the Electribe, but it’s doable – I did it once before settling on a black RedTribe for good).

So why doesn’t one just analyze the firmware, and copy&paste the BlueTribe goodness to the RedTribe ROM? It’s that kind of project you dream of for about 15 seconds until you realize how cumbersome this really is, and that it would be madness to commit yourself to that kind of ambitious hacking project.

Luckily, bangcorrupt has already done just that.

Behold: The Hacktribe!

In case you lived under a rock and haven’t heard of it: Hacker bangcorrupt has analyzed the Electribe’s bootloader, finding the requirements for installing modified firmware. And he modified Korg’s 2.02 Electribe Sampler firmware, adding the BlueTribe’s extra capabilities concerning filters and oscillators to it – and even more: VPM, Korg’s version of FM synthesis for people without a degree in acoustics.

It’s as simple as downloading the factory firmware, running a Python script that patches it, and updating your E2 to the Hacktribe firmware. If you want to keep running your existing RedTribe patterns, I created some small additional scripts for that – my tiny contribution to the project – and you will find soon find a step-by-step tutorial as a Python notebook that you can just click-and-run on Google Colab, saving you the intimidating Python installation business.

But for the moment, let’s geek out for a bit: I reached out to bangcorrupt, the hacker who did this, and asked him how he did the hack.

Hacktribing your RedTribe

We were communicating via mail – he answered my first set of questions – which were originally intended just to tell him what I wanted to know – in bulk. These are his answers; I’ve just added some links and notes in italics and square brackets where I felt like it. Everything else is bangcorrupt’s answers.

Q: How did you get the idea of doing it?

bangcorrupt: I got the idea from the firmware swap posted on korgforums years ago.
I wanted to create a hybrid based on the latest firmware version, with some added features and configuration options.

[With the first couple of firmware revisions, it was quite easy to swap the firmware of a RedTribe for a BlueTribe; with v2.02, Korg added checks to keep you from crossgrading, so you had to do a bit of hex editing and downgrading to do the swap. It was quite a feat and, honestly, not worth it, as you wouldn’t get the samples of the other machine – these seem to be stored in ROM, separate from the firmware. While it is quite easy to get someone with an E2S to perform an „Export All Samples“ for you, I have not seen the BlueTribe factory sample set in the wild yet.]

Q: Why didn’t you just stop when you realized how overwhelmingly complex the whole thing would become?

[Think about it.The Electribe is a complex machine – see this hardware breakdown in the Korg forums from 2015 which is one of the first things a prospective hacker might end up with. It hasn’t got just one microcontroller but three: The main processor is an ARM9 processor called AM1802 (datasheet), accompanied by a Blackfin 523 DSP from Analog Devices (datasheet) – a type of microprocessor optimized to process real-time data. There is also an additional feeble ARM Cortex M3 reading the front panel dials, which we may safely ignore if we’re lucky. Scanning the datasheets, you will find all sorts of scary words like „protecting code integrity“. There is obviously some kind of bootloader involved which you have to analyze to find out what it accepts as a firmware, and how it is loaded into memory. And once you mess things up, there is a considerable risk of bricking your Electribe for good – which did indeed happen, see below.]

bangcorrupt: Once I started seeing patterns and how they interrelate it was difficult to stop. I was really obsessed with it for a while; hopefully I can find the time to dedicate to taking it to the next level.

Q: Did you have a background in microcontroller development before?

bangcorrupt: I had a basic understanding of computer architecture and electronics, but most of what I know about microcontrollers and reverse engineering comes from working on Hacktribe.

[Which I, as a full-blown blunderer and tinkerer, find wonderfully serendipous and inspiring.]

Q: What were the challenges in doing it?

bangcorrupt: Everything. I’m learning how to do this as I go along, most of the tools and protocols are new to me. At one point I bricked my electribe and had to hack some other things to learn how to fix it.

Q: What kind of tools does one use for rewriting Electribe code?

bangcorrupt: A J-Link or a Raspberry Pi running OpenOCD will work as a JTAG debugger for the CPU.

[Let’s stop here for a moment and explain what a JTAG debugger actually is. Imagine you have some sort of program, and want to see what it does – especially if it doesn’t do what you want it to do. In that case, it would be handy to stop the code and look at registers and memory.

As long as the program is still running on your desktop computer, you can simulate and debug your program there, but once it has been transferred to the machine, you will have to use special hardware to do that.

When I did my first 8-bit development project some 30 to 40 years ago, we had to buy a murderously expensive type of hardware called a Z80 In-Circuit Emulator, a blue box that could act as a microcontroller in my machine but kept transmitting data on order to a PC. It has become much, much simpler these days, as all modern microcontrollers have a standard serial interface called JTAG. It takes orders and code, and transmits data if you want to talk to the processor, but you still have to have special hardware and software which does the talking.]

bangcorrupt: I couldn’t get the Raspberry Pi [running the OpenOCD JTAG debugger] working with the Blackfin DSP, but thanks to people sponsoring Hacktribe I was able to buy the official Analog Devices debug adapter.
Raspberry Pi will also work with the Cortex M3 on the panel board, but I want to try using Black Magic Probe [an open-source standalone JTAG debugger for ST Micro’s M3 hardware and others] on an STM32F103.
On the software side I’ve been using Ghidra for static analysis, with Rizin for patching and debugging.

[What is this for? The original programmers wrote high-level code in languages like C, and probably low-level Assembler code handling single processor instructions, before compiling and assembling their program code into the string of bytes in the SYSTEM.VSB file. Disassembler frameworks like Ghidra – by the NSA, for god’s sake! – and Rizin help you turn back these bytes into readable code, much like turning a meal back into a recipe – so you end up with code that your brain can process, and the JTAG debugger which helps you watch what it is actually doing. This gives you a good chance to understand what the code does, and how to expand it.]  

Q: How much of what your HackTribe code does was already in there, and what did you have to write from scratch?

bangcorrupt: This is hard to answer, it’s all interlinked. At the start I was hex editing the binary directly, changing pointers and conditional tests to run existing functions with new data. I’ve started reworking it into separate assembly code; the most new code I’ve written is probably for NRPN handling or FX editing. Even here I am using the existing functions as much as possible, just calling them in a different order with different arguments.

Q: And have you got a clue what the hell Korg thinks about all this?

bangcorrupt: I have nothing to do with Korg. I try to stay within the law and the license agreement, and as far as I know I have.

bangcorrupt’s answers are printed as they were given. All errors in the italics are mine.

Yay! Ich hab‘ einen DIY-Minimoog gekauft. (Und Jenny wird’s lieben!)

Ist das nicht WUNDERBAR? Gediegene Klassik: Ein Minimoog – weniger ein Bedienpanel, eher eine erogene Zone für Synthesizer-Freaks. Einmal an diesen Dingern drehen – komm, du willst es doch auch! Die reine Schönheit eines einmaligen elektronischen Instruments, das auch über 50 Jahre nach seiner Konzeption noch äußerst gefragt ist – und das ich nie, nie, nie selber haben wollte.

Ich wollte aber keinen Minimoog!

Jetzt mal ehrlich: Moogs sind überteuert und überschätzt. Nenn mir einen klassischen Moog-Leiterfilter-Sound, den man nicht auch mit einem Plugin oder fast jedem modernen Hardware-Synthesizer hinkriegt. Selbst mein oller R3 – Underdog-Synth Nr. 1 – kriegt gute Moog-Imitationen hin. Und wer zur „Digital-kann-halt-nicht-klingen-wie-wahre-Analogsounds“-Sekte gehört, kann immer noch auf technologischen Neoklassizismus setzen und moderne analoge Technik nutzen. Jetzt kauf dir halt einen Boog, verdammt! Und raus aus der Kellerwohnung.

Und trotzdem… der Minimoog hat was. Bei Synthesizern geht es um den Fluss – und um die einzigartige Kombination von Aussehen, Verhalten und Klang, die ein Instrument ausmachen. Als ich also ein Moog-Gehäuse mit Knöppen und Tastatur aus einem Eigenbau-Projekt um wenige Euro sah, das der Ursprungs-Bastler aufgegeben hat, konnte ich nicht widerstehen.

„It’s aliiiiive!“ – Wie man eine leere Hülle wiederbelebt

Weiterlesen

Wenn das Trackpad nicht mehr klickt: Macbook Air M1 (2020) reparieren

Plötzlich hat es nicht mehr geklickt: Das Trackpad im Macbook Air M1 (Apple Silicon, Ende 2020 gekauft) schien sich verklemmt zu haben, zumindest gab es keinen Klick, wenn man auf das Trackpad drückte – ich konnte nichts mehr anklicken; ohne externe Maus war der Laptop unbrauchbar. Das Problem ließ sich aber relativ schnell beseitigen.

Nur ein paar kurze Notizen, auch falls jemand gute Tipps sucht.

  • Schnelle Abhilfe: Den „Antippen“-Klick aktivieren. In die Einstellungen fürs Trackpad gehen und einen Haken bei „Klick durch Tippen“ setzen. Dann wird der Mac wenigstens wieder brauchbar.
  • Es ist womöglich kein Hardware-Problem. Der fühlbare Klick, den das Trackpad zurückgibt, wird nicht von einer Feder erzeugt, sondern von einer kleinen Reihe von Elektromagneten – die Technologie wird in diesem Beitrag auf pocket-lint.com gut erklärt. Was aber heißt: Wenn das Trackpad nicht mehr klickt, ist möglicherweise die Firmware schuld, oder das Betriebssystem hat sich vergaloppiert. Angeblich soll es helfen, in den Trackpad-Einstellungen alles mit „Haptisches Feedback“ einmal kurz zu deaktivieren, bei mir hat möglicherweise geholfen, dass ich den Akku abgeklemmt habe. (Oder auch nicht – was ich getan habe: dazu gleich mehr.)
  • Trackpad selber tauschen. Ein moderneres Apple-Gerät aufzuschrauben ist tendenziell eine dieser Warum-tue-ich-mir-das-an-und-überlasse-es-nicht-den-schnöseligen-Typen-von-der-Genius-Bar-Aktionen, aber so schwer ist es dann auch nicht. Mir hat eine Dreiviertelstunde Basteln vermutlich einen mittleren dreistelligen Betrag gespart – was ich ja schon kenne. Also: Nur Mut, es ist auch für Durchschnittsbastler:innen möglich – MIT! DEM! RICHTIGEN! WERKZEUG!
  • Werkzeuge für die Macbook-Air-Reparatur. Ohne die geht’s nicht. Ich habe ohnehin einen Satz Handyschrauben-Torx-Bits auf Lager und dazu bei Schweine-Amazon dieses Kit geordert (kein Affiliate-Link; kauft gern woanders.) Man braucht:
    • einen Pentalobe-P5-Schraubendreher (für die speziellen Apple-Gehäuseschrauben mit dem fünfzackigen Loch)
    • einen Torx-T4-Schraubendreher für die Trackpad-Kabel-Halterung
    • einen Torx-T5-Schraubendreher für das Trackpad selbst
    • eine Lupe
    • eine Pinzette
    • …wie üblich empfehle ich ein Schälchen oder eine Magnetmatte, um die verschiedenen Schraubentypen sicher und getrennt aufzubewahren, ordentliches Arbeitsplatz-Licht, eine Arbeitsplatz-Matte.
  • Schritt-für-Schritt-Anleitung. Die Anleitung von ifixit ist wie immer vorbildlich; von mir noch den Extra-Tipp, dass man wirklich die Beschreibung für jeden Schritt zu Ende liest, ehe man ihn ausführt (und vielleicht auch auf den nächsten schaut.) Sonst kann einem beispielsweise die Warnung entgehen, dass auf dem Trackpad Distanzscheiben liegen – die runterfallen, wenn man das demontierte Trackpad umdreht. Lesen spart eine Menge unwürdiges Herumrutschen auf den Knien.
  • Reparatur-Support von Apple. Ernsthaft. Ein bisschen. Die „Right-to-repair“-Gesetzgebung hat Apple in Bewegung gesetzt: Wer sein iGerät unbedingt selbst zerreparieren will, bekommt von Apple jetzt Informationen und Ersatzteile – es darf nur noch nicht zu alt sein, das iGerät. Und man sollte in den USA wohnen, hehe. Immerhin: Für den Macbook Air gibt es das Apple-Service-Manual als PDF zum Download. Auch ein Austausch-Trackpad bietet der US-Shop für knapp 100 Dollar an; ob ich es auch aus Europa hätte bestellen können, kann ich nicht sagen. Und am Ende reißt sich Apple wohl auch nicht gerade ein Bein aus, um Bastlern zu helfen. (heise.de). Am Ende hilft dann doch eher der Gang zum freundlichen türkischen iphone-Dealer.

Bliebe nur noch mal klar aufzulisten, was ich denn jetzt eigentlich getan habe, damit das Trackpad wieder klickt.

  • Werkzeug gekauft.
  • Den Mac geöffnet und das Akku-Kabel abgeklemmt. (Ich würde dringend raten, nach diesem Schritt den Akku kurz wieder anzuklemmen und zu testen, ob das Trackpad nicht schon wieder funktioniert.)
  • Das Trackpad ausgebaut und böse angeguckt. Ein wenig an den Federn gebogen.
  • Die Gehäuse-Aussparung für das Trackpad ausgewischt, um irgendwelche Krümel oder ähnliche mechanischen Störungen zu entfernen.
  • Das Trackpad mit den Distanzscheiben wieder eingebaut. Dabei die Distanzscheiben mit einer Schieblehre vermessen, nachdem ich im Service-Manual gesehen habe, dass es sie in verschiedenen Dicken gibt. Die 0,1mm starken oben, zur Tastatur hin, eingesetzt, die 0,15mm starken an der unteren Gehäusekante.
  • Alles wieder zusammengebaut und -geschraubt; der heikelste Teil war dabei der möglichst gewaltfreie Wiederanschluss des Akku-Steckers, aber auch das ZIF-Steckerchen für das Trackpad-Flachkabel links unten (kleiner Plastikbügel! Vor dem Entfernen hochklappen, nach dem Wiedereinsetzen wieder runterdrücken!) und der Platinenstecker fürs Trackpad neben dem Akku-Stecker sind nicht ohne.
  • Ans Netzteil angeschlossen, angeschaltet und… geht.

 

Das Lärmding

Hey! Ich hab‘ mal was gewonnen – einen Dreadbox Typhon (in einer Amazona-Verlosung). Hammermaschine! Großartiger Sound, und echt clever, wie man mit ein paar wirklich handschmeichlerischen Knöpfen die schönsten Soundveränderungen hinfrickelt… Wenn das Ding nicht nur so ein fieses Rauschen produzieren würde.

Dreadbox Typhon powered from USB hub; preset A1

Hier, einfach mal reinhören! Wundervoll – aber am Anfang, der böse Einschaltlärm, ist nicht zu überhören, und das kratzige hochfrequente Bratzeln auch nicht (auch wenn es interessanterweise in der Aufnahme nicht mehr zu hören ist, wenn der Sequenzer startet; es ist da, die ganze Zeit, glaubt mir. )

Ganz klar: Digitales Rauschen.

Weiterlesen

Stereoping Hardware Controller for Crumar Bit

Stephan (aka umusic6) did some nice work:

Thanks to his efforts, there is now a Bit Edition of Stereoping’s Synth Controller, for Crumar Bit-01/One/99 with the Tauntek firmware. You can read up on the firmware, or order it, here.

(No, this is not an affiliate link, I have no share in this. But I think it’s a great project.)

Waldorf-Blofeld-Mod-Konzept

Das hier ist bisher nur ein feuchter Traum: ein Blofeld, der viele, viele Knöpfchen hat und darüber in Echtzeit zu kontrollieren ist. Das Layout ist – ähem, inspiriert – durch den Hartmann 20, der ja wiederum eigentlich ein Sledge in einem teuren Anzug ist. (Und der Sledge wiederum ist eigentlich ein Blofeld mit reichlich Knöppen.)

Behold: the Frankenfeld!

Don’t go looking for a blofeld calibration routine to fix the pitchbend wheel.

Waldorf Blofeld Keyboard white, view on the pitchbend wheel

One day, my trusty Blofeld started drifting out of tune – pretty unusual behaviour for a digital synth. Even if it was in tune first, the drifting started as soon as I touched the pitchbend wheel, so I suspected that this was the culprit.

Blofeld wheelbox

Opening the Blofeld (all 18 screws on the bottom – remember?), removing the wheelbox, and measuring the pitchbend pot confirmed that the potentiometer was indeed damaged – while an end-to-end-measurement showed 9k, the end-to-mid-resistance could be virtually anywhere, screaming „Mechanical Damage!“ to me.

The potentiometer is 10k lin with a knurled 6.3mm shaft and an M10x0.75 mount. Waldorf seems to have used a Piher T-21Y type (datasheet). As I did not find something fitting in my parts boxes, I took it apart, cleaned it, adjusted the pickup spring, applied a bit of contact grease, refitted the pot and closed the Blofeld

And now for the good part…

Although I measured that the wheel now zeroed around the pot’s 5kOhm mark, it had most definitely shifted slightly, so I started looking for the calibration routine. There has to be a calibration routine, right?

But the good Blofeld seems to calibrate on power-up and on the first usage of the wheel – no calibration routine for the wheels needed. Phew!

Waldorf Blofeld Keyboard white, view on the pitchbend wheel

Important note: Be careful to ensure that the Molex connector for the wheelbox sits correctly – when I pulled the plug, the plastic holder for the pins got pulled towards the edge of the PCB so when I reattached the plug, it did not sit correctly. Rule of thumb: If the plastic of the connector is visible from the top, you might want to push it back under the PCB.

Midifying Jenny, Step 1: Replacing the old keyboard chip with a Teensy

This is the first post in a series of small projects for retrofitting my JEN SX-1000 monosynth with a simple and cheap MIDI interface controller. Read about the basic idea here. Today, I am designing and building the micro-controller brain of the Jenny retrofit – if you are capable of basic soldering, it should not take you more than two hours and a couple of very common electronic parts.

Weiterlesen