x42 / midifilter.lv2

LV2 plugins to filter midi events
https://x42-plugins.com/x42/x42-midifilter
GNU General Public License v2.0
70 stars 20 forks source link

Feature request: randomly drop and reassign notes sometimes #31

Closed ratherlargerobot closed 2 years ago

ratherlargerobot commented 2 years ago

Hello!

I watched a brief BBC segment with Brian Eno, where he talked about how to humanize drum loops by introducing randomness into them. You can see a brief excerpt here (3 minutes): https://www.youtube.com/watch?v=QHIhDP8pTkE or the entire 30 minute segment here): https://www.youtube.com/watch?v=cv7epY75Wa0

He's using some sort of scripting environment that allows control over MIDI events. I know you also have midimap.lv2, so perhaps that might be a better place for this.

The essence of the approach he demonstrates in the video is to start with a basic quantized drum loop, and then selectively introduce randomness into the process. He does this by dropping certain notes (kick drum, snare drum, etc) a random percentage of the time. Then he goes on to also randomly, occasionally assign what would have been a hit on one drum to hit a different drum instead.

I find this approach interesting (not to mention all of Brian Eno's other work over the years). I tried to see how far I could get doing something like this using the tools available in midifilter.lv2. I kind of got something working with the existing tools, but it's cumbersome and plays potentially unnecessary games with the original MIDI velocity information to leverage the source of randomness found in the MIDI Velocity-Range Filter.

There may very well be simpler ways to do something like this. This is just the first thing that I tried that seemed to work.

Essentially, I put a simple drum loop on what I'll call the Input MIDI track in Ardour. Then I created three new MIDI tracks in Ardour for Kick Random, Snare Random, and Hat Random (I just did a simple proof of concept with Kick/Snare/Hat). On each of the three "Random" MIDI tracks, I ended up with the following sequence of midifilter.lv2 plug-ins, which did achieve a random dropping of drums, where the amount of times the notes were dropped could be adjusted:

Kick Random MIDI Channel Plug-In Stack:

  1. MIDI Key-Range Filter (to select just the kick drum channel)
  2. MIDI Velocity Randomization (velocity randomization all the way up to 127, to introduce randomness via velocity, even though I didn't actually want to randomize the velocity)
  3. MIDI Velocity-Range Filter (min volume 0, max volume adjust to taste, this is here to let most, but not all of the notes through)
  4. MIDI Velocity Adjust (note-on min: 127, note-on max: 127), give notes a fixed velocity to erase the damage caused in step 2)
  5. MIDI Velocity Randomization (re-introduce some level of velocity randomization, since the original values were lost)
  6. MIDI Velocity Adjust (nudge the now-randomized velocities into the desired range)

I was unable to figure out how to randomly map incoming notes to different notes a random percentage of the time, but didn't do an exhaustive search either. The MIDI Velocity-Range Filter seems to be the only source of available randomness (according to the plug-in descriptions) that isn't time based. Perhaps it could be pressed into service somehow.

So now for the feature request. I think it would be neat to have a more streamlined ability to introduce randomness into MIDI, in general. A midifilter.lv2 plug-in that could select on a range of notes, and then just drop them some percentage of the time would be really neat for this sort of thing. I can also imagine the same, or another plug-in that could select on a range of notes, and map them to a different range of notes, some random percentage of the time. There are probably other variations on randomness that are worth exploring too. Randomly dropping or adding some notes from chords some percentage of the time, that sort of thing.

I know that this is a little out there, so I understand if it's not a good fit for midifilter.lv2. I would also potentially be willing to take a stab at implementing some of this myself, if you think that the ideas are potentially worth including in this plug-in suite.

Thanks for writing so many great plug-ins! I really appreciate it. You have done so much to make music production feasible and even a joy on Linux!

ssj71 commented 2 years ago

I'm not sure if this is a very frequent use case. You may consider doing something using moony.lv2 and editing the script https://github.com/SpotlightKid/moony-lv2-scripts/blob/master/midi/note_filter.lua to achieve what you want. Something like: https://gist.github.com/ssj71/0e839f99e5163804ad005773827fc71b

ssj71 commented 2 years ago

ok, I finally got around to testing that script I wrote in the gist. It took some tweaks but it's working now and does what you request (if I understand correctly). Cheers!

ratherlargerobot commented 2 years ago

Wow, thanks @ssj71! Amazing!