-
NilaTrikona
I am beginner at using webpd. I would like to connect an HTML slider with a webpd number box. I found some examples in Sebastien Piquemal's repositories, but his slider is just for setting the amount. Every time I change the slider position, it is necessary to submit the new value with a button. I would like the HTML slider to trigger the PD object automatically, without manually submitting the data. Is it possible?
-
NilaTrikona
I`ve just started using webpd and I would be happy if someone showed me how to properly write a very simple HTML & javascript code connected to the pd patch, which has a slider that fires the moment when the value of the element is changed.
<!doctype HTML>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="../js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="../js/webpd-latest.js"></script>
<script type="text/javascript" src="../js/elindit.js"></script>
</head><body>
<button id="startButton">Start</button> <div id="controls"> <form> <input type="text" id="freqInput" /> <input type="submit" value="Set frequency" /> </form> </div> <script type="text/javascript"> webPdLali.init() $('form').submit(function(event) { event.preventDefault() Pd.send('freq', [parseFloat($('#freqInput').val())]) }) var patch $.get('pd/main.pd', function(mainStr) { // Loading the patch patch = Pd.loadPatch(mainStr) webPdLali.patchLoaded(mainStr) }) </script>
</body>
</html>