Project

feepogram

0.0
No commit activity in last 3 years
No release in over 3 years
A tiny DSL for non-trivial bloopsaphone projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

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 © 2009 Aanand Prasad. See LICENSE for details.