Cantus firmus generator in MaxMSP using javascript.