Вверх ↑
Ответов: 899
Рейтинг: 43
#1: 2007-05-23 19:11:20 ЛС | профиль | цитата
почему при нажатии на черные клавиши(VisualShape) событие выдает одна из белых? Как это можно исправить
Add(MainForm,1097409,454,364)
{
Left=20
Top=105
Width=580
Height=395
link(onCreate,10638232:doInit,[(508,405)(508,433)])
}
Add(InlineCode,10638232,531,427)
{
@Hint=#8:MIDI OUT|
WorkPoints=#6:doInit|7:doSound|
EventPoints=#7:onSound|5:onErr|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|38:uses kol,Share,Debug,Windows,mmsystem;|0:|4:type|28: THiAsmClass = class(TDebug)|0:|10: private|0:|12: protected|0:|9: public|23: onSound:THI_Event;|21: onErr:THI_Event;|26: _data_Data:THI_Event;|0:|50: procedure doSound(var _Data:TData; Index:word);|49: procedure doInit(var _Data:TData; Index:word);|0:|0:|5: end;|0:|14:implementation|19: var hmo:hmidiout;|60: procedure THiAsmClass.doInit(var _Data:TData; Index:word);|19: var err:integer;|8: begin|59: err := midiOutOpen(@hmo,midi_mapper,0,0,callback_null);|64: if err = MMSYSERR_NOERROR then _hi_OnEvent(onErr,'MIDI OUT')|41: else _hi_OnEvent(onErr,'MIDI ERROR');|7: end;|61: procedure THiAsmClass.doSound(var _Data:TData; Index:word);|17: var i:integer;|19: kod:integer;|8: begin|28: kod := ToInteger(_Data);|29: midioutshortmsg(hmo,kod);|112: //midioutshortmsg(hmo,$000011c0);//назначить каналу инструмент(Cn): 29-вроде как струнные, n - номер канала|121: //midiOutShortMsg(hmo,$003f3d90);// включить ноту(9n) :n- номер канала, 3d - номер ноты 3f - скорость нажатия клавиши|17: //sleep(300);|120: //midiOutShortMsg(hmo,$003f3d80);//выключить ноту(8n):n- номер канала, 3d - номер ноты 3f - скорость нажатия клавиши|0:|29: _hi_OnEvent(onSound,kod);|7: end;|0:|4:end.|
link(onSound,14093082:doEvent1,[])
link(onErr,14093082:doEvent2,[])
}
Add(Label,13435402,146,126)
{
Left=45
Top=15
Width=134
Height=27
Font=[Courier New,16,1,0,204]
Caption="Инструмент"
}
Add(Memory,14471918,258,126)
{
}
Add(ChanelToIndex,6256554,-36,308)
{
Count=12
link(onIndex,12069974:doOperation,[])
}
Add(StrCat,5933356,258,308)
{
link(onStrCat,261095:doEvent1,[(351,314)(351,440)])
link(Str1,14471918:Value,[(264,299)(264,299)])
link(Str2,13641412:Text,[(271,286)(208,286)])
}
Add(ListBox,8317388,636,427)
{
Left=330
Top=140
Width=235
Height=215
TabOrder=5
}
Add(Convertor,11836004,454,434)
{
Mode=5
Digits=8
link(onResult,10638232:doSound,[])
}
Add(Convertor,16725640,209,126)
{
Mode=6
Digits=1
link(onResult,14471918:doValue,[])
}
Add(Hub,13885270,146,77)
{
link(onEvent1,13258399:doRead,[])
link(onEvent2,16725640:doConvert,[(190,90)(190,132)])
}
Add(Hub,14093082,580,427)
{
InCount=2
OutCount=1
link(onEvent1,8317388:doAdd,[])
}
Add(Edit,14211843,307,336)
{
Left=460
Top=50
Width=60
Height=30
TabOrder=4
Font=[Courier New,16,1,0,204]
Text="3f"
}
Add(VisualShape,3859039,-225,210)
{
@Hint=#2:F#|
Left=175
Top=140
Width=30
Height=130
Color2=0
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork7,[(-76,216)(-76,356)])
link(onMouseUp,4300941:doWork7,[(-140,223)(-140,447)])
}
Add(Convertor,3985743,55,399)
{
Mode=6
link(onResult,4217572:doValue,[])
}
Add(Memory,4217572,104,399)
{
link(onData,7788634:doStrCat,[(151,405)(151,510)])
}
Add(GetData,10790850,307,392)
{
link(Data,14211843:Text,[])
}
Add(Label,7530642,258,357)
{
Left=360
Top=55
Width=92
Height=26
Font=[Courier New,14,1,0,204]
Caption="Скорость"
}
Add(Hub,11315478,153,308)
{
OutCount=3
link(onEvent1,5933356:doStrCat,[(218,314)(218,314)])
link(onEvent2,15916298:doStrCat,[(193,321)(193,447)])
}
Add(StrCat,15916298,209,441)
{
link(onStrCat,6361820:doStrCat,[])
link(Str1,10790850:Data1,[(215,429)(313,429)])
link(Str2,12250172:Value,[(222,391)(110,391)])
}
Add(Memory,12250172,104,308)
{
link(onData,11315478:doEvent1,[])
}
Add(Math,2647514,6,399)
{
Op2=60
ResultType=0
link(onResult,3985743:doConvert,[])
}
Add(StrCat,7788634,314,504)
{
link(onStrCat,16258123:doStrCat,[])
link(Str1,10790850:Data2,[])
link(Str2,4217572:Value,[(327,492)(110,492)])
}
Add(StrCat,6361820,258,441)
{
Str2="90"
link(onStrCat,261095:doEvent2,[])
}
Add(StrCat,16258123,363,504)
{
Str2="80"
link(onStrCat,261095:doEvent3,[(403,510)(403,454)])
}
Add(Hub,261095,412,434)
{
InCount=3
OutCount=1
link(onEvent1,11836004:doConvert,[])
}
Add(UpDown,14699841,90,77)
{
Left=525
Top=10
Width=40
Height=30
TabOrder=2
Max=128
Kind=0
link(onPosition,13885270:doEvent1,[])
}
Add(ArrayRW,13258399,209,77)
{
link(onRead,11272637:doText,[])
link(Array,6454927:Array,[])
}
Add(Edit,11272637,258,77)
{
Left=185
Top=10
Width=335
Height=30
TabOrder=1
Font=[Courier New,16,1,0,204]
Text="Acoustic Grand Piano"
ReadOnly=0
}
Add(StrList,6454927,195,7)
{
Strings=#20:Acoustic Grand Piano|21:Bright Acoustic Piano|20:Electric Grand Piano|16:Honky-tonk Piano|16:Electric Piano 1|16:Electric Piano 2|11:Harpsichord|5:Clavi|7:Celesta|12:Glockenspiel|9:Music Box|10:Vibraphone|7:Marimba|9:Xylophone|13:Tubular Bells|8:Dulcimer|13:Drawbar Organ|16:Percussive Organ|10:Rock Organ|12:Church Organ|10:Reed Organ|9:Accordion|9:Harmonica|15:Tango Accordion|23:Acoustic Guitar (nylon)|23:Acoustic Guitar (steel)|22:Electric Guitar (jazz)|23:Electric Guitar (clean)|23:Electric Guitar (muted)|17:Overdriven Guitar|17:Distortion Guitar|16:Guitar harmonics|13:Acoustic Bass|22:Electric Bass (finger)|20:Electric Bass (pick)|13:Fretless Bass|11:Slap Bass 1|11:Slap Bass 2|12:Synth Bass 1|12:Synth Bass 2|6:Violin|5:Viola|5:Cello|10:Contrabass|15:Tremolo Strings|17:Pizzicato Strings|15:Orchestral Harp|7:Timpani|17:String Ensemble 1|17:String Ensemble 2|14:SynthStrings 1|14:SynthStrings 2|10:Choir Aahs|10:Voice Oohs|11:Synth Voice|13:Orchestra Hit|7:Trumpet|8:Trombone|4:Tuba|13:Muted Trumpet|11:French Horn|13:Brass Section|12:SynthBrass 1|12:SynthBrass 2|11:Soprano Sax|8:Alto Sax|9:Tenor Sax|12:Baritone Sax|4:Oboe|12:English Horn|7:Bassoon|8:Clarinet|7:Piccolo|5:Flute|8:Recorder|9:Pan Flute|12:Blown Bottle|10:Shakuhachi|7:Whistle|7:Ocarina|15:Lead 1 (square)|17:Lead 2 (sawtooth)|17:Lead 3 (calliope)|14:Lead 4 (chiff)|16:Lead 5 (charang)|14:Lead 6 (voice)|15:Lead 7 (fifths)|20:Lead 8 (bass + lead)|15:Pad 1 (new age)|12:Pad 2 (warm)|17:Pad 3 (polysynth)|13:Pad 4 (choir)|13:Pad 5 (bowed)|16:Pad 6 (metallic)|12:Pad 7 (halo)|13:Pad 8 (sweep)|11:FX 1 (rain)|17:FX 2 (soundtrack)|14:FX 3 (crystal)|17:FX 4 (atmosphere)|17:FX 5 (brightness)|14:FX 6 (goblins)|13:FX 7 (echoes)|13:FX 8 (sci-fi)|5:Sitar|5:Banjo|8:Shamisen|4:Koto|7:Kalimba|8:Bag pipe|6:Fiddle|6:Shanai|11:Tinkle Bell|5:Agogo|11:Steel Drums|9:Woodblock|10:Taiko Drum|11:Melodic Tom|10:Synth Drum|14:Reverse Cymbal|17:Guitar Fret Noise|12:Breath Noise|8:Seashore|10:Bird Tweet|14:Telephone Ring|10:Helicopter|8:Applause|7:Gunshot|
}
Add(Edit,13641412,202,231)
{
Left=185
Top=55
Width=70
Height=30
TabOrder=3
Font=[Courier New,14,1,0,204]
Text="C0"
ReadOnly=0
}
Add(VisualShape,11039649,-225,385)
{
@Hint=#1:H|
Left=280
Top=140
Width=45
Height=215
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork12,[])
link(onMouseUp,4300941:doWork12,[(-165,398)(-165,482)])
}
Add(VisualShape,14091497,-225,315)
{
@Hint=#1:A|
Left=235
Top=140
Width=45
Height=215
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork10,[(-91,321)(-91,377)])
link(onMouseUp,4300941:doWork10,[(-155,328)(-155,468)])
}
Add(VisualShape,3489361,-225,245)
{
@Hint=#1:G|
Left=190
Top=140
Width=45
Height=215
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork8,[(-81,251)(-81,363)])
link(onMouseUp,4300941:doWork8,[(-145,258)(-145,454)])
}
Add(VisualShape,16444157,-225,175)
{
@Hint=#1:F|
Left=145
Top=140
Width=45
Height=215
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork6,[(-71,181)(-71,349)])
link(onMouseUp,4300941:doWork6,[(-135,188)(-135,440)])
}
Add(VisualShape,6354125,-225,140)
{
@Hint=#1:E|
Left=100
Top=140
Width=45
Height=215
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork5,[(-66,146)(-66,342)])
link(onMouseUp,4300941:doWork5,[(-130,153)(-130,433)])
}
Add(VisualShape,11042299,-225,70)
{
@Hint=#1:D|
Left=55
Top=140
Width=45
Height=215
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork3,[(-56,76)(-56,328)])
link(onMouseUp,4300941:doWork3,[(-120,83)(-120,419)])
}
Add(ChanelToIndex,4300941,-36,399)
{
Count=12
link(onIndex,2647514:doOperation,[])
}
Add(Math,12069974,6,308)
{
Op2=60
ResultType=0
link(onResult,6720370:doConvert,[])
}
Add(Convertor,6720370,55,308)
{
Mode=6
link(onResult,12250172:doValue,[])
}
Add(VisualShape,16478488,-225,0)
{
@Hint=#1:C|
Left=10
Top=140
Width=45
Height=215
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork1,[(-46,6)(-46,314)])
link(onMouseUp,4300941:doWork1,[(-110,13)(-110,405)])
}
Add(VisualShape,7150136,-225,35)
{
@Hint=#2:C#|
Left=40
Top=140
Width=30
Height=130
Color2=0
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork2,[(-51,41)(-51,321)])
link(onMouseUp,4300941:doWork2,[(-115,48)(-115,412)])
}
Add(VisualShape,4420112,-225,105)
{
@Hint=#2:D#|
Left=85
Top=140
Width=30
Height=130
Color2=0
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork4,[(-61,111)(-61,335)])
link(onMouseUp,4300941:doWork4,[(-125,118)(-125,426)])
}
Add(VisualShape,5036879,-225,350)
{
@Hint=#1:B|
Left=265
Top=140
Width=30
Height=130
Color2=0
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork11,[(-96,356)(-96,384)])
link(onMouseUp,4300941:doWork11,[(-160,363)(-160,475)])
}
Add(VisualShape,13958299,-225,280)
{
@Hint=#2:G#|
Left=220
Top=140
Width=30
Height=130
Color2=0
Point(onMouseDown)
Point(onMouseUp)
link(onMouseDown,6256554:doWork9,[(-86,286)(-86,370)])
link(onMouseUp,4300941:doWork9,[(-150,293)(-150,461)])
}
Add(Label,6256882,13,112)
{
Left=115
Top=60
Width=59
Height=26
Font=[Courier New,14,1,0,204]
Caption="Канал"
}
карма: 0
Время верстки: %cr_time% Текущее время: %time%
0