<![CDATA[Rounding floats to the nearest 0.5 in PD Extended]]>Does anyone know how I would go about rounding a float to the nearest 0.5 (for example 10.4 would become 10.5, and 32.6 would become 32.5, and 101.9 would become 102 etc). I understand how to round floats / convert them into whole integers but cannot find a solution to rounding to the nearest 0.5 float.
Any help will be greatly appreciated!
]]>http://forum.pdpatchrepo.info/topic/11174/roundingfloatstothenearest05inpdextendedRSS for NodeSat, 17 Aug 2019 13:32:21 GMTTue, 19 Dec 2017 13:32:10 GMT60<![CDATA[Reply to Rounding floats to the nearest 0.5 in PD Extended on Tue, 19 Dec 2017 13:33:19 GMT]]>Does anyone know how I would go about rounding a float to the nearest 0.5 (for example 10.4 would become 10.5, and 32.6 would become 32.5, and 101.9 would become 102 etc). I understand how to round floats / convert them into whole integers but cannot find a solution to rounding to the nearest 0.5 float.
Any help will be greatly appreciated!
]]>http://forum.pdpatchrepo.info/topic/11174/roundingfloatstothenearest05inpdextendedhttp://forum.pdpatchrepo.info/topic/11174/roundingfloatstothenearest05inpdextendedTue, 19 Dec 2017 13:33:19 GMT<![CDATA[Reply to Rounding floats to the nearest 0.5 in PD Extended on Tue, 19 Dec 2017 16:28:39 GMT]]>@BenJackson The patch below will do it, but I bet there is an object already in extended..... or a simpler method!
There is.... ......... [listround 0.5]
As you don't need to deal with lists you can extract its essential juices......
If you need to tweek the rounding thresholds...... round_half.pd
]]>http://forum.pdpatchrepo.info/topic/11174/roundingfloatstothenearest05inpdextended/2http://forum.pdpatchrepo.info/topic/11174/roundingfloatstothenearest05inpdextended/2Tue, 19 Dec 2017 16:28:39 GMT<![CDATA[Reply to Rounding floats to the nearest 0.5 in PD Extended on Tue, 19 Dec 2017 23:07:21 GMT]]>propably the same but without expr:
[* 2]

[+ 0.5]

[i ]

[/ 2
]]>http://forum.pdpatchrepo.info/topic/11174/roundingfloatstothenearest05inpdextended/3http://forum.pdpatchrepo.info/topic/11174/roundingfloatstothenearest05inpdextended/3Tue, 19 Dec 2017 23:07:21 GMT