# Use pot touch to send a midi cc

**URL:** <https://forum.electra.one/t/use-pot-touch-to-send-a-midi-cc/3864>\
**Category:** General discussion\
**Created:** [August 11, 2025, 2:45pm UTC](https://forum.electra.one/t/use-pot-touch-to-send-a-midi-cc/3864 "2025-08-11T14:45:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GnOhmen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/gnohmen/32/3449_2.png) [@GnOhmen](https://forum.electra.one/u/GnOhmen)\
**Post date:** [August 11, 2025, 2:45pm UTC](https://forum.electra.one/t/use-pot-touch-to-send-a-midi-cc/3864/1 "2025-08-11T14:45:43Z")

</div>

Hey i know this have been asked many times but i can´t find out if its possible without writing Lua.

Can i use the pot touch to send a midi cc message ? and if yes how do i actually do it?

Sorry i am ultra noob with the E1 😃

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [August 11, 2025, 4:37pm UTC](https://forum.electra.one/t/use-pot-touch-to-send-a-midi-cc/3864/2 "2025-08-11T16:37:32Z")

</div>

You’ll need lua for this.

But yes, you can have it send a midi CC message upon touching if that’s what you want. It’s using a subscription to touch events and a ‘onTouch’ callback that you can invoke when the pot is touched.

I myself haven’t done that yet.

---

<div class="post-metadata">

**Author:** ![GnOhmen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/gnohmen/32/3449_2.png) [@GnOhmen](https://forum.electra.one/u/GnOhmen)\
**Post date:** [August 11, 2025, 4:51pm UTC](https://forum.electra.one/t/use-pot-touch-to-send-a-midi-cc/3864/3 "2025-08-11T16:51:14Z")

</div>

Thx for the answer.. i was afraid it involved lua better learn the basics of it but is not so sharp at coding in general.. this might be the perfect reason to do it 🙂

---

<div class="post-metadata">

**Author:** ![kiwigrass](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/kiwigrass/32/4983_2.png) [@kiwigrass](https://forum.electra.one/u/kiwigrass)\
**Post date:** [August 12, 2025, 12:06am UTC](https://forum.electra.one/t/use-pot-touch-to-send-a-midi-cc/3864/4 "2025-08-12T00:06:32Z")

</div>

Yes, the ‘onTouch’ callback is very useful and I have used it in my recent presets. I was switched on to it by @oldgearguy.

Here is a snippet of lua code from one of my recent presets ([Electra One App](https://app.electra.one/preset/DBhBn4Wwn1LDYpVR1JM6)). This is sending sysex rather than cc messages, but its the same basic idea.

```auto
-- events to track
events.subscribe(PAGES | POTS)

-- curCtl holds which of the control knobs were touched
-- only want to update after the control was changed and then released so
curCtl = -1

-- control Ids ordered by parameter number (201-218)
patchCtls = {186,188,189,190,191,192,199,202,204,206,6}

msbIdx = 95 -- msb for SN Synth tones
lsbIdx = 64 -- lsb for SN synth tones: (64-70) for factory patches, and (0-3) for user banks

function events.onPotTouch(potId, controlId, touched)
  local idx = get_key_for_value(patchCtls,controlId)
  if (idx == nil) then return end

  if (touched == true) and (curCtl ~= controlId) then
      curCtl = controlId
  end
  if (touched == false) and (curCtl == controlId) then
    local midiValue = controls.get(controlId):getValue("value"):getMessage():getValue()
    local s = parameterMap.get (deviceId, PT_VIRTUAL, 10000 ) + 31
    local lsb = math.floor(midiValue / 128) + lsbIdx
    local midiValue = (midiValue % 128)
-- SNS patch select
    local array = {0x41, integra_ID, 0x00, 0x00, 0x64, 0x12, 0x18, 0x00, s, 0x06, msbIdx, lsb, midiValue, 0x7F}
    midi.sendSysex(port, array)
-- request SNS patch data
    local ab = SNAddress(1)
    array = {0x41, integra_ID, 0x00, 0x00, 0x64, 0x11, ab[1], ab[2], 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x7F}
    midi.sendSysex (port, array) 
  end
end
    
-- currently do not need to track which page is active; we might need it later
function events.onPageChange(newPageId, oldPageId)
   return
end

```

```auto
   

```

---

<div class="post-metadata">

**Author:** ![GnOhmen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/gnohmen/32/3449_2.png) [@GnOhmen](https://forum.electra.one/u/GnOhmen)\
**Post date:** [August 12, 2025, 5:07am UTC](https://forum.electra.one/t/use-pot-touch-to-send-a-midi-cc/3864/5 "2025-08-12T05:07:50Z")

</div>

@kiwigrass thx a lot i will read thru this 100 times to see if i will learn something 😃 i am really bad with code and have always wanted to understand at least basics..
