<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>I working with CoreMIDI in ccl.(1.10-dev-r15972M-trunk (DarwinX8664))</div><div><br></div><div>in CoreMIDI have type "structure MIDIPacket"</div><div><pre class="declaration" style="margin-top: 0px; margin-right: 0.333em; margin-left: 0.5em; font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); background-color: rgb(255, 255, 255);">typedef UInt64 MIDITimeStamp;</pre></div><div><pre class="declaration" style="margin-top: 0px; margin-right: 0.333em; margin-left: 0.5em; font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); background-color: rgb(255, 255, 255); position: static; z-index: auto;">struct MIDIPacket {
MIDITimeStamp timeStamp;
UInt16 length;
Byte data[256];
};</pre></div><div><br></div><div>so I wrapper it…</div><div><br></div><div><div>(ccl:def-foreign-type :midipacket</div><div> (:struct :midipacket </div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (time-stamp :unsigned-doubleword)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (length :unsigned-short)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (data (:array :unsigned-char 256))))</div></div><div><br></div><div> in C… printf(“size: %d\n”, sizeof(struct MIDIPacket)) is 268,</div><div>but (/ (ccl::foreign-size :midipacket) 8) is 272.</div><div><br></div><div>This type used by this callback function for MidiEvent..</div><div><div>(ccl:defcallback midi-read-proc (:address packet-list</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> :address read-proc-ref-con</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> :address src-conn-ref-con</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> :void)</div><div> (let ((pkt (ccl:pref packet-list :midi-packet-list.packet)))</div><div> (format t "midipkt's length: ~a~%" (ccl:pref pkt :midi-packet.length))))</div></div><div><br></div><div>but it does not work correctly… It seems wrong read bytes……</div><div><br></div><div>so I changed it...</div><div><br></div><div><div>(ccl:def-foreign-type :midi-packet</div><div> (:struct :midi-packet</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (time-stamp :unsigned-int)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (time-stamp2 :unsigned-int)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (length :unsigned-short)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> (data (:array :unsigned-char 256))))</div></div><div><br></div><div>then..(/ (ccl::foreign-size :midi-packet) 8) is 268, and callback is work correctly!</div><div><br></div><div><br></div><div>I was search google, so look it <a href="http://clozure.com/pipermail/openmcl-devel/2002-September/004407.html">http://clozure.com/pipermail/openmcl-devel/2002-September/004407.html</a></div><div>This article is related to my problem?? or just bug??</div><div><br></div><div>sorry. my ugly English……but I wish you understand me…:-<</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></body></html>