From bbfc2340012c18954753a11ea818564b35b6b009 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jancsika@yahoo.com>
Date: Mon, 7 Aug 2017 16:51:17 -0400
Subject: [PATCH] revert the deletion of hid abstractions from
 f94ff9eb6c1d80d4f244706672921a77a94d96ef

---
 externals/hid/keygate-help.pd   | 46 +++++++++++++++++++++++++++
 externals/hid/keygate.pd        | 43 +++++++++++++++++++++++++
 externals/hid/notescale-help.pd | 56 +++++++++++++++++++++++++++++++++
 externals/hid/notescale.pd      | 29 +++++++++++++++++
 4 files changed, 174 insertions(+)
 create mode 100644 externals/hid/keygate-help.pd
 create mode 100644 externals/hid/keygate.pd
 create mode 100644 externals/hid/notescale-help.pd
 create mode 100644 externals/hid/notescale.pd

diff --git a/externals/hid/keygate-help.pd b/externals/hid/keygate-help.pd
new file mode 100644
index 000000000..5ed83d5a4
--- /dev/null
+++ b/externals/hid/keygate-help.pd
@@ -0,0 +1,46 @@
+#N canvas 0 31 462 494 10;
+#X obj 5 2 cnv 15 450 20 empty empty keygate 2 11 1 18 -233017 -66577
+0;
+#X obj 160 257 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 160 121 loadbang;
+#X msg 160 141 1;
+#X obj 160 169 metro 150;
+#X text 33 416 (C) Copyright 2004 Hans-Christoph Steiner <hans@eds.org>
+;
+#X text 250 430 released under the GNU GPL;
+#X obj 237 369 pddp/pddplink ../all_about_hid.pd -text all_about_hid
+;
+#X text 128 370 For more info:;
+#X text 15 207 data to be gated -->;
+#X obj 281 258 bng 25 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 40 300 keyname;
+#X symbolatom 79 324 10 0 0 0 - - -;
+#X text 157 324 <-- check here for the keyname symbol;
+#X obj 160 214 keygate f;
+#X text 17 38 [keygate] is a simple gate controlled by a keyboard.
+You must specify the name of the key which controls the gate. The left
+inlet takes the data to be gated.;
+#X text 18 89 The "f" key on the any keyboard controls this gate:;
+#X text 310 263 <-- key released;
+#X text 41 264 key pressed -->;
+#X obj 422 3 pddp/pddplink http://puredata.info/dev/pddp -text pddp
+;
+#N canvas 472 31 494 344 META 0;
+#X text 12 145 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
+Wilkes for Pd version 0.42.;
+#X text 12 25 LICENSE GPL;
+#X text 12 125 AUTHOR Hans-Christoph Steiner;
+#X text 12 85 OUTLET_0 bang;
+#X text 12 105 OUTLET_1 bang;
+#X text 12 45 DESCRIPTION simple gate controlled by a keyboard;
+#X text 12 65 INLET_0 bang;
+#X text 12 5 KEYWORDS control user_input abstraction;
+#X restore 407 462 pd META;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 4 0 14 0;
+#X connect 11 1 12 0;
+#X connect 14 0 1 0;
+#X connect 14 1 10 0;
diff --git a/externals/hid/keygate.pd b/externals/hid/keygate.pd
new file mode 100644
index 000000000..ca66095dc
--- /dev/null
+++ b/externals/hid/keygate.pd
@@ -0,0 +1,43 @@
+#N canvas 326 22 530 481 10;
+#X obj 44 36 inlet;
+#X obj 44 365 outlet;
+#X obj 44 334 spigot;
+#X text 109 401 (C) Copyright 2004 Hans-Christoph Steiner <hans@eds.org>
+;
+#X text 326 415 released under the GNU GPL;
+#X text 16 444 $Author: eighthave $;
+#X text 16 461 $Date: 2004-11-25 02:42:49 $;
+#X text 16 427 $Revision: 1.1 $;
+#X obj 132 26 loadbang;
+#X text 5 6 [keygate];
+#X obj 182 333 spigot;
+#X obj 182 365 outlet;
+#X obj 273 204 - 1;
+#X obj 273 224 abs;
+#X obj 236 27 keyname;
+#X msg 132 60 0;
+#X msg 183 60 1;
+#X obj 243 181 t f f;
+#X obj 243 157 f;
+#X obj 243 107 sel \$1;
+#X obj 243 86 symbol;
+#X obj 236 57 trigger bang float;
+#X connect 0 0 2 0;
+#X connect 0 0 10 0;
+#X connect 2 0 1 0;
+#X connect 8 0 15 0;
+#X connect 8 0 16 0;
+#X connect 10 0 11 0;
+#X connect 12 0 13 0;
+#X connect 13 0 10 1;
+#X connect 14 0 21 0;
+#X connect 14 1 20 1;
+#X connect 15 0 2 1;
+#X connect 16 0 10 1;
+#X connect 17 0 2 1;
+#X connect 17 1 12 0;
+#X connect 18 0 17 0;
+#X connect 19 0 18 0;
+#X connect 20 0 19 0;
+#X connect 21 0 20 0;
+#X connect 21 1 18 1;
diff --git a/externals/hid/notescale-help.pd b/externals/hid/notescale-help.pd
new file mode 100644
index 000000000..3d4d4179e
--- /dev/null
+++ b/externals/hid/notescale-help.pd
@@ -0,0 +1,56 @@
+#N canvas 0 31 464 467 10;
+#X floatatom 26 85 5 0 0 0 - - -;
+#X floatatom 26 160 0 0 0 0 - - -;
+#X obj 2 2 cnv 15 450 20 empty empty notescale 2 11 1 18 -233017 -66577
+0;
+#X obj 418 3 pddp/pddplink http://puredata.info/dev/pddp -text pddp
+;
+#X floatatom 137 266 5 0 0 0 - - -;
+#X obj 140 330 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X text 17 393 (C) Copyright 2004 Hans-Christoph Steiner <hans@eds.org>
+;
+#X text 234 407 released under the GNU GPL;
+#X floatatom 150 160 0 0 0 0 - - -;
+#X floatatom 297 160 0 0 0 0 - - -;
+#X obj 213 83 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -225271
+-1 -1 0 0;
+#X text 17 426 $Revision: 1.3 $$Date: 2006-03-17 04:58:30 $;
+#X text 18 439 $Author: eighthave $;
+#X obj 140 244 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262131
+-1 -1 0 0;
+#X obj 26 130 notescale 30 60;
+#X floatatom 137 347 5 0 0 0 - - -;
+#X text 13 193 If you use [notescale] with no arguments \, then the
+output range defaults to 0-127.;
+#X floatatom 202 109 5 0 0 0 - - -;
+#X obj 26 105 / 100;
+#X text 18 35 [notescale] scales a stream of numbers to a MIDI note
+number. It takes an input range of 0 to 1 \, and outputs MIDI note
+numbers based on an output range set as arguments.;
+#X obj 137 297 notescale;
+#X obj 150 130 notescale 15 120;
+#X obj 297 130 notescale 24 48;
+#N canvas 474 31 494 344 META 0;
+#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
+Wilkes for Pd version 0.42.;
+#X text 12 25 LICENSE GPL;
+#X text 12 105 AUTHOR Hans-Christoph Steiner;
+#X text 12 45 DESCRIPTION scale a stream of numbers to a MIDI note
+number;
+#X text 12 65 INLET_0 float;
+#X text 12 85 OUTLET_0 float;
+#X text 12 5 KEYWORDS control abstraction;
+#X restore 406 435 pd META;
+#X connect 0 0 18 0;
+#X connect 4 0 20 0;
+#X connect 5 0 15 0;
+#X connect 10 0 17 0;
+#X connect 10 0 21 0;
+#X connect 10 0 22 0;
+#X connect 13 0 4 0;
+#X connect 14 0 1 0;
+#X connect 18 0 14 0;
+#X connect 20 0 5 0;
+#X connect 21 0 8 0;
+#X connect 22 0 9 0;
diff --git a/externals/hid/notescale.pd b/externals/hid/notescale.pd
new file mode 100644
index 000000000..8c6336904
--- /dev/null
+++ b/externals/hid/notescale.pd
@@ -0,0 +1,29 @@
+#N canvas 37 318 444 446 10;
+#X obj 64 49 inlet;
+#X obj 64 389 outlet;
+#X obj 64 325 int;
+#X obj 64 297 expr $f1 * ($f3 - $f2) + $f2;
+#X obj 357 231 f \$2;
+#X obj 159 230 f \$1;
+#X obj 159 257 expr if ($f1 == $f2 \, 0 \, $f1) \; if ($f1 == $f2 \,
+127 \, $f2);
+#X text 10 7 [notescale];
+#X obj 229 152 loadbang;
+#X obj 229 179 t b b;
+#X text 114 49 input range: 0 to 1;
+#X obj 64 96 min 1;
+#X obj 64 116 max 0;
+#X text 123 389 output range: MIDI note #s;
+#X connect 0 0 11 0;
+#X connect 2 0 1 0;
+#X connect 3 0 2 0;
+#X connect 4 0 6 1;
+#X connect 5 0 6 0;
+#X connect 6 0 3 1;
+#X connect 6 1 3 2;
+#X connect 8 0 9 0;
+#X connect 9 0 5 0;
+#X connect 9 1 4 0;
+#X connect 11 0 12 0;
+#X connect 12 0 3 0;
+#X connect 12 0 9 0;
-- 
GitLab