Project

juicy

0.0
No commit activity in last 3 years
No release in over 3 years
Generates songs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 0

Runtime

>= 0.0.6, ~> 0.0
 Project Readme

juicy

Gem Version Build Status Coverage Status Dependency Status Code Climate

Song creation software for the Ruby developer

Simply

gem install juicy

Some Examples

To make a pitch, give it a frequency. By default, the frequency will be tuned to the nearest frequency in equal temperament.

require 'juicy'
pitch = Juicy::Pitch.new(445)
pitch.play # audio playback only implemented for Windows and Linux platforms
# Linux platforms need to have ALSA audio libraries installed (which you probably do)

A Note is a Pitch with a name. You give it a note name and an octave

note = Juicy::Note.new(name: "G#", octave_change: -1)
note.play

You can also add or subtract from a note to go to the next half step

note += 1
note.play
note -= 2
note.play

With this much, you can make your own scales!

note = Juicy::Note.new(name: "C")
major_scale = [2,2,1,2,2,2,1]
major_scale.each do |step|
  puts note
  note.play
  note += step
end
note.play

Of course, this is cumbersome to do all on our own, so you have a Scale available to you.

root = Juicy::Note.new(name: "D", octave_change: -1)
scale = Juicy::Scale.new(mode: :major, root: root)
scale.each_note do |note|
  note.play
end

While there is enough here to write out your own scales, current development work is being done on scale objects and a beat sequencer to bring it all together.

Be sure to check in later for new features and updates!