Giter Club home page Giter Club logo

beats's Introduction

Beats Drum Machine

Beats is a command-line drum machine written in pure Ruby. Feed it a song notated in YAML, and it will produce a precision-milled *.wav file of impeccable timing and feel. Here's an example song:

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

And here's what it sounds like after getting the Beats treatment. What a glorious groove!

For more, check out beatsdrummachine.com

Installation

To install the latest stable version (2.1.2) from rubygems.org, run the following from the command line:

gem install beats

Note: if you're installing using the default version of Ruby that comes with macOS, you might get a file permission error. If that happens, use sudo gem install beats instead. If you're using a version manager such as rbenv, chruby, or RVM, plain gem install beats should work fine.

Once installed, you can then run Beats from the command-line using the beats command.

Beats is not very useful unless you have some sounds to use with it. You can download some example sounds from https://beatsdrummachine.com.

Usage

Beats runs from the command-line. Run beats -h to see the available options. For more detailed instructions, visit https://beatsdrummachine.com/usage/.

Check out this tutorial at beatsdrummachine.com to see an example of how to create a beat from scratch.

What's New in v2.1.2

The latest version of Beats is 2.1.2, released on December 18, 2019. It contains these changes:

  • Several confusing/unhelpful errors shown due to an error in an input file have been improved. For example, if a pattern has the invalid name "4", the error message will now be Pattern name '4' is not valid. It must be a value that will be parsed from YAML as a String., instead of undefined method 'downcase' for 4:Integer.

For info about previous releases, visit https://github.com/jstrait/beats/releases.

Local Development

First, install the required dependencies:

bundle install

To run Beats locally, use bundle exec and run bin/beats, to avoid using any installed gem executable. For example:

bundle exec bin/beats -v

To run the tests:

bundle exec rake test

Found a Bug? Have a Suggestion? Want to Contribute?

Contact me (Joel Strait) by opening a GitHub issue.

License

Beats Drum Machine is released under the MIT license.

beats's People

Contributors

drmaciver avatar jstrait avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beats's Issues

Slows down audio

Hi, first off all, great Gem ๐Ÿ‘

I'm having an issue with the beats output audio. It's seems that the audio from the kit is slowed down. Do you have a clue what could cause the issue?

Request: Support for piped YAML

I'd really like if I could pipe a YAML string to the beats executable, and have it treat that YAML as the INPUT_YAML_FILE if none is specified.

For example, in addition to being able to do this:

beats --path="./" tmp/word.beats.txt

It'd be great to be able to do something like this:

cat tmp/word.beats.txt | beats --path="./"

wavefile not listed as a dependency

You need to add wavefile as a dependency to the gemspec so that it is installed by adding:

s.add_dependency 'wavefile', '~> 0.3.0'

Excellent work on the library by the way!

not one

Hello how add wav not exactly one by one
for example I need put one in this same time this same after 1seconds

2 wave files playing in this same time but in different starting point

Triplets/non-straight-16th-note rhythms?

Are there any plans to support rhythms that don't fit nicely into 16th-note patterns?

Right now I see that the audio engine is calculating the length of a sample by calculating the length of a 16th-note for the current tempo.

My thought was that (and I am willing to work on this & provide a patch) it could instead calculate the length for a quarter note, and then calculate the length of each sample depending on how the quarter note has been subdivided.

For example, we could accept syntax like this:

x...x...(xxx)x.x.

Which would correspond to:

16 rest rest rest 16th rest rest rest 1/4-triplet 1/4-triplet 1/4-triplet 16th rest 16th rest

If a quarter note section is wrapped in (), we calculate the length of each sample based on how many notes are within the parens.

From here, we could further subdivide the 1/4-note by nesting parens. Each nested paren would represent half of it's enclosing rhythm. So:

((xxx)(xxx))

would indicate 1/8-note triplets.

Just some ideas I've been kicking around.

Use binary mode for files (compatibility with Windows)

Howdy!

Nice library! I found one minor problem, files read and generated end with noise :-P

The reason of that is the direct usage of File.read and also File.open which doesn't respect binary content on Windows (either MRI or JRuby).

The fix for this is simple.

Replace File.read(filename) with File.open(filename, "rb") { |f| f.read }

Replace File.open(filename, "w") with File.open(filename, "wb")

Found 3 occurrences of that, so it doesn't worth the pull request ;-)

After that, beats start to beat music instead of noise!

Cheers and great work!

CachingWriterTest is Writing 'does_not_matter' File to Disk

The tests use StringIO so that the wave file is written in memory, instead of being saved to disk. It does this by swapping out the normal File object used by WaveFile::Writer with a StringIO instance.

However, the Writer constructor writes the wave file header to disk. Since replacing File with StringIO happens after the constructor is called, an unnecessary does_not_matter file gets written to disk, polluting the repo's home folder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.