Discussion:
MIDIのSysExが途中で切れてしまう
(too old to reply)
Ogasawara
2006-11-07 03:57:40 UTC
Permalink
VC++6.0$B$r;H$C$F!"(BMIDI$B$N(BSysEx$B$r<u?.$9$k%3!<%I$rAH$s$G$$$^$9!#(B
20Byte$B$N(BSysEx$B$rN.$79~$s$G$_$?$N$G$9$,!"<B:]$K<u$1<h$k%G!<%?$,(B
6$B!A(B11Byte$B$***@Z$l$F$7$^$$!":$$C$F$*$j$^$9!#(B
$B%P%C%U%!$O%X%C%@$G(B

char bMidiSysBuffer[1024];

$B$***@k8@$7!"%@%$%"%m%0$G(B

ret = midiInOpen(&hMidiIn, MInDevNo, (DWORD)PrcMidiIn, (DWORD)this,
CALLBACK_FUNCTION);
hMidiHdr.lpData = &bMidiSysBuffer[0];
hMidiHdr.dwBufferLength = sizeof(bMidiSysBuffer);
hMidiHdr.dwFlags = 0;
ret = midiInPrepareHeader(hMidiIn, &hMidiHdr, sizeof(hMidiHdr));
ret = midiInAddBuffer(hMidiIn, &hMidiHdr, sizeof(hMidiHdr));
midiInStart(hMidiIn);

$B$3$N$h$&$K(BMIDI$B%G%P%$%9$r<u?.>uBV$K$7$F$*$j$^$9!#(B
$B$3$l$G!"3d$j9~$_;~$K!"(BMIM_LONGDATA$B$,Ht$s$G$-$?;~$N(B
dwBytesRecorded $B$r8+$k$H!"<B:]$KN.$79~$s$@D9$5$h$jC;$/!"(B
$BCf?H$r8+$F$bESCf$***@Z$l$F$$$k;v$,2r$j$^$9!#(B

$B$3$l$r!"ESCf$***@Z$l$k;vL5$/!":G8e$^$G<u?.$5$;$k$K$O(B
$B$I$N$h$&$KBP=h$7$?$i$h$$$+!"$465<x59$7$/$*4j$$$$$?$7$^$9!#(B
Takeshi SHIGIHARA
2006-11-07 13:26:34 UTC
Permalink
Post by Ogasawara
VC++6.0$B$r;H$C$F!"(BMIDI$B$N(BSysEx$B$r<u?.$9$k%3!<%I$rAH$s$G$$$^$9!#(B
20Byte$B$N(BSysEx$B$rN.$79~$s$G$_$?$N$G$9$,!"<B:]$K<u$1<h$k%G!<%?$,(B
midiOut$B$N$[$&$O$1$C$3$&;H$$$^$7$?$,!"(BmidiIn$B$N$[$&$O$d$C$?$3$H$J$$(B
$B$N$G!"?dB,$K2a$.$^$;$s$3$H$***@h$K?=$7=R$Y$F$*$-$^$9!#(B

MIM_LONGDATA $B$***@bL@(B
http://windowssdk.msdn.microsoft.com/en-us/library/ms712079.aspx
$B$K$h$j$^$9$H!"(BRemarks$B$N9`$K(B
The returned buffer might not be full.
$B$H$"$j$^$9$N$G!"$b$7$+$7$?$i(BSysEx$B$,0l5$$KA4It$,JV$C$F$/$k$H$O(B
$B8B$i$J$$$N$+$bCN$l$^$;$s!#(B
SysEx$B$O(BF0$B!A(BF7$B$G0O$^$l$F$$$?$H5-21$7$F$$$^$9$+$i!"$=$l$,8!CN$5$l(B
$B$k$^$G!"(BMIM_LONGDATA$B$rJ#?t2s<u$1IU$1$k$3$H$K$J$k$N$G$O$J$$$+$H(B
$BA[A|$7$^$9!#(B
MIDI$B%G!<%?$r<u$1IU$1$kItJ,$O8-$$$N$G!"%7%g!<%H%G!<%?$H(BSysEx$B$r(B
$BH=CG$7$FAw$C$F$/$l$k$N$G$9$,!"(BSysEx$B$O$I$l$@$1D9$$$+J,$+$i$J$$(B
$B$N$G!"%P%U%!$,==J,Bg$-$+$m$&$H$b!"$A$g$C$H$G$b%G!<%?$,N.$l9~$s$@(B
$B;~E@$G$9$0$K%W%m%0%i%`$KDLCN$7$F$7$^$&;EAH$_$J$N$+$bCN$l$^$;$s!#(B

$B!v$J$s$H$J$/(BRS-232C$B$d(BTCP$B$G$N(B"$B%G!<%?$N$+$?$^$j(B"$B$r;W$$=P$7$^$7$?!#(B
--
----- Takeshi SHIGIHARA
***@tka.att.ne.jp
***@po.jah.ne.jp -----
$B%V%?$bEj$2$l$P6u$rHt$V(B--RFC1925.
Ogasawara
2006-11-08 01:06:12 UTC
Permalink
$B$4JVEzM-Fq$&$4$6$$$^$9!#(B
Post by Takeshi SHIGIHARA
http://windowssdk.msdn.microsoft.com/en-us/library/ms712079.aspx
$B$K$h$j$^$9$H!"(BRemarks$B$N9`$K(B
The returned buffer might not be full.
$B$H$"$j$^$9$N$G!"$b$7$+$7$?$i(BSysEx$B$,0l5$$KA4It$,JV$C$F$/$k$H$O(B
$B8B$i$J$$$N$+$bCN$l$^$;$s!#(B
SysEx$B$O(BF0$B!A(BF7$B$G0O$^$l$F$$$?$H5-21$7$F$$$^$9$+$i!"$=$l$,8!CN$5$l(B
$B$k$^$G!"(BMIM_LONGDATA$B$rJ#?t2s<u$1IU$1$k$3$H$K$J$k$N$G$O$J$$$+$H(B
$BA[A|$7$^$9!#(B
$B;d$b$=$&$$$&2r<a$G!"%W%m%7!<%8%c$G$O(BwMsg$B$r0lDL$j%A%'%C%/F~$l$F$$$^$9!#(B
$B$=$N8e!"(BmidiInOpen$B$N(BdwFlag$B$r(BCALLBACK_FUNCTION | MIDI_IO_STATUS$B$H$9$k$H(B
MIM_MOREDATA$B$,Ht$s$G$/$k$h$&$J;v$,=q$+$l$F$$$k$K$N5$IU$-;n$7$F$_$^$7$?$,!"(B
$B$d$C$Q$j2?$bHt$s$G$-$^$;$s!#(B

$B8e!"(BMIM_LONGDATA$B$N=hM};~!"(BMIDIHDR$B$N(BdwBytesRecorded$B$,(B0$B$G$J$$>l9g$K!"(B
midiInAddBuffer$B$G%P%C%U%!$r:F%;%C%H$7$F!":F$S(BMIM_LONGDATA$B$r<u$1<h$l$k(B
$B>uBV$K$7$F$*$j$^$9!#(B
$B$3$l$r;_$a$F;n$7$F$_$^$7$?$,!"$d$C$Q$jB3$-$OHt$s$G$3$J$$=j$+!"(B
$B<!$N(B($BJL$N(B)MIM_LONGDATA$B$9$iHt$s$G$3$J$$>uBV$K$J$C$F$7$^$$$^$9!#(B
$B99$K%F%9%HMQ%\%?%s$rDI2C$7$F!"(BMIDIHDR$B$N(BdwBytesRecorded$B$H(BdwFlag$B$r(B
MessageBox$B$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