, 30 tweets, 5 min read Read on Twitter
Gather around children, this'll be a thread as a crash course of how I transcode x86ASM into MIDI and finally into music. cc @richinseattle
So the idea came to me originally when i reverse engineering good ol Careto Malware. Specifically this section of code right here:
I will later describe this x86 type of code a Rhythmic point and you will soon see why. So a lil known fact, i hum to myself when i RE.
So when i was looking at this code, i happened to particularly hum out every MOV type instructions.
I thought: that has a pretty good beat to it, due to how mov is every other instruction and then had a pause and a double beat at the end
So i thought, i bet i could visualize this in a drum machine and make malware techno. Wouldn't that be weird.
So here is a visual diagram of Careto BootMgr assigned to even bars of MIDI per x86 instruction using a piano roll approach.
Any followers I have might instantly recognize this as a nearly perfect 4/4 techno beat. Thats right, Careto is pretty banging.
So now that we have transcoded some x86 into Midi data, the next step would be to assign these some sounds.
MOV def needs to be a kick drum, that pattern has dance beat all over it. The rest is kinda a mess, but we can just keep tinkering as we go
So following along in the above piano roll layout - here is Careto as a percussive beat for techno.
clyp.it/tvrufqbt
This is pretty much the easiest example you can use to demonstrate how x86 can be used to generate drum patterns.
The important part is finding appropriate sounds to go with each section of code you use. Literally every piece of code has its own style.
The next method i use was taking parameters of each code and using them as some kind of control method for MIDI note data or modulations
Using the same Careto BootMgr Code we can now use the Parameters passed to the code to freely modulate MIDI channel data.
Here is the same Careto bootmgr code + Params mapped to arbitrary FX channels to create a glitched beat: clyp.it/e4jx50ac
So originally I used to take mostly 16, 32 or 64 instructions to make a single beat from x86. Then I realized i could wrap them
So wrapping a beat allows you to make much more interesting beat patterns using nearly any amount of instructions.
This is the same Careto Bootmgr code + params 'wrapped' so that it repeats multiple times to make a more 'full' beat.
So changing the instruments assigned to the channels we can get a pretty glitchy based beat. clyp.it/p1sc053s
The next step is taking DB data or byte codes and assigning them note information, this is experimental at best.
So the actually most successful method to taking bytecode to make notes that i have found has been using the high byte value to Note method
Using the same Careto as an example: we get the notes B, E, C, E, C, C, D, B from the bytecodes (i accidentally didnt highlight the last B)
Back in our music sequencer - this will produce something along the lines of this:
Doubling the notes in the example gives it a better harmonic quality, finding an instrument to go along with this is always a challenge
And here is an example of what Careto BootMgr Code makes using ByteCode Melodics: clyp.it/czi0xh21
So this should be a pretty simple guide of how I do the fundamentals of x86 based music. Honestly the hard part is piecing it together
Now as you can imagine, taking dozens of components & piecing them together into a single song is very tedious.
The most important part to remember is every source of code has its own sound style or melody. Piecing them together in one song is hard AF
My last track uses approx6 sources - 24 code sections, 8 melodics, the rest are percussive: clyp.it/user/fnjxq523
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Greg Linares
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!