Vuo  2.0.0
VuoMidiPitchBend.c
Go to the documentation of this file.
1 
10 #include "type.h"
11 #include "VuoMidiPitchBend.h"
12 
14 #ifdef VUO_COMPILER
16  "title" : "MIDI Pitch Bend",
17  "description" : "A pitch bend event sent via MIDI.",
18  "keywords" : [ ],
19  "version" : "1.0.0",
20  "dependencies" : [
21  "VuoInteger",
22  "VuoText"
23  ]
24  });
25 #endif
26 
39 {
40  return (VuoMidiPitchBend){
41  VuoJson_getObjectValue(VuoInteger, js, "channel", 1),
42  VuoJson_getObjectValue(VuoInteger, js, "value", 8192),
43  ""};
44 }
45 
50 {
51  json_object *js = json_object_new_object();
52 
53  json_object *channelObject = VuoInteger_getJson(value.channel);
54  json_object_object_add(js, "channel", channelObject);
55 
56  json_object *valueObject = VuoInteger_getJson(value.value);
57  json_object_object_add(js, "value", valueObject);
58 
59  return js;
60 }
61 
66 {
67  return valueA.channel == valueB.channel
68  && valueA.value == valueB.value;
69 }
70 
75 {
76  return (VuoInteger)(valueA.channel << 14) + valueA.value < (VuoInteger)(valueB.channel << 14) + valueB.value;
77 }
78 
83 {
84  return VuoText_format("Channel %d: value %d",
85  value.channel, value.value);
86 }
87 
92 {
93  return (VuoMidiPitchBend){channel, value, ""};
94 }
95