<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[set default value for slider or radio buttons]]></title><description><![CDATA[<p>I would like to have a slider with a starting value/position at the 50% position, so for example if the slider range is 1 - 100, then the starting value and position would be 50.  I have used a bang to a message to the slider to set the starting value.</p>
<p>bang<br />
|<br />
50(<br />
|<br />
slider</p>
<p>This works fine but requires manual input on my part to set the value of the slider by clicking the bang button.  I would prefer have this happen automatically, essentially reset the patch user interface controls to defaults when I run the patch. I tried an abstraction and use loadbang to trigger this routine</p>
<p>abstraction<br />
loadbang<br />
|<br />
50(<br />
|<br />
outlet<br />
end of abstraction<br />
|<br />
slider - main patch</p>
<p>But this did not output anything when the main patch runs.</p>
<p>how would I get something to run automatically in the main patch when the patch executes?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Nov 2026 09:21:01 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/11735.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Nov 2018 15:04:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 15:04:40 GMT]]></title><description><![CDATA[<p>I would like to have a slider with a starting value/position at the 50% position, so for example if the slider range is 1 - 100, then the starting value and position would be 50.  I have used a bang to a message to the slider to set the starting value.</p>
<p>bang<br />
|<br />
50(<br />
|<br />
slider</p>
<p>This works fine but requires manual input on my part to set the value of the slider by clicking the bang button.  I would prefer have this happen automatically, essentially reset the patch user interface controls to defaults when I run the patch. I tried an abstraction and use loadbang to trigger this routine</p>
<p>abstraction<br />
loadbang<br />
|<br />
50(<br />
|<br />
outlet<br />
end of abstraction<br />
|<br />
slider - main patch</p>
<p>But this did not output anything when the main patch runs.</p>
<p>how would I get something to run automatically in the main patch when the patch executes?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons</guid><dc:creator><![CDATA[hp3]]></dc:creator><pubDate>Tue, 06 Nov 2018 15:04:40 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 15:10:33 GMT]]></title><description><![CDATA[<p>It looks like my abstraction is working correctly.  I needed to close the patch and reopen.  When I reopen the main patch, the slider is at the default 50 position or whatever I set in the abstraction.</p>
<p>Is there a way to get the user interface to reset from re-running the patch instead of re-opening the patch?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/2</guid><dc:creator><![CDATA[hp3]]></dc:creator><pubDate>Tue, 06 Nov 2018 15:10:33 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 16:06:49 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/hp3">@hp3</a> What do you mean by &quot;re-running the patch&quot; rather than &quot;re-opening&quot;?<br />
Patches are executing all the time..... they do not &quot;run&quot; as with other programs.<br />
[loadbang] only bangs once as the patch is loaded.<br />
You could put a bang in the main patch and use [send reset] and then [receive reset] in the abstraction to bang the [50( message....... that would reset the fader.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/3</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 06 Nov 2018 16:06:49 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 16:47:33 GMT]]></title><description><![CDATA[<p>By &quot;re-run&quot; I meant unchecking edit mode from the Edit window.<br />
By &quot;re-opening&quot; I meant close the patch from the File menu, then use the File menu to open the patch.</p>
<p>When I &quot;re-open&quot; the patch the abstraction sets the default values for the ui elements as I intend.  But I have to close and re-open the patch file to acheive this automatic reset.  I would like to achieve this when I uncheck Edit mode.</p>
<p>Alternatively, I am using your suggestion of a bang to the abstraction  and also a loadbang in the abstraction to output the default values to multiple sliders.</p>
<p><img src="/uploads/files/1541522321025-mainpatch-bang-reset.png" alt="mainpatch-bang-reset.PNG" class="img-responsive img-markdown" /><br />
<img src="/uploads/files/1541522331943-abstraction-to-reset-ui.png" alt="abstraction-to-reset-ui.PNG" class="img-responsive img-markdown" /></p>
<p>My eventual goal is to have about 10 sliders and other ui elements to transmit midi parameters to a hardware synth.  I want to have default values for all of the ui elements and an easy way to reset the ui to its default values after I have used the interface.</p>
<p>My current approach uses an abstraction to send a default/starting value to an outlet for each ui element.  The sending of this value is triggered by either loadbang in the abstraction or a bang button in the main patch.</p>
<p>Is this the preferred approach? There may be 10 outlets in the abstraction.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/4</guid><dc:creator><![CDATA[hp3]]></dc:creator><pubDate>Tue, 06 Nov 2018 16:47:33 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 16:50:55 GMT]]></title><description><![CDATA[<p>By the way what the purpose of the Init/No Init button in the Slider properties window?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/5</guid><dc:creator><![CDATA[hp3]]></dc:creator><pubDate>Tue, 06 Nov 2018 16:50:55 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 17:34:19 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/hp3">@hp3</a> There is no reason not to do it that way.<br />
You did not absolutely need an abstraction..... a sub-patch would do the same and be a part of the same patch file.<br />
You could use arguments for your abstraction that set the values.... eg...... [kldefaults 50 1 0] which with $ values inside the abstraction would allow you to easily change the fixed values later.<br />
You will find out as your patch develops what are the best options.</p>
<p>Selecting &quot;Init&quot; will save the last values of the slider (if you save the patch) and send them out as the patch is re-opened....... but of course in your case the loadbang will overwrite that again.<br />
Useful if you want a value to return to its previous state.<br />
Some objects actually say &quot;save&quot; rather than &quot;init&quot;.</p>
<p>The patch is always &quot;live&quot; or &quot;running&quot; whether in edit mode or not.  Edit mode lets you put and remove objects and edit their names...... while non-edit..... run mode as you say..... lets the mouse actually click objects and move sliders so as to send data.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/6</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 06 Nov 2018 17:34:19 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 17:41:43 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/hp3">@hp3</a> As David already mentioned, the probably simplest way to do this without any abstraction is using sends and receives:<br />
<img src="/uploads/files/1541525932852-bildschirmfoto-vom-2018-11-06-18-37-45.png" alt="Bildschirmfoto vom 2018-11-06 18-37-45.png" class="img-responsive img-markdown" /></p>
<p>Instead of send/receive objects you can also use the internal send/receive functions of bangs. You can also combine them.</p>
<p>Any event can trigger the bang that resets all the interface elements, but to my knowledge there is no event when you exit edit mode.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/7</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Tue, 06 Nov 2018 17:41:43 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 17:46:44 GMT]]></title><description><![CDATA[<p>If you don't want the interface elements to output their values when they are reset you can use a set message:<br />
<img src="/uploads/files/1541526386905-bildschirmfoto-vom-2018-11-06-18-45-02.png" alt="Bildschirmfoto vom 2018-11-06 18-45-02.png" class="img-responsive img-markdown" /></p>
<p>Demo: <a href="/uploads/files/1541526401750-send-demo.pd">send-demo.pd</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/8</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Tue, 06 Nov 2018 17:46:44 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 18:11:05 GMT]]></title><description><![CDATA[<p>thanks for all the suggestions.   I was able to implement the send and receive technique, that seems to work well in my situation.</p>
<p>However, I am noticing that when I use the bang to reset the values of the user interface, even though pd is sending out the correct midi messages for each ui element,  the hardware synthesizer is not responding to the midi messages except for the last message received which would correspond to the radio button (right most control).</p>
<p>Is this due to midi sysex messages being sent too quickly for the synthesizer to process and it only process the last message?  Is there a way to put a delay time in between the messages?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/9</guid><dc:creator><![CDATA[hp3]]></dc:creator><pubDate>Tue, 06 Nov 2018 18:11:05 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 18:35:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/hp3">@hp3</a> You can try this using [delay] after the receive, but the reason may be something else.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/10</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Tue, 06 Nov 2018 18:35:20 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 18:52:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/hp3">@hp3</a> If <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ingox">@ingox</a> has finished writing his tutorial it might be time to post your patch......<img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title="grinning" alt=":grinning:" /><br />
Use the bar with the up arrow to upload it and then we can spot any errors much more easily.<br />
Sometimes it is a question of the order of operations....... <a href="http://puredata.info/docs/manuals/pd/x2.htm" rel="nofollow">http://puredata.info/docs/manuals/pd/x2.htm</a> sometimes not.<br />
A complete sysex message needs to be built for every piece of data....... probably order of operations problem...... timing problem doubtful.<br />
Except in that the order things are done is a (sort of) timing issue..... <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/confounded.png" title="confounded" alt=":confounded:" /> (tying myself in knots...!)<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/11</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 06 Nov 2018 18:52:40 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 18:54:04 GMT]]></title><description><![CDATA[<p>ok, here is the main patch</p>
<p><a href="/uploads/files/1541530362922-k1-controls.pd">k1 controls.pd</a></p>
<p>and here is the abstraction that generates the sysex<br />
<a href="/uploads/files/1541530385250-k1sx.pd">k1sx.pd</a></p>
<p>All of this works fine if I operate one control at a time, but if I click the bang, the ui elements update and the midi messages print out correctly but the only parameter that changes on the hardware synth is the one corresponding to the rightmost control.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/12</guid><dc:creator><![CDATA[hp3]]></dc:creator><pubDate>Tue, 06 Nov 2018 18:54:04 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Tue, 06 Nov 2018 19:22:13 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/hp3">@hp3</a> I need to finish cooking dinner....... <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ingox">@ingox</a> will beat me to it.....<img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/no_mouth.png" title="no_mouth" alt=":no_mouth:" /></p>
<p>In the meantime...... yes, it could be timing...... <a href="https://kawaik1.wordpress.com/2016/04/03/how-to-send-sysex-data-to-the-kawai-k1/" rel="nofollow">https://kawaik1.wordpress.com/2016/04/03/how-to-send-sysex-data-to-the-kawai-k1/</a><br />
They say 10ms is enough....... between messages probably.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/13</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 06 Nov 2018 19:22:13 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Wed, 07 Nov 2018 01:51:49 GMT]]></title><description><![CDATA[<p>thanks for all the help.  I am very new to Pure data.  I am not sure how to set up the delay.  Are there any examples or tutorials that I might refer to?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/14</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/14</guid><dc:creator><![CDATA[hp3]]></dc:creator><pubDate>Wed, 07 Nov 2018 01:51:49 GMT</pubDate></item><item><title><![CDATA[Reply to set default value for slider or radio buttons on Wed, 07 Nov 2018 09:05:10 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/hp3">@hp3</a> This will delay the messages when you reset...... <a href="/uploads/files/1541581270553-k1.zip">k1.zip</a><br />
Although I noticed that you had drawn connections to both the number messages and the guis from [r reset] for both speed and shape, which meant that the message was sent twice for those.<br />
So if speed and shape are a &quot;toggle&quot; in the K1 the reset would have turned them &quot;on&quot; and then immediately &quot;off&quot;....... I don't know if that was the problem though.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/15</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/11735/set-default-value-for-slider-or-radio-buttons/15</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Wed, 07 Nov 2018 09:05:10 GMT</pubDate></item></channel></rss>