stewdio / beep.js

Beep is a JavaScript toolkit for building browser-based synthesizers.
http://beepjs.com
Other
1.36k stars 85 forks source link

play a single beep #9

Closed mgiraldo closed 9 years ago

mgiraldo commented 9 years ago

i'm trying to create a "generative score" based on some map data i have. i am using new Beep.Voice as placeholder for notes associated to specific types of data (7 voices total). as data is displayed, a voice should be played. i'm doing things pretty "brute force" so far and i'd like it to be cleaner:

// in the data processing function
voice = voices[datavoice]
voice.play()
setTimeout(function(){killVoice(voice)}, 20)

// and the killvoice:
function killVoice(voice) {
    voice.pause()
}

i'd like to just "play" the voice, assuming it would have a duration of, say, 20ms (basically just beep on data). i saw the duration property of voices but couldn't make them work.

the code is here (uses grunt/node/coffeescript): https://github.com/mgiraldo/inspectorviz/blob/master/app/scripts/main.coffee

this is how it looks like so far: https://vimeo.com/126519613

any ideas?

stewdio commented 9 years ago

Hi Mauricio. Thanks for trying out Beep! I’d like to keep this GitHub conversation focussed on bugs and feature requests. Would you mind posting your question on Stack Overflow and tag it beep.js? If you do that then just post the link to your question here and I’ll answer on Stack Overflow and close this thread.

Also—I checked out your video on Vimeo. Looks great!

mgiraldo commented 9 years ago

done: http://stackoverflow.com/questions/29981500/play-a-single-beep-beep-js

could not tag as beep.js because i don't have enough reputation (1.5k to create a new tag)

thanks!

ps: when i saw your handle you sounded familiar... then i noticed Jed's Other Poem and all came back! i wrote about it back in 2009 (in spanish)

stewdio commented 9 years ago

Oh wow! Jed’s Other Poem. You know that video turns 10 years old this autumn?! I’m flattered that you wrote about it. Gracias.

I just answered your post here. I too lack the required 1.5k up-votes to create a tag. :cry: Perhaps someone with that much karma will one day be persuaded to create a beep.js tag for us?

I’m going to mark this issue as closed. I hope to have that duration functionality (and more) in for you soon. I want that stuff too.