GithubHelp home page GithubHelp logo

drummachine's Introduction

drumMachine

Coding exercise for Splice interview

To run:

  • First, get the project using:

    git clone https://github.com/kdrombosky/drumMachine.git

  • From the drumMachine directory, run using:

    sh run.sh

To test:

  • From the drumMachine directory, run using:

    sh test.sh

Details:

I decided to implement this project using go, even though my it is not necessarily my strongest language. Thus, the amount of time taken on this project was a bit longer than it would have been using a language that I code in more regularly, like Java or Groovy.

The main program runs in main.go. First, it prints a text based menu for the user to choose options from. I incorporated 4 different playable patterns (one of which is from an old and tired joke :)).

I represented the patterns in a struct containing the necessary information to output the pattern metadata and play the easily via looping. More detailed information on this struct is documented in struct.go

I attempted to handle all unexpected input, throwing errors when necessary, but allowing the user another chance to enter appropriate input whenever possible.

I included tests for the validating the content of each preset pattern. These tests are trivial, but I wanted to include a decent amount of code coverage while practicing writing tests in go. I also think it is useful to maintain tests for expected content because a change to that content could have the potential to derail an entire system.

I also included tests for the validateTempo method, which has some of the greatest potential for error, considering the amount of parameter manipulation invloved.

This project was super fun! I am a classically trained musician, and thinking about how my music-brain would interpret sheet music had a large influence on how my coding-brain structured the beat patterns.

drummachine's People

Contributors

kdrombosky avatar

Watchers

 avatar

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.