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:

  Tempo: 105
    - Verse:  x4
    - Chorus: x4
    - 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

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

  - 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?


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!


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