# Generate digital audio: tones, etc

**URL:** https://rubytalk.org/t/generate-digital-audio-tones-etc/61123
**Category:** ruby-talk
**Created:** [12 December 2010 10:30 UTC](https://rubytalk.org/t/generate-digital-audio-tones-etc/61123 "2010-12-12T10:30:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Terry\_Michaels](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@Terry\_Michaels](https://rubytalk.org/u/Terry_Michaels)
#### Post date: [12 December 2010 10:30 UTC](https://rubytalk.org/t/generate-digital-audio-tones-etc/61123/1 "2010-12-12T10:30:03Z")

</div>

I want to play around with writing Ruby scripts that generate electronic  
music. That is, my program generates tones, waves, beats, et cetera, and  
sends them to the sound device.

I've played around for an hour or two on my Linux box, generating 8-bit  
waves and shunting them to /dev/dsp. This is fun, but is there a Ruby  
project that already has the notes and effects and so forth? My google  
searches didn't turn up anything.

Only Linux compatibility is required. ALSA is my main audio system, with  
the OSS compatibility device available.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

### Author: ![Justin\_Collins](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@Justin\_Collins](https://rubytalk.org/u/Justin_Collins)
#### Post date: [12 December 2010 21:52 UTC](https://rubytalk.org/t/generate-digital-audio-tones-etc/61123/2 "2010-12-12T21:52:51Z")

</div>

You could try bloopsaphone: [https://github.com/mental/bloopsaphone](https://github.com/mental/bloopsaphone)

A quick search on github might find related/better stuff.

-Justin

> **···**
>
> On 12/12/2010 02:30 AM, Terry Michaels wrote:
> 
> > I want to play around with writing Ruby scripts that generate electronic  
> > music. That is, my program generates tones, waves, beats, et cetera, and  
> > sends them to the sound device.
> > 
> > I've played around for an hour or two on my Linux box, generating 8-bit  
> > waves and shunting them to /dev/dsp. This is fun, but is there a Ruby  
> > project that already has the notes and effects and so forth? My google  
> > searches didn't turn up anything.
> > 
> > Only Linux compatibility is required. ALSA is my main audio system, with  
> > the OSS compatibility device available.

---

<div class="post-metadata">

### Author: ![Terry\_Michaels](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@Terry\_Michaels](https://rubytalk.org/u/Terry_Michaels)
#### Post date: [18 December 2010 03:56 UTC](https://rubytalk.org/t/generate-digital-audio-tones-etc/61123/3 "2010-12-18T03:56:59Z")

</div>

Bloopsaphone looks great. Only thing I haven't figured out yet: Is it  
possible to produce a "dotted note", for example, a dotted-quarter note  
that lasts for 3/8 of a measure?

In regular rtttl you would do this by just placing a dot after the note  
description, but this doesn't seem to work in Bloopsaphone. Wanted to  
ask the original author (who mysteriously calls himself "why the lucky  
stiff" in his source code) but he didn't leave a solid trail to follow.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
