# Set message value without sending midi

**URL:** <https://forum.electra.one/t/set-message-value-without-sending-midi/3595>\
**Category:** Developers\
**Created:** [March 10, 2025, 8:37pm UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595 "2025-03-10T20:37:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![misal](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@misal](https://forum.electra.one/u/misal)\
**Post date:** [March 10, 2025, 8:37pm UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/1 "2025-03-10T20:37:30Z")

</div>

Is it possible to prevent a midi message being sent when the value of a message is changed with a function call `<message>:setValue(newValue)`?  
What i want to achieve is updating the value of the pots by incoming sysex messages from a DAW. But the pots shouldn’t fire a cc message in response, because this will lead to a midi loop with the DAW sending the sysex messages and ultimately lead to a crash of the DAW. The pots should only emit midi messages when they are turned on the E1 controller.

---

<div class="post-metadata">

**Author:** ![christianvogel](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@christianvogel](https://forum.electra.one/u/christianvogel)\
**Post date:** [March 11, 2025, 12:20am UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/2 "2025-03-11T00:20:02Z")

</div>

Maybe not the most elegant solution, but you could set the pot to type `virtual` and write a custom handler for the pots, that checks if a message was being sent before processing the value.

---

<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:** [March 11, 2025, 7:05am UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/3 "2025-03-11T07:05:46Z")

</div>

A very handy callback is parameterMap.onChange.  
The first line in the function is enough to reach what you want.

```auto
function parameterMap.onChange(valueObjects, origin, value)
  if origin == MIDI then return end
    for i, valueObject in ipairs(valueObjects) do -- -- onChange manually or via LUA
    local parameterNumber = valueObject:getMessage ():getParameterNumber ()
    local parameterType = valueObject:getMessage ():getType ()
    if parameterType ~= PT_VIRTUAL then return end
    -- from now on only virtual parameters, manually changed
   .....

```

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [March 11, 2025, 7:12am UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/4 "2025-03-11T07:12:27Z")

</div>

The 4.0 has a Lua function (a method of the parameterMap) that allows setting the value without triggering all associated actions (sending a message, triggering callbacks, etc). I will provide all necessary info when the beta firmware is okayed by the community.

---

<div class="post-metadata">

**Author:** ![rvh](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@rvh](https://forum.electra.one/u/rvh)\
**Post date:** [November 22, 2025, 2:28am UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/5 "2025-11-22T02:28:43Z")

</div>

Can you please describe the function you’re referring to, i.e. how to change the displayed control value to match a received value (eg in a sysEx message) without sending MIDI back out?

The code shown by NewIgnis above prevents incoming MIDI from being sent back out, but doesn’t alter the displayed control value.

---

<div class="post-metadata">

**Author:** ![rvh](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@rvh](https://forum.electra.one/u/rvh)\
**Post date:** [November 22, 2025, 5:45am UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/6 "2025-11-22T05:45:32Z")

</div>

I think I have a solution by also excluding LUA (in addition to MIDI) from the origin based parameterMap.Onchange response as follows:

function parameterMap.onChange(valueObjects, origin, value)  
if origin == MIDI or origin == LUA then return end  
….

And in the sysex LUA response code using:

```auto
 local devID = controls.get(ctl):getValue():getMessage():getDeviceId()
 local paramType = controls.get(ctl):getValue():getMessage():getType()
 local param = controls.get(ctl):getValue():getMessage():getParameterNumber()
 parameterMap.set(devID , paramType, param, val);

```

Is that what you were referring to, or is there a simpler solution?

---

<div class="post-metadata">

**Author:** ![misal](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@misal](https://forum.electra.one/u/misal)\
**Post date:** [December 11, 2025, 8:15pm UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/8 "2025-12-11T20:15:38Z")

</div>

@martin Has this functionality been implemented yet? I couldn’t find anything in the docs.

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [December 12, 2025, 2:55pm UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/9 "2025-12-12T14:55:26Z")

</div>

as of v4.1.0 there is a function `parameterMap.updateValue()` that takes the same parameters as `parameterMap.set()`. That function updates the corresponding parameter in the parameterMap and does not trigger any MIDI messaging or Lua functions.

---

<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:** [March 21, 2026, 9:13am UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/10 "2026-03-21T09:13:43Z")

</div>

Martin, could you add all new parametermap functions to the lua extension section please?

---

<div class="post-metadata">

**Author:** ![Quelectra](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quelectra](https://forum.electra.one/u/Quelectra)\
**Post date:** [April 20, 2026, 7:39am UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/11 "2026-04-20T07:39:37Z")

</div>

Can we add this to the documentatation please?

---

<div class="post-metadata">

**Author:** ![davehouse](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@davehouse](https://forum.electra.one/u/davehouse)\
**Post date:** [June 13, 2026, 3:46pm UTC](https://forum.electra.one/t/set-message-value-without-sending-midi/3595/12 "2026-06-13T15:46:07Z")

</div>

any more on how to implement this? I have a few presets that would greatly benefit from having controls GUI values change based on various LUA stuff
