A number of ideas and suggestions

Hi @Doffer, @ruilov and @Bortels achieved this by copying over the PCM data using some utility…

@Doffer if all goes well you should be able to fetch the data over http in the next update.

Yay! I would love that :slight_smile:

Thanks!

Thanks for the updated example. (In the online reference, for the ‘soundbuffer’ example, the 2nd input is ‘iparameter’ instead of ‘parameter’, and ‘datum’ is assigned a space or nil, depending on where I look. It’s not really clear at first what ‘datum’ should represent at first.)

It eventually dawned on me that ‘datum’ would have to be some kind of waveform, just wasn’t sure of the limits as to what could be entered. (0-255, 127/128 around 0 level?)
I still get some clicks and pops playing with different shapes of the wave (reviewing Dr Petter’s article on ‘basic sound theory and synthesis’ and trying to center around and end below ‘0’-level) but encouraging nonetheless.

i only have read the first post. but +1 for all of the editor suggestions

@kfin63, yes the datum is one chunk of the wave (cycle?) that can be repeated to produce continuous sound. With values between 0 and 255, 127 is the middle point. ClIcks will occur if you start, stop or change the tone in mid cycle without equalising the amplitude of the wave.

I’ll try to post some code soon, but I am still figuring out how to avoid the occasional click.

@Fred, thanks. This is one busy forum! This probably belongs in a ‘sound’ thread, but the question happened to be raised here.

After finding out more about PCM encoding, the missing piece (datum assigned ‘nil’) of the reference example for soundbuffer started to make more sense. Always a good idea, more reading. From which I gather:

0-255 only with the mono8 format. 16-bit formats will need two bytes to encode the possible range 0-65535; stereo formats specify the left sample/cycle first, followed by the right sample (interleaved).

Have seen a few mentions and checked out your Abc player, which looks like a great work. I’m not familiar with the ABC format myself yet.

Hi @kfin63, yes, let’s jump into a sound thread! :). I just put up some soundbuffer code on another thread: http://twolivesleft.com/Codea/Talk/discussion/808 but need to play with it more to eliminate clicks.

Thanks, ABC format has some good resources on the web and seemed a good start for making simple music. I only discovered it when thinking about how we could make music with Codea.