public
Description: A tiny DSL for non-trivial bloopsaphone projects.
Homepage: http://www.aanandprasad.com/1901
Clone URL: git://github.com/aanand/feepogram.git
name age message
file .document Mon Sep 14 16:01:01 -0700 2009 Initial commit to feepogram. [aanand]
file .gitignore Mon Sep 14 16:01:01 -0700 2009 Initial commit to feepogram. [aanand]
file LICENSE Mon Sep 14 16:01:01 -0700 2009 Initial commit to feepogram. [aanand]
file README.rdoc Wed Sep 16 19:44:50 -0700 2009 Use method definitions in the example code [aanand]
file Rakefile Mon Sep 14 16:29:18 -0700 2009 gemmmmmmmmm [aanand]
file VERSION Mon Sep 14 16:21:29 -0700 2009 Version bump to 0.0.0 [aanand]
file feepogram.gemspec Mon Sep 14 16:29:18 -0700 2009 gemmmmmmmmm [aanand]
directory lib/ Mon Sep 14 16:20:00 -0700 2009 ~(^_^)~ [aanand]
directory test/ Wed Sep 16 19:44:50 -0700 2009 Use method definitions in the example code [aanand]
README.rdoc

feepogram

A tiny DSL for non-trivial bloopsaphone projects.

Briefly

 require 'bloops'
 require 'feepogram'

 bloops = Bloops.new
 bloops.tempo = 320

 song = Feepogram.new(bloops) do
   sound :crunch, Bloops::NOISE do |s|
     s.punch = 0.5
   end

   sound :oooo, Bloops::SINE do |s|
     s.sustain = 2.0
   end

   sound :plink, Bloops::SQUARE do |s|
     s.punch = 1.0
   end

   def and_one
     phrase do
       oooo   " 1:c2 " * 8
       plink  " c d e f g a b + c - " * 4
     end
   end

   def and_two
     phrase do
       crunch " c2 4 c5 4 " * 8
       oooo   " 1:g2 " * 8
       plink  " c d e f g a b + c - " * 4
     end
   end

   2.times do
     and_one
     and_two
   end
 end

 song.play

Right, So

sound initialises a bloopsaphone sound and defines a handy method for you. That’s not the interesting part.

The Interesting Part

phrase defines a 32-beat phrase. Any instruments to which you don’t assign a tune in the block are told to rest for 32 beats.

This makes it easy to decompose sections of your song into methods and repeat or comment out calls to them, which is something you’ll definitely want to be doing if your song is more than 10 seconds long.

Yeah, that’s it. There’s definitely potential for more though! Like, well, I don’t know. Potential, though.

Copyright

Copyright © 2009 Aanand Prasad. See LICENSE for details.