dev-master
9999999-devTurn stuff into music
MIT
The Development Requires
1.1.1
1.1.1.0Turn stuff into music
MIT
The Development Requires
Turn stuff into music
Add Note
Objects to a Sequence
which can be dumped into a wave file., (*1)
REQUIRES "sox" http://sox.sourceforge.net/, (*2)
sudo apt-get install sox
or brew install sox
, (*3)
The notes are indexed like this:, (*4)
Play a simple A major scale, (*5)
<?php $alleMeineEntchen = [0, 2, 4, 5, [7, 1 / 2], [7, 1 / 2], 9, 9, 9, 9, [7, 1 / 2], [null, 1 / 2], 9, 9, 9, 9, [7, 1 / 2]]; $sequence = Sequence::fromTuples($alleMeineEntchen); $player = new Player($sequence); $dumper = new SoundDumper(); $dumper->dump($player, __DIR__.'/lala.ul', __DIR__.'/lala.wav');
Numbers are converted to Note
objects.
They have an index of a note on the chromatic scale.
The also have a length given as quarter notes, half notes, ...
(The actual length of the sound is determinded by the BPM of the player, see below), (*6)
Note
objects are added to a Sequence
that holds all the notes., (*7)
A Sequence
can be used in a Player
where speed and base frequencey (default 220 Hz) can be adjusted.
With this information, the Sequence
of Notes
can be transformed into a list of Tone
objects.
A Tone
object has an actual length in miliseconds and a frequency in Hertz., (*8)
A Dumper
can convert the list of Tone
objects into a a actual media file.
sox
is being used here., (*9)
, (*10)
The Converter
's job is to turn given numeric input (file size, hash, lines of code, ...) into
Notes. By passing some options (TBD, how to map file size to lenght, ...) it will create Note
instance
that can be added to a Sequence., (*11)
Traverses a directory recursively and looks at the files., (*12)
Each file determines the Sound to play., (*13)
Size of the file determines the length of the sound., (*14)
Hash (md5) of the file determines the pitch., (*15)
To sound "reasonably harmonic", the hash is not translated into a frequency., (*16)
It translates into a note on the scale of A Major., (*17)
Turn stuff into music
MIT
Turn stuff into music
MIT