Giter Club home page Giter Club logo

rhythmbox's Introduction

RhythmBox

A Rhythm Box System for your iOS app ๐ŸŽต. The easiest way to create Music Rhythm Patterns in Swift.

BuddyBuild Version License Platform Language

What can I do with RhythmBox?

  • Generate a BPM or RPM Tempo
  • Select the Time Signature
  • Create a Rhythm pattern

Demo Project

To run the example project, clone the repo, and run pod install from the Example directory first.

Getting Started

Requirements

  • iOS 8.0+ / tvOS 9.0+
  • Xcode 8.0+
  • Swift 3.0+

Installation with CocoaPods

CocoaPods is a 3rd-party dependency manager for Swift and Objective-C projects. For more information, refer to the CocoaPods Getting Started Guide. Otherwise, you can install CocoaPods with the following command:

$ gem install cocoapods

Podfile

To integrate RhythmBox into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
pod 'RhythmBox'

Then, run the following command:

$ pod install

Installation Manually

To integrate RhythmBox into your Xcode project manually, just include the filest from /Pod/Classes/ folder in your Appโ€™s Xcode project.

Quick Guide

Usage

To Generate a constant BPM signal is as simple as this.

1. Import class
import RhythmBox
2. Create a RhythmBox class
let rhythmBox = RhythmBox(bpm: 120, timeSignature: (4,4))
3. Start the Rhythm
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    print("CurrentSubBeat", CurrentSubBeat)
    print("CurrentNote", CurrentNote)

    return .resume
}
4. Stop the Rhythm
rhythmBox.stop()

Examples

Example 1

Create a 120 BPM signal with a block.

let rhythmBox = RhythmBox(bpm: 120)
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}
Example 2

Create a 150 BPM signal with a time signature of 6/8 with default subdivision of

let rhythmBox = RhythmBox(bpm: 150, timeSignature: (6,8))
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}
Example 3

Create a 90 BPM signal with a time signature of 3/4 and subdivision of

let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "11")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}
Example 4

Create a 90 BPM signal with a time signature of 3/4 and subdivision of

let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "111")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}
Example 5

Create a 90 BPM signal with a time signature of 3/4 and subdivision of

let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "011")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}
Example 6

Create a 90 BPM signal with a time signature of 3/4 and subdivision of

let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "10111")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}

Roadmap

  • CocoaPods support
  • Carthage support
  • Swift Package Manager support
  • Tests

Change Log

See Changelog.md

Contribute

Contributions are welcomed and encouraged ๐Ÿ’œ.

Author

License

RhythmBox is available under the MIT license. See the LICENSE file for more info.

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.