This DEMO exemplifies how WebAudioXML can be used to define a flexible scale. When you slide to the right on the touch-area, the pitches snap to a major scale and when you slide to the left, they snap to a minor scale. It's done using two variable objects - one to follow the position on the X-axis and one to follow the direction on the X-axis. Please read the comments audio.xml for more details.
WebAudioXML is a PhD research project invented and maintained by Hans Lindetorp. For more info, turorials, documentation and download links, please visit https://github.com/hanslindetorp/WebAudioXML