<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Wapi example</title>
    <script src="/js/require.min.js"></script>
</head>
<body>
    <p>Load an example and start playing</p>
    <ul>
        <li><a href="#" onclick="keyboardExample(); return false;">Frère Jacques</a></li>
        <li><a href="#" onclick="drumsExample(); return false;">Drums</a></li>
        <li><a href="#" onclick="bassExample(); return false;">Bass</a></li>
    </ul>
    <div>
        <button type="button" onclick="Wapi.play();">Play</button>
        <button type="button" onclick="Wapi.stop();">Stop</button>
    </div>
    <div id="canvas-container">
    </div>
    <script>
        function start() {
            visualize();
        }

        function visualize() {
            var canvas = Wapi.createFrequencyGraph(512, 256);
            document.getElementById('canvas-container').appendChild(canvas);
        }

        requirejs.config({
            baseUrl: '/js',

            // Ensure everything gets loaded every time.
            urlArgs: 'ts=' + (new Date()).getTime()
        });
        
        requirejs(['wapi', 'examples/keyboard', 'examples/drums', 'examples/bass'],
            function() {
                start();
            });
    </script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Wapi example</title>
    <script src="js/require.min.js"></script>
</head>
<body>
    <p>Load an example and start playing</p>
    <ul>
        <li><a href="#" onclick="keyboardExample(); return false;">Frère Jacques</a></li>
        <li><a href="#" onclick="drumsExample(); return false;">Drums</a></li>
        <li><a href="#" onclick="bassExample(); return false;">Bass</a></li>
    </ul>
    <div>
        <button type="button" onclick="Wapi.play();">Play</button>
        <button type="button" onclick="Wapi.stop();">Stop</button>
    </div>
    <div id="canvas-container">
    </div>
    <script>
        function start() {
            visualize();
        }

        function visualize() {
            var canvas = Wapi.createFrequencyGraph(512, 256);
            document.getElementById('canvas-container').appendChild(canvas);
        }

        requirejs.config({
            baseUrl: 'js',

            // Ensure everything gets loaded every time.
            urlArgs: 'ts=' + (new Date()).getTime()
        });
        
        requirejs(['wapi', 'examples/keyboard', 'examples/drums', 'examples/bass'],
            function() {
                start();
            });
    </script>
</body>
</html>

Change js dir so it works from a server subdir
Change js dir so it works from a server subdir
