Would it be possible to have stereo output in GP?
For example, the note block could extend to another input for left/right/center output and if none is detected default to center.
It's a small suggestion but it really can make a difference if people want to get creative with sounds.
Adding Stereo output?
Moderator: MSandro
Re: Adding Stereo output?
Stereo is actually supported by the underlying system. Here's some help I got from the GP command line:
I haven't tried it, but I think if you manually open the driver in stereo mode then you *might* be able to use the "play samples" block to output a stereo buffer. If that doesn't work, you can use "write samples" directly, passing a "BinaryData" object to it with the left and right samples interleaved.
In short, stereo is possible, although it will require you to "roll your own" stereo sound output loop.
Code: Select all
gp> help openAudio
Open the audio output driver. The optional frameCount argument is the number of stereo or mono samples (frames) to buffer, a power of 2 between 256 and 8192. Output is mono unless optional stereoFlag argument is true. Arguments: [frameCount stereoFlag]
gp> help writeSamples
Write sound samples (an array of signed, 16-bit integers). If stereo, left and right channels are interleaved. Arguments: sampleArray
In short, stereo is possible, although it will require you to "roll your own" stereo sound output loop.
Re: Adding Stereo output?
By the way, here are all the sounds "primitives".
I got this list from the list of primitives you get from typing "help" at the GP command prompt.
Code: Select all
-- Sound --
openAudio
closeAudio
samplesNeeded
writeSamples
fft
generateNoteSamples
sendMIDI
startSpeech
stopSpeech
startAudioInput
stopAudioInput
readAudioInput
Re: Adding Stereo output?
Ah I see, so a psuedo-stereo solution would be possible.
I'll try working the kinks out somehow
What're the startSpeech and stopSpeech primitives used for?
I'll try working the kinks out somehow
What're the startSpeech and stopSpeech primitives used for?