[PD] [hid] button down press

Derek Holzer derek at umatic.nl
Sun Apr 11 11:17:52 CEST 2010


Hi Tyler,

anything you are doing repetitively in Pd is a good candidate for 
putting in an abstraction with a $1 creation argument. You patch might 
contain:

[hid]--[route key]--[send buttons]

[buttons_ab btn_0][buttons_ab btn_1][buttons_ab btn_2] etc etc

[receive notes]--[makenote]

where [buttons_ab] is a separate file named "buttons_ab.pd" saved in 
same directory or someplace else in your PATH containing:

[receive buttons]--[route $1]--[route 1]---[send notes]

Catch my drift? Also, depending on what happens later, your [route 1] 
could also be a [select 1]. Have a look at the help file for [select] 
and see if it is more or less useful.

Best!
Derek

On 4/11/10 10:42 AM, Tyler Leavitt wrote:

> now... i just started using it today. my current flow for sending MIDI
> events via USB gamepad button downpresses is like this:
>
> [hid]---[route key]----[route btn_0]----[route 1]----[makenote]
>
> the second route object of course has more than one button (btn_0
> through btn_11) with each output going through its own [route 1] (to
> only signal on the down press). needless to sat thats a lot of [route 1]
> objects... is there a way i can clean this code up? something along the
> lines of [route btn_0,1 btn_1,1 btn_2,1] etc....


-- 
::: derek holzer ::: http://macumbista.net :::
---Oblique Strategy # 15:
"Ask your body"




More information about the Pd-list mailing list