I think a nice addition to Gosu would be a sound synthesizer of any type, so you don't have to get all your sound from files. I am suggesting this because it would be helpful in my project Songbugs in which I have each note sound stored in a file, when instead I could use a Gosu synth.
What some (Ruby) code might look like:
@synthesizer = Gosu::Synthesizer.new(window = @window, soundtype = :guitar)
def play(freq = 440)
@sampleinstance = @synthesizer.play(hertzpitch = freq, durationsecs = 0.5)
...or something like that. What do you guys think?
Well, you can already modify a sound's pitch on playback. The problem with stuff like soundtype = :guitar is that everyone's belief in what a guitar sounds like is different. If you want synthed sounds, there are an unlimited number of places on the Internet to grab them or you can make them yourself with bfxr
If you need to create synth tunes, perhaps a dedicated MIDI gem is what you want?
Yeah that last thing is exactly what I need. Also I could just change the pitch of one master file so i don't have to use 8 different ones... Thank you!
I think it wouldn't be a good addition for Gosu because it's really a rather special thing. I think you should look for synthie library and just write to a temporary file that you feed to Gosu afterwards. If it turns out to be really useful, Gosu could add support for loading files from memory. Much like RMagick can be used to create images from code, and Gosu can load those from memory.
Ah okay. Thanks!
Also, does Gosu need the file to be present until the object using it is gone? Because I found a ruby gem called Synthsize that can write generated sounds to a file, and I was thinking that I could delete the temp sound file immediately after I make a new Sample.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill