The purpose of this project is to create a simplified process of musical improvisation and composition, as well as musical education and related fields of entertainment.
Inspiration came from the expensiveness and uneasiness we felt for current musical tools.
Players of this program could experiment ideas by typing. Only the effective key which could be mapped to a certain instruction is kept in the sequence that converts to wave file of track. Tracks could be added to create multi-tracks result.
Potential users could be anyone, ex. kid/adult/student/educator/musician/gamer who would like to experiment with music.
For musicians, musical ideas could be written as text of sentences, which map to instructions of writing notes. Although current version only includes 3 samples for a track, it could be easily expanded. (ex. to all 12 semi-tones of an instrument) Please do not expect this project to replace other tools such as DAW, it's only for the purpose of simplified experiment.
Transform your keyboard into a music instrument, it could be a simplified simulation of any instrument if samples provided, or a imaginary instrument of map from key to sample, listen to your ideas just by typing text.
Each sentence comes with feedback of the instructions you created, try-and-error could be enjoyable process of refinement.
Substitute sample files and create your own library of instruments.
Start with 3 samples (key 's','d','f') per track, adjusting duration of note(key 'y','u','i','o','p' for 1,1/2,1/4,1/8,1/16 beat, key 'h','j','k' for 1/3,1/6,1/12 beat), rest with key '-', That's all! Other key doesn't make change to the instructions. For readabilty, for example, we could use space to make words of sentence clear.
User navigates by menu to the option interested.
Choose Tutorial anytime in the main menu for definition of key-mapping.
In the 'Improvise' session, type freely until Exit-Key ']' included. No key is wrong, only effective keys to be mapped to instructions are interpretted.
If you want to generate a track without entering the menu, append first argument 1|2|3 as the sample library to use, second argument as the tempo in bpm, third argument is the text to be interpreted to a wave file. For example, command below generate a drum track at 100 bpm.
ruby main.rb 1 100 s-ssd-ddf-ff
-
This version is designed for MacOS system, using afplay media-player to play wave files. Audio hardware should work to play sound.
-
Tested in Ruby 2.7.0, using gems wavefile, colorize, tty-font, tty-prompt and their dependency. To avoid confliction of MacOS's internal Ruby code, you need Homebrew and rbenv to setup updated Ruby enviroment.
- MacOS with terminal and afplay media player.
- Working audio hardware to play sound.
Run the commands below in terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew analytics off
brew update
brew tap caskroom/cask
Run the commands below in terminal:
brew install rbenv
rbenv
Close terminal for changes to take effect.
Run the commands below in terminal:
rbenv install 2.7.0
Run the commands below in terminal:
gem install colorize
gem install tty-font
gem install tty-prompt
gem install wavefile
Source Code : improv-freestyle
Extract to a loal folder where you enter for running the program. Run the command below in terminal after entering the folder:
ruby main.rb
\audio-samples\lib-drum\
\audio-samples\lib-drum\
\audio-samples\lib-melodic\
- files should be named sample1.wav or sample2.wav or sample3.wav
- files should be of format wav, (44100HZ, PCM 16 bits, stereo)
GitHub repository of this project
Ruby Gems used:
Online free samples: