i'll paste the flow below... you'll see the function node i made which converts milliseconds to tempo value is pretty poor.. im not a coder just somebody who scrapes through..
im looking at the context data tab and refreshing it to see what got stored in tempo.flow, im not using a debug node for that.. hopefully this pastes ok..
[
{
"id": "e4753500b15548c2",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "05b9acc0dd978661",
"type": "inject",
"z": "e4753500b15548c2",
"name": "Tap Tempo",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 260,
"y": 180,
"wires": [
[
"36450e7311faa1ce"
]
]
},
{
"id": "36450e7311faa1ce",
"type": "interval-length",
"z": "e4753500b15548c2",
"format": "mills",
"bytopic": false,
"minimum": "",
"maximum": "",
"window": "",
"timeout": false,
"msgTimeout": "2",
"minimumunit": "msecs",
"maximumunit": "msecs",
"windowunit": "msecs",
"msgTimeoutUnit": "secs",
"reset": true,
"startup": false,
"msgField": "interval",
"timestampField": "timestamp",
"repeatTimeout": false,
"name": "",
"x": 520,
"y": 160,
"wires": [
[
"faf41facc0237798"
],
[
"1369bdaf58d57c3d"
]
]
},
{
"id": "1369bdaf58d57c3d",
"type": "change",
"z": "e4753500b15548c2",
"name": "",
"rules": [
{
"t": "set",
"p": "reset",
"pt": "msg",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 520,
"y": 240,
"wires": [
[
"36450e7311faa1ce"
]
]
},
{
"id": "faf41facc0237798",
"type": "function",
"z": "e4753500b15548c2",
"name": "Convert to Tempo",
"func": "\nlet interval = msg.interval\nlet count = 0\nlet tempo = 0\n\n\ncount = 1-(interval / 1000);\ntempo = count*4*60;\n\n\nmsg.payload = tempo;\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 160,
"wires": [
[
"b90ea8aa7e498f13"
]
]
},
{
"id": "b90ea8aa7e498f13",
"type": "smooth",
"z": "e4753500b15548c2",
"name": "",
"property": "payload",
"action": "mean",
"count": "3",
"round": "0",
"mult": "single",
"reduce": false,
"x": 960,
"y": 160,
"wires": [
[
"825f905dfd692977",
"14c74b69c4a5f12f"
]
]
},
{
"id": "825f905dfd692977",
"type": "change",
"z": "e4753500b15548c2",
"name": "",
"rules": [
{
"t": "set",
"p": "tempo",
"pt": "flow",
"to": "{\"inputName\":\"Text\",\"inputSettings\":{\"text\":\"{{msg.payload}}\"}}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1160,
"y": 160,
"wires": [
[]
]
},
{
"id": "14c74b69c4a5f12f",
"type": "debug",
"z": "e4753500b15548c2",
"name": "debug 48",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1180,
"y": 220,
"wires": []
}
]