# Code to make notes a Toggle

**URL:** <https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079>\
**Category:** Organelle\
**Created:** [April 6, 2017, 5:25pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079 "2017-04-06T17:25:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [April 6, 2017, 5:25pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/1 "2017-04-06T17:25:56Z")

</div>

I’m looking for an elegant way to make the note messages which are momentary bangs into toggles?  
i just have not done it yet, surely this is in an example somewhere?

Thank you

---

<div class="post-metadata">

**Author:** ![oweno](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/oweno/32/10_2.png) [@oweno](https://forum.critterandguitari.com/u/oweno)\
**Post date:** [April 6, 2017, 6:43pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/2 "2017-04-06T18:43:46Z")

</div>

Sometimes I just use the toggle GUI object where a bang just flips it. The note messages are just midi pairs, so you can use the [stripnote] to pass only the key press and not the release, then use [sel] with whatever key number you want to toggle.

---

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [April 6, 2017, 10:21pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/3 "2017-04-06T22:21:30Z")

</div>

that’s much more elegant than the spigot way i did it, this time.lol

I need to know a few things that will really open up the next patch.

1.) how do you get the knobs to be on seperate pages? i tried to copy the code for the two page pd-grids example but i can’t seem to get the pages to stay separate

2.) code for the little red recording light to go on while sampling

---

<div class="post-metadata">

**Author:** ![oweno](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/oweno/32/10_2.png) [@oweno](https://forum.critterandguitari.com/u/oweno)\
**Post date:** [April 7, 2017, 3:35am UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/4 "2017-04-07T03:35:29Z")

</div>

The LED is easy, you can just send a number 0 - 7 to [s led]. 0 is off, 1 is red, 2 is yellow and so on.

For the knobs, there isn’t a standard way to page them, so checking out how other patches handle this is the right move.

---

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [April 7, 2017, 5:15am UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/5 "2017-04-07T05:15:32Z")

</div>

owengo  
do i have to/can i compile source with the Organelle?  
I have some source that are pre-compiled and the wrong ELF type

---

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [July 7, 2019, 4:45am UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/6 "2019-07-07T04:45:35Z")

</div>

Hey I am back here  
It seems like the notes and the aux button are even more sensitive and they do not clack, is this why there is the aux + menu thing?

---

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [July 7, 2019, 5:28am UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/7 "2019-07-07T05:28:54Z")

</div>

My challenge is that often i use aux to turn patches on off but my former trick of taking press from aux/fs etc… and send both a toggle and a bang to a spigot and then to a toggle used to work but no longer – it seems that all i get is very very momentary behavior. is there a work around for this?

---

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [July 7, 2019, 7:21am UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/8 "2019-07-07T07:21:31Z")

</div>

so weird.  
just a simple r-aux -----sel 1 and it works…i have this problem with over complicating things sometimes, anyway. it helped me get familiar with a few things

---

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [July 7, 2019, 5:52pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/9 "2019-07-07T17:52:35Z")

</div>

actually i had to view a few C&G patches to see what the trick was

[r-aux]  
|  
[sel 1]  
|  
[delay 100]  
|  
[tgl]

---

<div class="post-metadata">

**Author:** ![thetechnobear](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/thetechnobear/32/42_2.png) [@thetechnobear](https://forum.critterandguitari.com/u/thetechnobear)\
**Post date:** [July 7, 2019, 9:48pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/10 "2019-07-07T21:48:12Z")

</div>

hmm, interesting - I wonder if there is a slight difference in ‘debounce’ behaviour…  
this would materialise as seeing a bit of ‘noise’ on r-aux.

though, id have not thought a del 100, would not help this.

it be interesting to keep an eye out for these kind of anomalies, so we can try to see if can keep the organelle-1 and organelle-m compatible.  
(i.e. we don’t want to start making m and 1 patches different/incompatible for such minutiae)

---

<div class="post-metadata">

**Author:** ![shreeswifty](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/shreeswifty/32/790_2.png) [@shreeswifty](https://forum.critterandguitari.com/u/shreeswifty)\
**Post date:** [July 7, 2019, 11:15pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/11 "2019-07-07T23:15:31Z")

</div>

i think the delay-100 is a little more elegant but i know what you mean.

---

<div class="post-metadata">

**Author:** ![oweno](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/oweno/32/10_2.png) [@oweno](https://forum.critterandguitari.com/u/oweno)\
**Post date:** [July 8, 2019, 12:01pm UTC](https://forum.critterandguitari.com/t/code-to-make-notes-a-toggle/1079/12 "2019-07-08T12:01:26Z")

</div>

I am a little confused by the purpose of the [delay 100], which patch did it come from? it might have been more of a speed limit thing than debounce.

The keys for Organelle 1 and M are both debounced before they get to the patch, so you really shouldn’t see any on/off noise unless you press a key very lightly and ‘hover’ between on and off. (or if you have an old Organelle 1 with the keyboard problem, but that is a known hardware issue with a fix)
