playing a music scale

hi

I’m making a music theory app. The current module I’m working on displays a variety of different scales and there’s a “play” button so you can hear the scale that’s on the screen. I have a separate sound file for each note, and each sound file is around 3 seconds long. 

I want the notes in the scale playback to be much shorter, around 0.3 seconds each. This is the gist of the code I’m using:

... local playSounds = function() audio.play(soundArray[i],{duration = 300, fadeIn = 50}) i = i + 1 end timer.performWithDelay(250,playSounds,#soundArray) ...

The effect is not very good. There is a bit of a crackle in between each note. Is there are better way to do this? I’m thinking that I will probably have to edit my sound files to make new versions of each one that are 0.3 seconds each, and use those instead of the longer sound files.

thanks,

David

Solved this by using separate channels for each note. The notes are 0.4 seconds now and playing 1 note per 0.25 seconds, so there’s a bit of an overlap, which makes it smooth. Crackle is gone.

Solved this by using separate channels for each note. The notes are 0.4 seconds now and playing 1 note per 0.25 seconds, so there’s a bit of an overlap, which makes it smooth. Crackle is gone.