comparison scripts/hvresources/render.cpp @ 289:156e6955ccf6 prerelease

Updated heavy render to latest Heavy API
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 21 May 2016 15:20:06 +0100
parents c768ed1055b0
children 9a2a5f14b587
comparison
equal deleted inserted replaced
288:771a0920c626 289:156e6955ccf6
115 115
116 // replacement for bang~ object 116 // replacement for bang~ object
117 //hv_vscheduleMessageForReceiver(gHeavyContext, "bbb_bang", 0.0f, "b"); 117 //hv_vscheduleMessageForReceiver(gHeavyContext, "bbb_bang", 0.0f, "b");
118 { 118 {
119 int num; 119 int num;
120 unsigned int hvHashes[3];
121 hvHashes[0] = hv_stringToHash("bela_notein");
122 hvHashes[1] = hv_stringToHash("bela_ctlin");
123 hvHashes[2] = hv_stringToHash("bela_pgmin");
120 while((num = midi.getParser()->numAvailableMessages()) > 0){ 124 while((num = midi.getParser()->numAvailableMessages()) > 0){
121 static MidiChannelMessage message; 125 static MidiChannelMessage message;
122 message = midi.getParser()->getNextChannelMessage(); 126 message = midi.getParser()->getNextChannelMessage();
123 switch(message.getType()){ 127 switch(message.getType()){
124 case kmmNoteOn: { 128 case kmmNoteOn: {
125 // message.prettyPrint(); 129 // message.prettyPrint();
126 float noteNumber = message.getDataByte(0); 130 float noteNumber = message.getDataByte(0);
127 float velocity = message.getDataByte(1); 131 float velocity = message.getDataByte(1);
128 float channel = message.getChannel(); 132 float channel = message.getChannel();
129 // rt_printf("message: noteNumber: %f, velocity: %f, channel: %f\n", noteNumber, velocity, channel); 133 // rt_printf("message: noteNumber: %f, velocity: %f, channel: %f\n", noteNumber, velocity, channel);
130 hv_vscheduleMessageForReceiver(gHeavyContext, "bela_notein", 0, "fff", noteNumber, velocity, channel); 134 hv_vscheduleMessageForReceiver(gHeavyContext, hvHashes[0], 0, "fff", noteNumber, velocity, channel);
131 } 135 }
132 break; 136 break;
133 case kmmControlChange: { 137 case kmmControlChange: {
134 hv_vscheduleMessageForReceiver(gHeavyContext, "bela_ctlin", 0, "fff", 138 hv_vscheduleMessageForReceiver(gHeavyContext, hvHashes[1], 0, "fff",
135 (float)message.getDataByte(1), (float)message.getDataByte(0), (float)message.getChannel()); 139 (float)message.getDataByte(1), (float)message.getDataByte(0), (float)message.getChannel());
136 } 140 }
137 break; 141 break;
138 case kmmProgramChange: 142 case kmmProgramChange:
139 hv_vscheduleMessageForReceiver(gHeavyContext, "bela_pgmin", 0, "ff", 143 hv_vscheduleMessageForReceiver(gHeavyContext, hvHashes[2], 0, "ff",
140 (float)message.getDataByte(0), (float)message.getChannel()); 144 (float)message.getDataByte(0), (float)message.getChannel());
141 break; 145 break;
142 } 146 }
143 } 147 }
144 } 148 }