Algorithms for a sound piece