Git Product home page Git Product logo

musickal's Introduction

Setup

Install dependencies:

brew install portaudio
pip install pyaudio

Notes

To install all the notes, it is easiest to include the whole library.

from Musickal import *

Here is a reference to the notes we allow for (arranged to match the 4th octave on the piano):

  Db   Eb        Gb   Ab   Bb
C    D    E    F    G    A    B

Note that half steps are annotated as flats instead of sharps. This is because # is reserved in python for comments, where b is simply a letter.

To specify an octave of a note, postfix it with the octave number:

...   Db3  Eb3       Gb3  Ab3  Bb3      Db4  Eb4       Gb4  Ab4  Bb4   ...
    C3   D3   E3   F3   G3   A3   B3  C4   D4   E4   F4   G4   A4   B4

Play the audio

Here is an example of how to play notes:

from Musickal import *

m = Musickal()

duration = .25

m.playSong([
  (B, duration),
  (A, duration), 
  (D, duration), 
  (C, duration), 
  (A, duration), 
  (F, duration), 
  (E, duration)
])

musickal's People

Contributors

kyle-west avatar

Watchers

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