[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FMOD or other sound libraries...anyone?

david

3/21/2005 12:46:00 PM

I'm looking for a good Ruby sound library...

I've been looking for Ruby bindings of FMOD the last few days, but it
looks like very little is available, if anything.

Does anyone know of someone working on FMOD bindings? I can see there
is at least two bindgins of SDL (RUDL and ruby-sdl), but I'm having no
luck trying to run either in OSX.

Any advice appreciated...
18 Answers

Richard Lyman

3/21/2005 3:44:00 PM

0

On Mon, 21 Mar 2005 21:49:53 +0900, David Casal <david@luminas.co.uk> wrote:
> I'm looking for a good Ruby sound library...
>
> I've been looking for Ruby bindings of FMOD the last few days, but it
> looks like very little is available, if anything.
>
> Does anyone know of someone working on FMOD bindings? I can see there
> is at least two bindgins of SDL (RUDL and ruby-sdl), but I'm having no
> luck trying to run either in OSX.
>
> Any advice appreciated...
>
>

I think I remember Jamis mentioned something once... something about
Ruby and FMOD, but it might have been a different sound library...

-Rich


Jamis Buck

3/21/2005 3:56:00 PM

0

On Mar 21, 2005, at 8:43 AM, Richard Lyman wrote:

> On Mon, 21 Mar 2005 21:49:53 +0900, David Casal <david@luminas.co.uk>
> wrote:
>> I'm looking for a good Ruby sound library...
>>
>> I've been looking for Ruby bindings of FMOD the last few days, but it
>> looks like very little is available, if anything.
>>
>> Does anyone know of someone working on FMOD bindings? I can see there
>> is at least two bindgins of SDL (RUDL and ruby-sdl), but I'm having no
>> luck trying to run either in OSX.
>>
>> Any advice appreciated...
>>
>>
>
> I think I remember Jamis mentioned something once... something about
> Ruby and FMOD, but it might have been a different sound library...
>

It was FMOD. I wrote some simple bindings for my Vimscriber
transcription application, using Ruby/DL, but...alas...I can't get it
to work on OSX, which is what the OP seems to want. If only FMOD were
opensource, I could compile it to a shared library, but as it is the
OSX version of FMOD is only distributed as a static lib. (Someone,
please correct me if I'm wrong!)

I, too, would be very interested in Ruby bindings to a sound lib for
OSX. Would ruby-cocoa work? Anyone know?

- Jamis



David Plans Casal

3/21/2005 4:50:00 PM

0


On 21 Mar 2005, at 15:55, Jamis Buck wrote:

>> I think I remember Jamis mentioned something once... something about
>> Ruby and FMOD, but it might have been a different sound library...
>>
>
> It was FMOD. I wrote some simple bindings for my Vimscriber
> transcription application, using Ruby/DL, but...alas...I can't get it
> to work on OSX, which is what the OP seems to want. If only FMOD were
> opensource, I could compile it to a shared library, but as it is the
> OSX version of FMOD is only distributed as a static lib. (Someone,
> please correct me if I'm wrong!)
>
> I, too, would be very interested in Ruby bindings to a sound lib for
> OSX. Would ruby-cocoa work? Anyone know?

Are you talking about http://www.fmod.org/files/fmodapi3... ?

Their website says 'Carbon based. Codewarrior CFM and GCC Mach-O
Compatible.'

Also, I see that there's been some work here:

http://onesadcookie.is-a-geek.net/cgi-bin/blosxom.cg...
22#openal_ruby

on OpenAL bindings, but it looks seriously alpha...

Jamis, please do let me know what you find! I'm urgently looking to
start work on Ruby audio...

cheers,

david casal



David Plans Casal

3/21/2005 5:32:00 PM

0


On 21 Mar 2005, at 16:49, David Plans Casal wrote:

>
> On 21 Mar 2005, at 15:55, Jamis Buck wrote:
>> I, too, would be very interested in Ruby bindings to a sound lib for
>> OSX. Would ruby-cocoa work? Anyone know?

Just as an added note to that, I've just tried RubyCocoa from
http://www.fobj.com/rubycocoa/doc/bui... .... version 0.4.0 was
made for ruby 1.6.7, so 1.8.x on OSX is complaining...can't seem to
compile at all.

Jamis : however, rubycocoa does look like an alternative (if one could
actually install it ;-) )


david casal



Jamis Buck

3/21/2005 5:53:00 PM

0

On Mar 21, 2005, at 9:49 AM, David Plans Casal wrote:

>
> On 21 Mar 2005, at 15:55, Jamis Buck wrote:
>
>>> I think I remember Jamis mentioned something once... something about
>>> Ruby and FMOD, but it might have been a different sound library...
>>>
>>
>> It was FMOD. I wrote some simple bindings for my Vimscriber
>> transcription application, using Ruby/DL, but...alas...I can't get it
>> to work on OSX, which is what the OP seems to want. If only FMOD were
>> opensource, I could compile it to a shared library, but as it is the
>> OSX version of FMOD is only distributed as a static lib. (Someone,
>> please correct me if I'm wrong!)
>>
>> I, too, would be very interested in Ruby bindings to a sound lib for
>> OSX. Would ruby-cocoa work? Anyone know?
>
> Are you talking about http://www.fmod.org/files/fmodapi3... ?
>
> Their website says 'Carbon based. Codewarrior CFM and GCC Mach-O
> Compatible.'

That's the one. However, my bindings are Ruby/DL based, which means
Ruby tries to load the library and execute the code directly, without a
compiled glue-layer. I'm sure an enterprising individual could write a
C extension to Ruby that used the FMOD routines...but I'd rather not
have to.

- Jamis



David Plans Casal

3/21/2005 6:35:00 PM

0


On 21 Mar 2005, at 17:52, Jamis Buck wrote:

>> Are you talking about http://www.fmod.org/files/fmodapi3...
>> ?
>>
>> Their website says 'Carbon based. Codewarrior CFM and GCC Mach-O
>> Compatible.'
>
> That's the one. However, my bindings are Ruby/DL based, which means
> Ruby tries to load the library and execute the code directly, without
> a compiled glue-layer. I'm sure an enterprising individual could write
> a C extension to Ruby that used the FMOD routines...but I'd rather not
> have to.

Heh! Completely understand...I just plain cannot write the bindings
since I know -no- C at all...oh well.

On the other hand, to correct what I said earlier about RubyCocoa, the
HEAD tag out of cvs installs just fine on OSX and ruby 1.8.1...all the
sound examples play fine.

I did:

cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/rubycocoa login

cvs -z3 -d:pserver:anonymous@cvs.sf.net:/cvsroot/rubycocoa co -P -r
HEAD -d rubycocoa-panther src

then

cvs update -d -P

Now I guess that RubyCocoa isn't really as straightforward as FMOD to
play with sound and Ruby, but...

Anyone have any alternative suggestions?

david casal



Dave Baldwin

3/21/2005 9:21:00 PM

0


On 21 Mar 2005, at 15:55, Jamis Buck wrote:

>
> I, too, would be very interested in Ruby bindings to a sound lib for
> OSX. Would ruby-cocoa work? Anyone know?
>
> - Jamis

Yes, one of the sample programs is:

require 'osx/cocoa'

snd_files =
if ARGV.size == 0 then
`ls /System/Library/Sounds/*.aiff`.split
else
ARGV
end

OSX.ruby_thread_switcher_start(0.001, 0.1)
Thread.start { OSX::NSRunLoop.currentRunLoop.run }

snd_files.each do |path|
snd = OSX::NSSound.alloc.initWithContentsOfFile_byReference(path,
true)
snd.play
sleep 0.25 while snd.isPlaying?
end


Don't know if this give the OP what he wants.

Dave.



Mathieu Bouchard

3/22/2005 8:41:00 AM

0

David Plans Casal

3/22/2005 11:12:00 AM

0

Hi Matju,

On 22 Mar 2005, at 08:41, Mathieu Bouchard wrote:

> On Mon, 21 Mar 2005, David Casal wrote:
>
>> I'm looking for a good Ruby sound library...
>
> I am maintainer for the Ruby bindings to PureData, which is a realtime
> visual programming language for audio. I am also the author of a video
> plugin for PureData, and actually those things are bundled together
> under
> the name GridFlow.

The world's so small. Met you on IRC last saturday ;-) (nick: pland)

> I use GridFlow for interactive setups in art galleries, museums, and
> music
> shows, under contract with local artists (mostly in Montréal and
> Ottawa/Gatineau). I'm doing that stuff part-time while struggling with
> a
> degree (the degree is over now, so I'm going to do this full-time now,
> hopefully)

Does this mean that Ruby-PD bindings might get deeper (audio buffer
access?), if you have time?

> It would be cool to have more elaborate bindings because the ones I
> have
> coded are rather minimal (that is, only what I need to have for the
> video
> plugin). In the future it would be cool to be able to have complete
> access to PureData objects, in the same way that the Python bindings to
> PureData can. Especially missing are ways to access audio buffers. I
> think
> it wouldn't be that difficult to implement, but I haven't needed them
> yet.

Ah! Ok I understand now. In my case, because of my music background and
the fact I wanted to learn Ruby, I thought it would be great to be able
to -hear- my study of Ruby, if you see what I mean.

So, what I was after was a way to exemplify concepts from the second
edition of the Pickaxe, in sound.

I played with PureData during my degree, and I guess having access to
PD objects from Ruby would be as close as I get to heaven! ;-) But I
suppose I need to find an intermediate solution for now...

> What do you think about it? Is it overkill for your needs? What do you
> want to achieve with the audio library?

So, see above, but here's a summary : I think Gridflow is an amazing
idea and project (got some osx compilation trouble I'll address
ex-list), and would love to start learning it.

But browsing the pd flow ruby examples in there got me kinda lost.
Firstly because I couldn't run it (compilation), but also because I
didn't quite get how PD would pick Gridflow up and viceversa (other
than -lib)

What I'm looking for, I guess, is the ability to play with sampled
sound for now (similar to Cocoa's NSSound, but a bit deeper), in a way
that allows me to explore ruby by ear. So simple sample loading,
playing, buffering, maybe some DSP...perhaps some MIDI (though I see
midilib)...like I said, PDRuby would be of course ideal, but the basics
through pure Ruby and Gridflow would be even better right now, since
I'm a complete n00b to Ruby.

Is that too vague?

> PS: The big problem with audio and Ruby, though, is that the garbage
> collector takes too much CPU in one chunk, so that low-latency audio
> just
> fails horribly. For ordinary audio needs that's not really a problem
> unless the computer is slow, but many people want low-latency so that
> they
> can replace their expensive and unflexible guitar pedals by something
> extremely versatile, the computer.

I see. Of course.

Well I aim to get to a point where I can do that too. And so, I -will-
need a low-latency, probably C-implemented (like PD) engine behind me,
and I guess I see Ruby as the higher-level, 'thinking' language for
composition, and pedal-making.

My guess is you do too?

What can I do to help? I'm studying the Pickaxe now, and I'll download
tarball of Gridflow (tried CVS unsuccessfully) and try on OSX
(10.3.8)...is there a short summary of how to get GF and PD talking
anywhere (other than website docs?)

Thanks for you reply, Matju, I look forward to working in Gridflow.

Cheers,

David




Robert McGovern

3/22/2005 1:06:00 PM

0

Speaking of Ruby bindings for FMod, Lorien Dunn created one which
worked against Ruby 1.6.8. It was part of a package called Hail which
was available for Linux and Windows

This was the announcement for it on Ruby Talk

http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-...

Unfortuantly it appears to have disappeared from the web & RAA.

If anyone is interested I have a copy of 0.6 that Lorien sent me back
in April 2003.

Rob