Giter VIP home page Giter VIP logo

piano_algorithm's Introduction

Disclaimer

This program in itself will likely never produce a full melody which is perfect on its
own, the purpose of this program is to give people an idea which they can use to make
into a song.

Overview

This Program uses MidiSynth to produce piano notes.

This is an algorithm to pick a random scale and from this it chooses random notes 
to be played either in the melody portion or in the chord portion.

For the playNote and playChord methods, the first C note on the Midi Piano is at index 24 and from there on 
I have set a multiplier so that it picks a note and from the multiplier assigns the key used.

You can run the program from the Driver class.

From My Knowledge of Music thus far, for a song to sound appealing it must follow these rules:

The notes should be within the same scale
In a chord there should be at least one space between each note
A chord must consist of at least 2 notes to be considered a chord
Chords are usually played by the left hand, so the chords are always in a lower octave to the melody
It should follow the timings set out in music, such as quavers, crotchets, minims and semibreves

Other Assumptions I have made

c# is the same as d-flat, so I have made all flat notes into the sharp of the previous note to align with my HashMap
The deep and high octaves are outliers and should not be used extensively
I use uppercase for notes within the current octave and lowercase for notes in the octave higher
    e.g. C-Scale = C, D, E, F, G, a, b, c 

Running PianoAlgorithms Through Command Prompt

To Open Command Prompt, Press the start button and search for cmd
navigate to where the project is located using **cd <folder_name>** , 
**dir** is used to check what folders are inside current directory.
Navigate to PianoAlgorithm\out\production\PianoAlgorithm
then run command **java Driver** to run the program.

Code-Related Notes

The playRandom boolean variable in the Driver class 
    -> Set to true to produce a random melody
    -> Set to false if you would like the view the last melody again (melody.json)

piano_algorithm's People

Contributors

darren-odonnell avatar

Stargazers

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