3 ms·
I don't have a writeup, unfortunately, but the "algorithm" I use is really simple and on Github: https://github.com/psobot/wub-machine/blob/master/remixers/dub
by psobot 11y ago
I don't have a writeup, unfortunately, but the "algorithm" I use is really simple and on Github:
https://github.com/psobot/wub-machine/blob/master/remixers/dubstep.py#L312-L377 https://github.com/psobot/wub-machine/blob/master/remixers/d...
The algorithm mixes a pre-generated template (in the key of the song) in with rearranged samples from each section of the song. If the song has 10 "sections" (verse, chorus, bridge, etc.) then the remix will have 10 sections too, and samples within each section will be rearranged and mixed with the template.
From the above link:
Compiles one "section" of dubstep - that is, one section (verse/chorus) of the original song,
but appropriately remixed as dubstep.
Chooses appropriate samples from the section of the original song in three keys (P1, m3, m7)
then plays them back in order in the generic "dubstep" pattern (all 8th notes):
| | :|
|: 1 1 1 1 1 1 1 1 | m3 m3 m3 m3 m7 m7 m7 m7 :| x2
| | :|
On the first iteration, the dubstep bar is mixed with a "splash" sound - high-passed percussion or whatnot.
On the second iteration, hats are mixed in on the offbeats and the wubs break on the last beat to let the
original song's samples shine through for a second, before dropping back down in the next section.
If samples are missing of one pitch, the searchSamples algorithm tries to find samples
a fifth from that pitch that will sound good. (If none exist, it keeps trying, in fifths up the scale.)
If the song is not 4/4, the resulting remix is sped up or slowed down by the appropriate amount.
(That can get really wonky, but sounds cool sometimes, and fixes a handful of edge cases.)