Drum Machine

Inspired by the new ‘scales and chords’ plugin, i got to thinking, what about an Obsidian Drum Machine? It looks like something close exists already. https://beatsdrummachine.com/

beats is a command-line drum machine. Feed it a song notated in YAML, and it will produce a precision-milled *.wav file of impeccable timing and feel.

Here is an example song in YAML:

Song:
  Tempo: 105
  Flow:
    - Verse:  x4
    - Chorus: x4
  Kit:
    - bass:     house_2_1.wav
    - snare:    roland_tr_909_2.wav
    - hihat:    house_2_5.wav
    - cowbell:  big_beat_5.wav
    - deep:     house_2_2.wav


Verse:
  - bass:     X..X...X..X.....
  - snare:    ....X.......X...
  - hihat:    ..X...X...X...X.

Chorus:
  - bass:     X..X...X..X.....
  - snare:    ....X.......X...
  - hihat:    XXXXXXXXXXXXX...
  - cowbell:  ....XX.X..X.X...
  - deep:     .............X..

I’ve never made a plugin before. How tough would it be to flip this into something that obsidian can run?

6 Likes

Hah, I love it. I wrote the new scales and chords plugin, and I came to the forum to post an announcement about it. Got distracted first by this post and discovered that you’d seen it already!

I’m no plugin expert, but you’ll have an easier time creating this plugin if you incorporate a npm module that does something similar rather than using something written in Ruby. (drum machine - npm search)

That said, if the beats program you’ve referenced already does what you want, you can use the Snippets plugin to run beats on a custom fenced code block. No plugin required!

2 Likes

Thanks so much for this plug-in. How cool! Obsidian already rocked, but you just rocked it further.

I did a little looking into this.

If you wanted to implement this in Obsidian natively rather than relying on a command line program, I found this library that would probably be a huge help: https://tonejs.github.io
(woah this library does some cool stuff. Just take a look at some of the demos)

One of their examples shows how you can sequence notes (just replace notes with samples that are loaded from the files) Step Sequencer

1 Like

damn this is dope. thanks for sharing it.

the obisidan drum machine anthem :grinning: Glass Domain - Interlock (1991 detroit) - YouTube