# Possible bug with generic input patch node + pulse inputs

**URL:** <https://forum.xod.io/t/possible-bug-with-generic-input-patch-node-pulse-inputs/1415>\
**Category:** Uncategorized\
**Created:** [November 24, 2018, 8:04am UTC](https://forum.xod.io/t/possible-bug-with-generic-input-patch-node-pulse-inputs/1415 "2018-11-24T08:04:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitrex](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@bitrex](https://forum.xod.io/u/bitrex)\
**Post date:** [November 24, 2018, 8:04am UTC](https://forum.xod.io/t/possible-bug-with-generic-input-patch-node-pulse-inputs/1415/1 "2018-11-24T08:04:13Z")

</div>

Trying to have a lil experiment with writing a circular buffer patch node. Unfortunately I’ve been stymied by what seems like a bug, consider the following setup:

 ![Screenshot_2018-11-23_23-29-35](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/ecbb2fe51ead048981a18e0da74c7b262aca8ba9.png)

Just reading bytes from the serial port into a buffer and then spitting them out is the intent. At the moment for clarity and to isolate my issue “circular-buffer” is just a stem that looks like this:

```auto
struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
  typedef ValueType<input_IN>::T input_type_t;
  State* state = getState(ctx);

  if (getValue<input_READ>(ctx)) {
   Serial.println(getValue<input_READ>(ctx));
  }
}

```

Even though input\_READ is set to “Never” in the editor the “if” block always executes for me. XOD 0.25.2, the .deb package installed on Xubuntu Linux 17.10.

[GenericPatchBug.xodball](https://forum.xod.io/uploads/xod/original/1X/578afb752d6c83a6d29b6ef744cd966ae70d3014.xodball) (12.1 KB)

---

<div class="post-metadata">

**Author:** ![bitrex](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@bitrex](https://forum.xod.io/u/bitrex)\
**Post date:** [November 24, 2018, 8:07am UTC](https://forum.xod.io/t/possible-bug-with-generic-input-patch-node-pulse-inputs/1415/2 "2018-11-24T08:07:56Z")

</div>

Whoops! Disregard this post, I’ve done something dumb I just realized. That’s a pulse input I should be using “isInputDirty” not “getValue.” Brain fart, not sure why I didn’t notice that I’m using the wrong call. I’ll flag for deletion 🙂

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [November 26, 2018, 2:58pm UTC](https://forum.xod.io/t/possible-bug-with-generic-input-patch-node-pulse-inputs/1415/3 "2018-11-26T14:58:09Z")

</div>

Hello. Yep, this is confusing. Thanks for pointing!

I created an [issue](https://github.com/xodio/xod/issues/1572) to deal with it.
