#PB_Sound_Multichannel

Just starting out? Need help? Post your questions and find answers here.
noot
User
User
Posts: 22
Joined: Wed Sep 12, 2007 8:45 am

#PB_Sound_Multichannel

Post by noot »

This might be something really simple, but I just can't figure it out...

I'm trying to do a little program that plays soundfiles using MIDI input, and polyphonically (using #PB_Sound_Multichannel). The problem is, when a midi note message comes in, I have something like

Code: Select all

channel = PlaySound (0, #PB_Sound_Multichannel)
SoundVolume (0, velocity, channel)
SoundFrequency (0, note, channel)
- but the PlaySound will cause the sound to start playing at default frequency and volume, before the parameters are set correctly. Is there any way to predict what the next channel will be BEFORE calling PlaySound? I tried to figure it out using the resulting channel data, but it gives weird numbers like 9707160 and 9707352 - what are these?