# Creating node with "node\_api.h"

**URL:** https://discourse.nodered.org/t/creating-node-with-node-api-h/77091
**Category:** Developing Nodes
**Created:** [30 March 2023 20:28 UTC](https://discourse.nodered.org/t/creating-node-with-node-api-h/77091 "2023-03-30T20:28:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![laetzsch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/laetzsch/32/78136_2.png) [@laetzsch](https://discourse.nodered.org/u/laetzsch)
#### Post date: [30 March 2023 20:28 UTC](https://discourse.nodered.org/t/creating-node-with-node-api-h/77091/1 "2023-03-30T20:28:28Z")

</div>

Hello,

this is my first post but I got many help and inspiration by reading this forum before. So I am hopefull to get the right hint here for my problem.

I am writing a custom node that receives messages whose payload containing MIDI data. The node has also a CC-part that includes "node\_api.h" and "jack.h" (from the Jack Audio Server API). The node registers as jack-client, so it is able to send the MIDI data to every other (writeable) jack-client. The node also triggers some special actions on special MIDI commands. This "downstream" part works quite well.

Now I want to enable the node also to send data that triggered by other jack-clients or the Jack Audio Server itself (for those who familar with jack something like Transport Start/Stop). I looked around all over the web but I can't find a way to do a real "upstream" with "node\_api.h". On my researches I found one way may be to emit an event in the CC-part and to use an eventhandler in the Javascript-part. But, how can I do this? There are many examples that gave an function into the CC-part that is executed there and filled with values from the CC-part. At least this is not what I need, as only the jack-client (= the CC-part) knows when to trigger the event within the Javascript-part (= Node-RED).

I am native german speaking, I hope my question is understandable. Any help is welcome, many thanks in advance!

Michael

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [29 May 2023 20:28 UTC](https://discourse.nodered.org/t/creating-node-with-node-api-h/77091/2 "2023-05-29T20:28:41Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
