<?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[Trigger a bang with serial data from arduino]]></title><description><![CDATA[<p>Hello, i am working on a patch that should control the volume of 2 tracks via serial data.</p>
<p>Let me explain what i would like to achieve.</p>
<p>I have 3 wav-files. Each ~3min long, playing in an infinite loop.<br />
The first track is always hearable the other two track should be faded in and out using two switches connected to an arduino and communicating with Pure Data over the serial port.</p>
<p>My problem is that if i flip the switch to &quot;on&quot; i have an &quot;1&quot; coming in over the serial port that is not triggering a bang but keeps the bang active all the time, same with the &quot;0&quot; coming over the serial port.<br />
That way the fade-in and out is not working as it should.</p>
<p>How do i trigger the bang without keeping the bang active all the time?<br />
Thanks!<br />
<img src="/uploads/files/1658007522677-bildschirmfoto-2022-07-16-um-23.24.42.png" alt="Bildschirmfoto 2022-07-16 um 23.24.42.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14002/trigger-a-bang-with-serial-data-from-arduino</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 18:14:50 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/14002.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Jul 2022 21:38:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Trigger a bang with serial data from arduino on Sat, 16 Jul 2022 21:38:55 GMT]]></title><description><![CDATA[<p>Hello, i am working on a patch that should control the volume of 2 tracks via serial data.</p>
<p>Let me explain what i would like to achieve.</p>
<p>I have 3 wav-files. Each ~3min long, playing in an infinite loop.<br />
The first track is always hearable the other two track should be faded in and out using two switches connected to an arduino and communicating with Pure Data over the serial port.</p>
<p>My problem is that if i flip the switch to &quot;on&quot; i have an &quot;1&quot; coming in over the serial port that is not triggering a bang but keeps the bang active all the time, same with the &quot;0&quot; coming over the serial port.<br />
That way the fade-in and out is not working as it should.</p>
<p>How do i trigger the bang without keeping the bang active all the time?<br />
Thanks!<br />
<img src="/uploads/files/1658007522677-bildschirmfoto-2022-07-16-um-23.24.42.png" alt="Bildschirmfoto 2022-07-16 um 23.24.42.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14002/trigger-a-bang-with-serial-data-from-arduino</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14002/trigger-a-bang-with-serial-data-from-arduino</guid><dc:creator><![CDATA[petemanzel]]></dc:creator><pubDate>Sat, 16 Jul 2022 21:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to Trigger a bang with serial data from arduino on Sat, 17 Sep 2022 09:13:50 GMT]]></title><description><![CDATA[<blockquote>
<p>if i flip the switch to &quot;on&quot; i have an &quot;1&quot; coming in over the serial port that is not triggering a bang but keeps the bang active all the time, same with the &quot;0&quot; coming over the serial port.</p>
</blockquote>
<p>The Arduino keeps on sending 0s or 1s<br />
Easiest would be to insert the object<br />
[change]<br />
filtering duplicates once before [sel 1] and [sel 0]</p>
<p>But there might be more different data coming in. Then prefilter with another [sel 0 1]</p>
<p><img src="/uploads/files/1658017092763-routefilter.gif" alt="routefilter.gif" class="img-responsive img-markdown" /></p>
<p>Also consider that by pressing or releasing the switch bounces until it keeps resting at its actual state. To debounce nervous switch data:<br />
<a href="https://forum.pdpatchrepo.info/topic/12092/debouncing-was-measure-time-between-two-bangs-events" rel="nofollow">https://forum.pdpatchrepo.info/topic/12092/debouncing-was-measure-time-between-two-bangs-events</a><br />
<a href="https://forum.pdpatchrepo.info/topic/6257/debouncing/2" rel="nofollow">https://forum.pdpatchrepo.info/topic/6257/debouncing/2</a></p>
<p>But wait:<br />
Is the part following after [comport] working?<br />
Also [list tosymbol] followed by [fromsymbol] looks redundant to me?<br />
Did you debug with another [print later] after [fromsymbol] comparing with that [print] earlier on?</p>
<p>Some more notes on your patch:</p>
<p>Better use [line~] or [vline~] with tilde ~ instead of [line] because signalrate objects update their output on every sample, control objects only every 64th sample.</p>
<p>Squared for logrithmic fades:<br />
<img src="/uploads/files/1658010924354-levels.gif" alt="levels.gif" class="img-responsive img-markdown" /><br />
[line~] has to reach 1 for this. You can divide the signal later on: [*~ 0.25]</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/14002/trigger-a-bang-with-serial-data-from-arduino/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/14002/trigger-a-bang-with-serial-data-from-arduino/2</guid><dc:creator><![CDATA[lacuna]]></dc:creator><pubDate>Sat, 17 Sep 2022 09:13:50 GMT</pubDate></item></channel></rss>