From f5aff6c1125f37db3d040817a08501b5223a0e7a Mon Sep 17 00:00:00 2001 From: fredvs Date: Sat, 13 Nov 2021 05:45:51 +0100 Subject: [PATCH] Some cleanup in code. --- src/commander.pas | 463 +-- src/equalizer.pas | 120 +- src/filelistform.pas | 70 +- src/guitars.pas | 119 +- src/infos.pas | 2 +- src/main.pas | 93 +- src/randomnote.pas | 8702 +++++++++++++++++++++--------------------- src/recorder.pas | 243 +- src/songplayer.pas | 122 +- src/spectrum1.pas | 189 +- src/status.pas | 335 +- src/strumpract.pas | 190 +- src/strumpract.prj | 304 +- src/waveform.pas | 7 +- 14 files changed, 5478 insertions(+), 5481 deletions(-) diff --git a/src/commander.pas b/src/commander.pas index 5b450fa..c4b29c0 100644 --- a/src/commander.pas +++ b/src/commander.pas @@ -5,13 +5,47 @@ interface uses {$if (defined(linux)) and (not defined(cpuaarch64)) and (not defined(cpuarm))}alsa_mixer, - {$endif}{$if defined(windows)}win_mixer,{$ENDIF}msetypes,mseglob,mseguiglob, - mseguiintf,mseapplication,msestat,msemenus,Math,msegui,msetimer,msegraphics, - msegraphutils,mseevent,mseclasses,mseforms,msedock,msedragglob, - msesimplewidgets,msewidgets,mseact,msebitmap,msedataedits,msedatanodes,mseedit, - msefiledialogx,msegrids,mseificomp,mseificompglob,msefileutils,mseifiglob, - mselistbrowser,msestatfile,msestream,msestrings,msesys,SysUtils,msegraphedits, - msescrollbar,msedispwidgets,mserichstring,mseimage; + {$endif}{$if defined(windows)}win_mixer,{$ENDIF}msetypes, + mseglob, + mseguiglob, + mseguiintf, + mseapplication, + msestat, + msemenus, + Math, + msegui, + msetimer, + msegraphics, + msegraphutils, + mseevent, + mseclasses, + mseforms, + msedock, + msedragglob, + msesimplewidgets, + msewidgets, + mseact, + msebitmap, + msedataedits, + msedatanodes, + mseedit, + msefiledialogx, + msegrids, + mseificomp, + mseificompglob, + msefileutils, + mseifiglob, + mselistbrowser, + msestatfile, + msestream, + msestrings, + msesys, + SysUtils, + msegraphedits, + msescrollbar, + msedispwidgets, + mserichstring, + mseimage; type tcommanderfo = class(tdockform) @@ -94,21 +128,21 @@ tcommanderfo = class(tdockform) tfacegreen: tfacecomp; tfacegreendark: tfacecomp; ttimer1: ttimer; - nameplayers: tstringdisp; - nameplayers2: tstringdisp; - namegen: tstringdisp; - tfaceorange: tfacecomp; - sysvol: tslider; - sysvolbut: tbutton; - timercallback: ttimer; - Brandommix: tbutton; - randommix: tbooleanedit; - timagelist1: timagelist; - tframecomp2: tframecomp; - timagelist3: timagelist; - tfaceslidergold: tfacecomp; - tfacesliderred: tfacecomp; - tfaceslidergreen: tfacecomp; + nameplayers: tstringdisp; + nameplayers2: tstringdisp; + namegen: tstringdisp; + tfaceorange: tfacecomp; + sysvol: tslider; + sysvolbut: TButton; + timercallback: ttimer; + Brandommix: TButton; + randommix: tbooleanedit; + timagelist1: timagelist; + tframecomp2: tframecomp; + timagelist3: timagelist; + tfaceslidergold: tfacecomp; + tfacesliderred: tfacecomp; + tfaceslidergreen: tfacecomp; procedure formcreated(const Sender: TObject); procedure visiblechangeev(const Sender: TObject); procedure onplay(const Sender: TObject); @@ -139,10 +173,9 @@ tcommanderfo = class(tdockform) procedure onchangedirectmix(const Sender: TObject); procedure onexecbutlght(const Sender: TObject); procedure ontimerinit(const Sender: TObject); - procedure onsetsysvol(const sender: TObject; var avalue: realty; - var accept: Boolean); - procedure dotimercallback(const sender: TObject); - procedure onmouse(const sender: twidget; var ainfo: mouseeventinfoty); + procedure onsetsysvol(const Sender: TObject; var avalue: realty; var accept: Boolean); + procedure dotimercallback(const Sender: TObject); + procedure onmouse(const Sender: twidget; var ainfo: mouseeventinfoty); end; var @@ -151,10 +184,10 @@ tcommanderfo = class(tdockform) initvolleft1, initvolright1, initvolleft2, initvolright2: double; maxvolleft1, maxvolright1, maxvolleft2, maxvolright2: double; thetypemix: integer = 0; - docallback : boolean = false; + docallback: Boolean = False; theinput: integer = 30; lastrowplayed: integer = -1; - vuinvar: Boolean = True; + vuinvar: Boolean = True; implementation @@ -166,19 +199,20 @@ implementation config, recorder, dockpanel1, - main, ctypes, + main, + ctypes, commander_mfm; {$if defined(linux) or defined(windows)} procedure mixelemcallback; - begin - if docallback then - begin - if commanderfo.timercallback.Enabled then - commanderfo.timercallback.restart // to reset - else commanderfo.timercallback.Enabled := True; - end; - end; +begin + if docallback then + if commanderfo.timercallback.Enabled then + commanderfo.timercallback.restart // to reset + else + commanderfo.timercallback.Enabled := True; +end; + {$ENDIF} procedure tcommanderfo.formcreated(const Sender: TObject); @@ -205,21 +239,21 @@ procedure tcommanderfo.formcreated(const Sender: TObject); end; ttimer1.Enabled := True; - + {$if (defined(linux)) and (not defined(cpuaarch64)) and (not defined(cpuarm))} - sysvol.value := ALSAmixerGetVolume(0)/100; - sysvolbut.caption := msestring(inttostr(round(sysvol.value*10))); - ALSAmixerSetCallBack(@mixelemcallback); - docallback := true; + sysvol.Value := ALSAmixerGetVolume(0) / 100; + sysvolbut.Caption := msestring(IntToStr(round(sysvol.Value * 10))); + ALSAmixerSetCallBack(@mixelemcallback); + docallback := True; {$ENDIF} - + {$if defined(windows)} sysvol.value := WinmixerGetVolume(0)/100; sysvolbut.caption := msestring(inttostr(round(sysvol.value*10))); WinMixerSetCallBack(@mixelemcallback); // gives memory leak docallback := true; {$ENDIF} - end; +end; procedure tcommanderfo.ontimersent(const Sender: TObject); begin @@ -231,193 +265,190 @@ procedure tcommanderfo.onstartstop(const Sender: TObject); var fromplay, x: integer; fileex: msestring; - resu : shortint = -1; - + resu: shortint = -1; begin -fileex := fileext(PChar(ansistring(songplayerfo.historyfn.Value))); -if (lowercase(fileex) = 'wav') or (lowercase(fileex) = 'ogg') or - (lowercase(fileex) = 'flac') or (lowercase(fileex) = 'mp3') then - resu := 0 else ShowMessage(songplayerfo.historyfn.Value + ' is not audio file...'); + fileex := fileext(PChar(ansistring(songplayerfo.historyfn.Value))); + if (lowercase(fileex) = 'wav') or (lowercase(fileex) = 'ogg') or + (lowercase(fileex) = 'flac') or (lowercase(fileex) = 'mp3') then + resu := 0 + else + ShowMessage(songplayerfo.historyfn.Value + ' is not audio file...'); -if resu = 0 then -begin - if not fileexists(songplayerfo.historyfn.Value) then - begin - resu := -1; - ShowMessage(songplayerfo.historyfn.Value + ' does not exist...'); - end; -end; - -if resu = 0 then -begin -fileex := fileext(PChar(ansistring(songplayer2fo.historyfn.Value))); -if (lowercase(fileex) = 'wav') or (lowercase(fileex) = 'ogg') or - (lowercase(fileex) = 'flac') or (lowercase(fileex) = 'mp3') then - else + if resu = 0 then + if not fileexists(songplayerfo.historyfn.Value) then begin - resu := -1; - ShowMessage(songplayer2fo.historyfn.Value + ' is not audio file...'); - end; - -end; + resu := -1; + ShowMessage(songplayerfo.historyfn.Value + ' does not exist...'); + end; -if resu = 0 then -begin - if not fileexists(songplayer2fo.historyfn.Value) then - begin - resu := -1; - ShowMessage(songplayer2fo.historyfn.Value + ' does not exist...'); - end; -end; - -if resu = 0 then -begin - if directmix.Value then - totmixinterval := 1 - else - totmixinterval := round(timemix.Value / 10); + if resu = 0 then + begin + fileex := fileext(PChar(ansistring(songplayer2fo.historyfn.Value))); + if (lowercase(fileex) = 'wav') or (lowercase(fileex) = 'ogg') or + (lowercase(fileex) = 'flac') or (lowercase(fileex) = 'mp3') then + else + begin + resu := -1; + ShowMessage(songplayer2fo.historyfn.Value + ' is not audio file...'); + end; - incmixinterval := 0; + end; - if lastrowplayed >= filelistfo.list_files.rowcount then - lastrowplayed := 0; + if resu = 0 then + if not fileexists(songplayer2fo.historyfn.Value) then + begin + resu := -1; + ShowMessage(songplayer2fo.historyfn.Value + ' does not exist...'); + end; - if lastrowplayed = -1 then + if resu = 0 then begin - filelistfo.onsent(filelistfo.tbutton1); - lastrowplayed := filelistfo.list_files.focusedcell.row; - end; + if directmix.Value then + totmixinterval := 1 + else + totmixinterval := round(timemix.Value / 10); - filelistfo.list_files.rowcolorstate[lastrowplayed] := -1; + incmixinterval := 0; - lastrowplayed := filelistfo.list_files.focusedcell.row; + if lastrowplayed >= filelistfo.list_files.rowcount then + lastrowplayed := 0; - if lastrowplayed <> -1 then - if mainfo.typecolor.Value = 2 then + if lastrowplayed = -1 then begin - for x := 0 to filelistfo.list_files.rowcount - 1 do - filelistfo.list_files.rowfontstate[x] := 1; + filelistfo.onsent(filelistfo.tbutton1); + lastrowplayed := filelistfo.list_files.focusedcell.row; + end; - filelistfo.list_files.rowcolorstate[lastrowplayed] := 2; - filelistfo.list_files.rowfontstate[lastrowplayed] := 1; + filelistfo.list_files.rowcolorstate[lastrowplayed] := -1; - // filelistfo.list_files.datacols[3].colorselect := $707070; - // filelistfo.list_files.datacols[3].color := $707070; + lastrowplayed := filelistfo.list_files.focusedcell.row; - end - else - begin - for x := 0 to filelistfo.list_files.rowcount - 1 do - filelistfo.list_files.rowfontstate[x] := 0; - filelistfo.list_files.rowcolorstate[lastrowplayed] := 0; - filelistfo.list_files.rowfontstate[lastrowplayed] := 0; - end; + if lastrowplayed <> -1 then + if mainfo.typecolor.Value = 2 then + begin + for x := 0 to filelistfo.list_files.rowcount - 1 do + filelistfo.list_files.rowfontstate[x] := 1; - maxvolleft1 := 1; - maxvolright1 := 1; + filelistfo.list_files.rowcolorstate[lastrowplayed] := 2; + filelistfo.list_files.rowfontstate[lastrowplayed] := 1; - maxvolleft2 := 1; - maxvolright2 := 1; + // filelistfo.list_files.datacols[3].colorselect := $707070; + // filelistfo.list_files.datacols[3].color := $707070; - initvolleft1 := 0; - initvolright1 := 0; + end + else + begin + for x := 0 to filelistfo.list_files.rowcount - 1 do + filelistfo.list_files.rowfontstate[x] := 0; + filelistfo.list_files.rowcolorstate[lastrowplayed] := 0; + filelistfo.list_files.rowfontstate[lastrowplayed] := 0; + end; - initvolleft2 := 0; - initvolright2 := 0; + maxvolleft1 := 1; + maxvolright1 := 1; - if Sender <> nil then - begin - if (TButton(Sender).tag = 0) then - fromplay := 0 - else - fromplay := 1; - end - else if hasmixed1 = True then - fromplay := 1 - else - fromplay := 0; + maxvolleft2 := 1; + maxvolright2 := 1; - if fromplay = 0 then - begin - tbutton2.face.template := mainfo.tfacebutgray; - tbutton3.face.template := mainfo.tfaceorange2; - - filelistfo.tbutton2.face.template := mainfo.tfaceorange; - filelistfo.tbutton1.face.template := mainfo.tfaceplayer; + initvolleft1 := 0; + initvolright1 := 0; - //tbutton3.focused := true; + initvolleft2 := 0; + initvolright2 := 0; - thetypemix := 0; - volumeleft1.Value := 0; - volumeright1.Value := 0; - //volumeleft2.value := 1; - //volumeright2.value := 1; + if Sender <> nil then + begin + if (TButton(Sender).tag = 0) then + fromplay := 0 + else + fromplay := 1; + end + else if hasmixed1 = True then + fromplay := 1 + else + fromplay := 0; - if (Sender <> nil) and (commanderfo.automix.Value = True) and (filelistfo.list_files.rowcount > 0) then + if fromplay = 0 then begin - hasfocused2 := True; - filelistfo.onsent(nil); - hasfocused2 := False; - end; + tbutton2.face.template := mainfo.tfacebutgray; + tbutton3.face.template := mainfo.tfaceorange2; - if uos_GetStatus(theplayer) <> 1 then - if (iscue1 = True) or (uos_GetStatus(theplayer) = 2) then - songplayerfo.doplayeresume(Sender) - else - songplayerfo.doplayerstart(Sender); + filelistfo.tbutton2.face.template := mainfo.tfaceorange; + filelistfo.tbutton1.face.template := mainfo.tfaceplayer; - hasmixed2 := True; - timermix.Enabled := True; + //tbutton3.focused := true; - end - else - begin + thetypemix := 0; + volumeleft1.Value := 0; + volumeright1.Value := 0; + //volumeleft2.value := 1; + //volumeright2.value := 1; + + if (Sender <> nil) and (commanderfo.automix.Value = True) and (filelistfo.list_files.rowcount > 0) then + begin + hasfocused2 := True; + filelistfo.onsent(nil); + hasfocused2 := False; + end; + + if uos_GetStatus(theplayer) <> 1 then + if (iscue1 = True) or (uos_GetStatus(theplayer) = 2) then + songplayerfo.doplayeresume(Sender) + else + songplayerfo.doplayerstart(Sender); + + hasmixed2 := True; + timermix.Enabled := True; - thetypemix := 1; - volumeleft2.Value := 0; - volumeright2.Value := 0; - tbutton3.face.template := mainfo.tfacebutgray; - tbutton2.face.template := mainfo.tfaceorange2; - filelistfo.tbutton1.face.template := mainfo.tfaceorange; - filelistfo.tbutton2.face.template := mainfo.tfaceplayer; - //volumeleft2.value := 1; - //volumeright2.value := 1; - - if (Sender <> nil) and (automix.Value = True) and (filelistfo.list_files.rowcount > 0) then + end + else begin - hasfocused1 := True; - filelistfo.onsent(nil); - hasfocused1 := False; - end; - if uos_GetStatus(theplayer2) <> 1 then - if (iscue2 = True) or (uos_GetStatus(theplayer2) = 2) then - songplayer2fo.doplayeresume(Sender) - else - songplayer2fo.doplayerstart(Sender); + thetypemix := 1; + volumeleft2.Value := 0; + volumeright2.Value := 0; + tbutton3.face.template := mainfo.tfacebutgray; + tbutton2.face.template := mainfo.tfaceorange2; + filelistfo.tbutton1.face.template := mainfo.tfaceorange; + filelistfo.tbutton2.face.template := mainfo.tfaceplayer; + //volumeleft2.value := 1; + //volumeright2.value := 1; + + if (Sender <> nil) and (automix.Value = True) and (filelistfo.list_files.rowcount > 0) then + begin + hasfocused1 := True; + filelistfo.onsent(nil); + hasfocused1 := False; + end; - hasmixed1 := True; - timermix.Enabled := True; - // filelistfo.list_files.rowcolorstate[4]:= 0; + if uos_GetStatus(theplayer2) <> 1 then + if (iscue2 = True) or (uos_GetStatus(theplayer2) = 2) then + songplayer2fo.doplayeresume(Sender) + else + songplayer2fo.doplayerstart(Sender); - end; + hasmixed1 := True; + timermix.Enabled := True; + // filelistfo.list_files.rowcolorstate[4]:= 0; - //tbutton2.width := 26; - //tbutton2.left := 100; - //tbutton3.width := 26; - //tbutton3.left := 154; + end; - application.ProcessMessages; + //tbutton2.width := 26; + //tbutton2.left := 100; + //tbutton3.width := 26; + //tbutton3.left := 154; - //tbutton2.visible := false; - //tbutton3.visible := false; - tbutton4.Visible := True; - tbutton5.Visible := False; - tbutton6.Visible := False; + application.ProcessMessages; - //tbutton4.imagenr := 1; - //tbutton4.imagenr := 30; // resume -end; + //tbutton2.visible := false; + //tbutton3.visible := false; + tbutton4.Visible := True; + tbutton5.Visible := False; + tbutton6.Visible := False; + + //tbutton4.imagenr := 1; + //tbutton4.imagenr := 30; // resume + end; end; @@ -648,10 +679,10 @@ procedure tcommanderfo.setvolume(const Sender: TObject); procedure tcommanderfo.ondest(const Sender: TObject); begin - docallback := false; - Timermix.Enabled := false; - timersent.Enabled := false; - + docallback := False; + Timermix.Enabled := False; + timersent.Enabled := False; + Timermix.Free; timersent.Free; end; @@ -1070,13 +1101,13 @@ procedure tcommanderfo.onexecbutlght(const Sender: TObject); if TButton(Sender).Name = 'Brandommix' then if TButton(Sender).tag = 0 then begin - randommix.Value := True; + randommix.Value := True; TButton(Sender).tag := 1; TButton(Sender).face.template := tfacegreen; end else begin - randommix.Value := False; + randommix.Value := False; TButton(Sender).tag := 0; TButton(Sender).face.template := tfacebutgray; end; @@ -1289,17 +1320,16 @@ procedure tcommanderfo.ontimerinit(const Sender: TObject); end; -procedure tcommanderfo.onsetsysvol(const sender: TObject; var avalue: realty; - var accept: Boolean); +procedure tcommanderfo.onsetsysvol(const Sender: TObject; var avalue: realty; var accept: Boolean); begin - sysvolbut.caption := msestring(inttostr(round(avalue*10))); + sysvolbut.Caption := msestring(IntToStr(round(avalue * 10))); {$if (defined(linux)) and (not defined(cpuaarch64)) and (not defined(cpuarm))} - docallback := false; - ALSAmixerSetVolume(0, round(avalue * 100)); - ALSAmixerSetVolume(1, round(avalue * 100)); - docallback := true; + docallback := False; + ALSAmixerSetVolume(0, round(avalue * 100)); + ALSAmixerSetVolume(1, round(avalue * 100)); + docallback := True; {$ENDIF} - + {$if defined(windows)} docallback := false; WINmixerSetVolume(0, round(avalue * 100)); @@ -1307,13 +1337,13 @@ procedure tcommanderfo.onsetsysvol(const sender: TObject; var avalue: realty; {$ENDIF} end; -procedure tcommanderfo.dotimercallback(const sender: TObject); +procedure tcommanderfo.dotimercallback(const Sender: TObject); begin {$if (defined(linux)) and (not defined(cpuaarch64)) and (not defined(cpuarm))} if docallback then begin - commanderfo.sysvol.value := ALSAmixerGetVolume(0) / 100; - commanderfo.sysvolbut.caption := msestring(inttostr(round(commanderfo.sysvol.value*10))); + commanderfo.sysvol.Value := ALSAmixerGetVolume(0) / 100; + commanderfo.sysvolbut.Caption := msestring(IntToStr(round(commanderfo.sysvol.Value * 10))); end; {$ENDIF} @@ -1326,13 +1356,12 @@ procedure tcommanderfo.dotimercallback(const sender: TObject); {$ENDIF} end; -procedure tcommanderfo.onmouse(const sender: twidget; - var ainfo: mouseeventinfoty); +procedure tcommanderfo.onmouse(const Sender: twidget; var ainfo: mouseeventinfoty); begin - if mainfo.ttimer2.Enabled then - mainfo.ttimer2.restart // to reset - else - mainfo.ttimer2.Enabled := True; + if mainfo.ttimer2.Enabled then + mainfo.ttimer2.restart // to reset + else + mainfo.ttimer2.Enabled := True; end; end. diff --git a/src/equalizer.pas b/src/equalizer.pas index 9dbd11c..8df375c 100644 --- a/src/equalizer.pas +++ b/src/equalizer.pas @@ -4,11 +4,37 @@ interface uses - Classes,ctypes,SysUtils,msetypes,mseglob,mseguiglob,mseguiintf,mseapplication, - msestat,msemenus,msegui,msegraphics,msegraphutils,mseevent,mseclasses,mseforms, - msedock,msegraphedits,mseificomp,mseificompglob,mseifiglob,msescrollbar, - msesimplewidgets,msewidgets,msechart,msedispwidgets,mserichstring, - msefiledialogx,msestatfile,msebitmap,mseimage; + Classes, + ctypes, + SysUtils, + msetypes, + mseglob, + mseguiglob, + mseguiintf, + mseapplication, + msestat, + msemenus, + msegui, + msegraphics, + msegraphutils, + mseevent, + mseclasses, + mseforms, + msedock, + msegraphedits, + mseificomp, + mseificompglob, + mseifiglob, + msescrollbar, + msesimplewidgets, + msewidgets, + msechart, + msedispwidgets, + mserichstring, + msefiledialogx, + msestatfile, + msebitmap, + mseimage; type tasliders = array[1..20] of tslider; @@ -83,10 +109,10 @@ tequalizerfo = class(tdockform) fond: tstringdisp; loadset: TButton; saveset: TButton; - tstringdisp21: tstringdisp; - EQEN: tbooleanedit; - blight: tbutton; - bdark: tbutton; + tstringdisp21: tstringdisp; + EQEN: tbooleanedit; + blight: TButton; + bdark: TButton; procedure oncrea(const Sender: TObject); procedure onchangeslider(const Sender: TObject); procedure onchangeall(); @@ -263,23 +289,23 @@ procedure tequalizerfo.onchangeslider(const Sender: TObject); abutton.Caption := astring; - if tag = 0 then - if tagsender < 11 then - songplayerfo.changefrequency(1, tagsender, again, -1) - else - songplayerfo.changefrequency(1, tagsender - 10, -1, again); - - if tag = 1 then - if tagsender < 11 then - songplayer2fo.changefrequency(2, tagsender, again, -1) - else - songplayer2fo.changefrequency(2, tagsender - 10, -1, again); - - if Caption = 'Equalizer Recorder' then - if tagsender < 11 then - recorderfo.changefrequency(2, tagsender, again, -1) - else - recorderfo.changefrequency(2, tagsender - 10, -1, again); + if tag = 0 then + if tagsender < 11 then + songplayerfo.changefrequency(1, tagsender, again, -1) + else + songplayerfo.changefrequency(1, tagsender - 10, -1, again); + + if tag = 1 then + if tagsender < 11 then + songplayer2fo.changefrequency(2, tagsender, again, -1) + else + songplayer2fo.changefrequency(2, tagsender - 10, -1, again); + + if Caption = 'Equalizer Recorder' then + if tagsender < 11 then + recorderfo.changefrequency(2, tagsender, again, -1) + else + recorderfo.changefrequency(2, tagsender - 10, -1, again); end; end; @@ -351,7 +377,7 @@ procedure tequalizerfo.onvisiblechange(const Sender: TObject); mainfo.tmainmenu1.menu[4].submenu[16].Caption := ' Show Equalizer 2 ' else if Caption = 'Equalizer Recorder' then mainfo.tmainmenu1.menu[4].submenu[17].Caption := ' Show Equalizer Rec '; - + if norefresh = False then begin if Assigned(mainfo) then @@ -380,26 +406,30 @@ procedure tequalizerfo.loadlist(const Sender: TObject); ordir: msestring; begin ordir := msestring(ExtractFilePath(msestring(ParamStr(0))) + 'equ' + directoryseparator); - dialogfilesfo.tag := tag; + dialogfilesfo.tag := tag; dialogfilesfo.Caption := 'Load a Equalizer Settings File'; - dialogfilesfo.list_files.mask := '*.equ'; - dialogfilesfo.list_files.path := ordir; + dialogfilesfo.list_files.mask := '*.equ'; + dialogfilesfo.list_files.path := ordir; dialogfilesfo.selected_file.Text := ''; - - if tag < 2 then dialogfilesfo.setother.visible := true - else dialogfilesfo.setother.visible := false; - - if (mainfo.typecolor.Value = 0) then - begin - if caption = 'Equalizer Recorder' then - dialogfilesfo.list_files.frame.colorclient := cl_ltgray else - dialogfilesfo.list_files.frame.colorclient := $F9FFC2; - end else - if (mainfo.typecolor.Value = 1) then - dialogfilesfo.list_files.frame.colorclient := cl_ltgray else - dialogfilesfo.list_files.frame.colorclient := cl_gray; - - application.processmessages; + + if tag < 2 then + dialogfilesfo.setother.Visible := True + else + dialogfilesfo.setother.Visible := False; + + if (mainfo.typecolor.Value = 0) then + begin + if Caption = 'Equalizer Recorder' then + dialogfilesfo.list_files.frame.colorclient := cl_ltgray + else + dialogfilesfo.list_files.frame.colorclient := $F9FFC2; + end + else if (mainfo.typecolor.Value = 1) then + dialogfilesfo.list_files.frame.colorclient := cl_ltgray + else + dialogfilesfo.list_files.frame.colorclient := cl_gray; + + application.ProcessMessages; dialogfilesfo.Show; end; diff --git a/src/filelistform.pas b/src/filelistform.pas index ecfe3fa..da342ff 100644 --- a/src/filelistform.pas +++ b/src/filelistform.pas @@ -100,8 +100,8 @@ tfilelistfo = class(tdockform) procedure opendir(const Sender: TObject); procedure onexecfind(const Sender: TObject); - procedure onactiv(const sender: TObject); - procedure onmouse(const sender: twidget; var ainfo: mouseeventinfoty); + procedure onactiv(const Sender: TObject); + procedure onmouse(const Sender: twidget; var ainfo: mouseeventinfoty); end; var @@ -135,7 +135,7 @@ procedure tfilelistfo.formcreated(const Sender: TObject); Timercount.Enabled := False; Timercount.options := [to_single]; Timercount.ontimer := @ontimercount; - + randomize; list_files.hint := ' To move a row: click+hold into the fixed column ' + lineend + @@ -158,8 +158,7 @@ procedure tfilelistfo.formcreated(const Sender: TObject); for x := 0 to list_files.rowCount - 1 do list_files.fixcols[-1].captions[x] := msestring(IntToStr(x + 1)); - - + end; procedure tfilelistfo.ontimersent(const Sender: TObject); @@ -182,7 +181,7 @@ procedure tfilelistfo.onsent(const Sender: TObject); var theplaysender, thecaution, therandom: integer; mustmix: Boolean = False; - begin +begin if directoryexists(historyfn.Value) then begin @@ -252,7 +251,7 @@ procedure tfilelistfo.onsent(const Sender: TObject); if commanderfo.Brandommix.tag = 1 then begin therandom := random(list_files.rowcount - 1); - application.processmessages; + application.ProcessMessages; if (list_files[3][therandom] = '1') then begin mustmix := True; @@ -509,8 +508,9 @@ procedure tfilelistfo.onchangpath(const Sender: TObject; findex: integer); edfilescount.Value := list_files.rowcount; if edfilescount.Value > 1 then - filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') - else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') + else + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); finally datalist_files.Free; @@ -717,9 +717,10 @@ procedure tfilelistfo.onaftdrop(const Sender: TObject); procedure tfilelistfo.onchangecount(const Sender: TObject); begin - if edfilescount.Value > 1 then - filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') - else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); + if edfilescount.Value > 1 then + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') + else + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); end; procedure tfilelistfo.ondestr(const Sender: TObject); @@ -742,9 +743,9 @@ procedure tfilelistfo.loadlist(const Sender: TObject); ordir := msestring(ExtractFilePath(msestring(ParamStr(0))) + 'list' + directoryseparator); tfiledialog1.controller.captionopen := 'Open List File'; tfiledialog1.controller.options := [fdo_savelastdir, fdo_sysfilename]; - - tfiledialog1.controller.nopanel := true; - tfiledialog1.controller.compact := true; + + tfiledialog1.controller.nopanel := True; + tfiledialog1.controller.compact := True; tfiledialog1.controller.fontcolor := cl_black; if mainfo.typecolor.Value = 2 then @@ -771,10 +772,11 @@ procedure tfilelistfo.loadlist(const Sender: TObject); Caption := removefileext(tfiledialog1.controller.filename); list_files.fixcols[-1].captions.Count := filelistfo.list_files.rowCount; - - if edfilescount.Value > 1 then - filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') - else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); + + if edfilescount.Value > 1 then + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') + else + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); list_files.defocuscell; list_files.datacols.clearselection; @@ -891,10 +893,11 @@ procedure tfilelistfo.addfile(const Sender: TObject); list_files[3][x] := msestring(IntToStr(1)); list_files[4][x] := tfiledialog1.controller.filename; edfilescount.Value := list_files.rowcount; - - if edfilescount.Value > 1 then - filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') - else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); + + if edfilescount.Value > 1 then + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files') + else + filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file'); list_files.fixcols[-1].captions.Count := list_files.rowCount; @@ -943,8 +946,8 @@ procedure tfilelistfo.opendir(const Sender: TObject); ara, arb: msestringarty; begin tfiledialog1.controller.captiondir := 'Open Audio Directory'; - tfiledialog1.controller.nopanel := false; - tfiledialog1.controller.compact := false; + tfiledialog1.controller.nopanel := False; + tfiledialog1.controller.compact := False; if mainfo.typecolor.Value = 2 then @@ -1001,22 +1004,21 @@ procedure tfilelistfo.onexecfind(const Sender: TObject); findmessagefo.Show(True); end; -procedure tfilelistfo.onactiv(const sender: TObject); +procedure tfilelistfo.onactiv(const Sender: TObject); begin - if historyfn.value <> '' then - caption := historyfn.Value; + if historyfn.Value <> '' then + Caption := historyfn.Value; bounds_cxmax := 442; bounds_cxmin := 442; Width := 442; end; -procedure tfilelistfo.onmouse(const sender: twidget; - var ainfo: mouseeventinfoty); +procedure tfilelistfo.onmouse(const Sender: twidget; var ainfo: mouseeventinfoty); begin -if mainfo.ttimer2.Enabled then - mainfo.ttimer2.restart // to reset - else - mainfo.ttimer2.Enabled := True; + if mainfo.ttimer2.Enabled then + mainfo.ttimer2.restart // to reset + else + mainfo.ttimer2.Enabled := True; end; diff --git a/src/guitars.pas b/src/guitars.pas index 290b172..86c8c2e 100644 --- a/src/guitars.pas +++ b/src/guitars.pas @@ -4,11 +4,30 @@ interface uses - - mseglob, mseguiglob, mseguiintf, mseapplication, msestat, msemenus, msegui, - msegraphics, msegraphutils, mseevent, mseclasses, mseforms, msedock, - msesimplewidgets, msewidgets, msegraphedits, SysUtils, mseificomp, - mseificompglob, mseifiglob, msescrollbar, msetypes, msedispwidgets, mserichstring, + mseglob, + mseguiglob, + mseguiintf, + mseapplication, + msestat, + msemenus, + msegui, + msegraphics, + msegraphutils, + mseevent, + mseclasses, + mseforms, + msedock, + msesimplewidgets, + msewidgets, + msegraphedits, + SysUtils, + mseificomp, + mseificompglob, + mseifiglob, + msescrollbar, + msetypes, + msedispwidgets, + mserichstring, msestrings; type @@ -40,13 +59,16 @@ tguitarsfo = class(tdockform) var guitarsfo: tguitarsfo; aguitar: array[0..9] of string; - aguitarisplaying: array[0..9] of boolean; + aguitarisplaying: array[0..9] of Boolean; initguit: integer = 1; implementation uses - uos_flat, main, dockpanel1, config, + uos_flat, + main, + dockpanel1, + config, guitars_mfm; procedure tguitarsfo.doguitarstring(const Sender: TObject); @@ -60,69 +82,63 @@ procedure tguitarsfo.doguitarstring(const Sender: TObject); {$if defined(cpuarm)} if uos_AddIntoDevOut(TButton(Sender).tag + 9, configfo.devoutcfg.value, 0.3, -1, -1, -1, -1, -1) > -1 then {$else} - if uos_AddIntoDevOut(TButton(Sender).tag + 9, configfo.devoutcfg.value, -1, -1, -1, -1, -1, -1) > -1 then + if uos_AddIntoDevOut(TButton(Sender).tag + 9, configfo.devoutcfg.Value, -1, -1, -1, -1, -1, -1) > -1 then {$endif} - uos_Play(TButton(Sender).tag + 9); + uos_Play(TButton(Sender).tag + 9); end - else + else if (aguitarisplaying[TButton(Sender).tag - 1] = False) then begin - if (aguitarisplaying[TButton(Sender).tag - 1] = False) then - - begin - TButton(Sender).face.fade_direction := gd_up; - TButton(Sender).face.fade_color.items[1] := cl_ltgreen; + TButton(Sender).face.fade_direction := gd_up; + TButton(Sender).face.fade_color.items[1] := cl_ltgreen; - if uos_CreatePlayer(TButton(Sender).tag + 9) then + if uos_CreatePlayer(TButton(Sender).tag + 9) then - if uos_AddFromFile(TButton(Sender).tag + 9, (PChar(aguitar[TButton(Sender).tag - 1]))) > -1 then + if uos_AddFromFile(TButton(Sender).tag + 9, (PChar(aguitar[TButton(Sender).tag - 1]))) > -1 then {$if defined(cpuarm)} if uos_AddIntoDevOut(TButton(Sender).tag + 9, configfo.devoutcfg.value, 0.3, -1, -1, -1, -1,-1) > -1 then {$else} - if uos_AddIntoDevOut(TButton(Sender).tag + 9) > -1 then + if uos_AddIntoDevOut(TButton(Sender).tag + 9) > -1 then {$endif} - - begin - uos_Play(TButton(Sender).tag + 9, -1); - aguitarisplaying[TButton(Sender).tag - 1] := True; - end; - end - else - begin - TButton(Sender).face.fade_direction := gd_down; - TButton(Sender).face.fade_color.items[1] := $B0A590; - aguitarisplaying[TButton(Sender).tag - 1] := False; - end; - + begin + uos_Play(TButton(Sender).tag + 9, -1); + aguitarisplaying[TButton(Sender).tag - 1] := True; + end; + end + else + begin + TButton(Sender).face.fade_direction := gd_down; + TButton(Sender).face.fade_color.items[1] := $B0A590; + aguitarisplaying[TButton(Sender).tag - 1] := False; end; end; procedure tguitarsfo.onvisiblechangeev(const Sender: TObject); begin if Visible then - begin - mainfo.tmainmenu1.menu[4].submenu[8].Caption := ' Hide Guitars '; - end + mainfo.tmainmenu1.menu[4].submenu[8].Caption := ' Hide Guitars ' else - begin mainfo.tmainmenu1.menu[4].submenu[8].Caption := ' Show Guitars '; + if norefresh = False then + begin + mainfo.updatelayoutstrum(); + if dockpanel1fo.Visible then + dockpanel1fo.updatelayoutpan(); + if dockpanel2fo.Visible then + dockpanel2fo.updatelayoutpan(); + + if dockpanel3fo.Visible then + dockpanel3fo.updatelayoutpan(); + if Assigned(dockpanel4fo) then + if dockpanel4fo.Visible then + dockpanel4fo.updatelayoutpan(); + if Assigned(dockpanel5fo) then + if dockpanel5fo.Visible then + dockpanel5fo.updatelayoutpan(); + end; - - if norefresh = false then -begin - mainfo.updatelayoutstrum(); - if dockpanel1fo.visible then dockpanel1fo.updatelayoutpan(); - if dockpanel2fo.visible then dockpanel2fo.updatelayoutpan(); - - if dockpanel3fo.visible then dockpanel3fo.updatelayoutpan(); - if assigned(dockpanel4fo) then - if dockpanel4fo.visible then dockpanel4fo.updatelayoutpan(); - if assigned(dockpanel5fo) then - if dockpanel5fo.visible then dockpanel5fo.updatelayoutpan(); - -end; end; procedure tguitarsfo.oncreateguit(const Sender: TObject); @@ -131,9 +147,9 @@ procedure tguitarsfo.oncreateguit(const Sender: TObject); i: integer; begin windowopacity := 0; - + Caption := 'Guitar and Bass tuned strings'; - + ordir := IncludeTrailingBackslash(ExtractFilePath(ParamStr(0))); aguitar[0] := ordir + 'sound' + directoryseparator + 'guitar' + directoryseparator + '1_MI_E.ogg'; @@ -168,3 +184,4 @@ procedure tguitarsfo.onmousewindow(const Sender: twidget; var ainfo: mouseeventi end; end. + diff --git a/src/infos.pas b/src/infos.pas index 1de073d..bd8e564 100644 --- a/src/infos.pas +++ b/src/infos.pas @@ -36,7 +36,7 @@ tinfosfo = class(tmseform) infobpm: tlabel; imgPreview: timage; tlabel2: tlabel; - end; + end; var infosfo, infosfo2: tinfosfo; diff --git a/src/main.pas b/src/main.pas index 69ed796..16be56c 100644 --- a/src/main.pas +++ b/src/main.pas @@ -258,9 +258,9 @@ procedure tmainfo.ontimerwait(const Sender: TObject); if (fs_sbverton in container.frame.state) then Width := fowidth + scrollwidth - else + else Width := fowidth; - + basedock.Width := Width; hasinit := 1; @@ -272,18 +272,17 @@ procedure tmainfo.ontimerwait(const Sender: TObject); maxheightfo := rect1.cy - 70; - if visiblecount = 1 then + if visiblecount = 1 then begin bounds_cymax := bounds_cy; bounds_cymin := bounds_cy; - end - else - if visiblecount > 1 then + end + else if visiblecount > 1 then begin bounds_cymax := maxheightfo; - bounds_cymin := 50 ; - end; - + bounds_cymin := 50; + end; + if dockpanel1fo.Visible then dockpanel1fo.updatelayoutpan(); @@ -298,8 +297,8 @@ procedure tmainfo.ontimerwait(const Sender: TObject); if dockpanel5fo.Visible then dockpanel5fo.updatelayoutpan(); - - Visible := True; + + Visible := True; end; end; @@ -322,7 +321,7 @@ procedure tmainfo.oncreateform(const Sender: TObject); rect1: rectty; begin windowopacity := 0; - + SetExceptionMask(GetExceptionMask + [exZeroDivide] + [exInvalidOp] + [exDenormalized] + [exOverflow] + [exUnderflow] + [exPrecision]); @@ -422,9 +421,9 @@ procedure tmainfo.oncreatedform(const Sender: TObject); {$endif} // showall(Sender); // ondockall(Sender); - typecolor.value := 2 ; + typecolor.Value := 2; ondockplayersx2(Sender); - + oktimer := 1; end; @@ -511,7 +510,7 @@ procedure tmainfo.oncreatedform(const Sender: TObject); endlayout(); oktimer := 0; - + if timerwait.Enabled then timerwait.restart // to reset else @@ -614,7 +613,7 @@ procedure tmainfo.oncreatedform(const Sender: TObject); randomnotefo.bringtofront; randomnotefo.refreshform(Sender); end; -//visible := false; + //visible := false; end; @@ -667,10 +666,10 @@ procedure tmainfo.endlayout(); begin Dec(flayoutlock); basedock.dragdock.endplacement(); - if ( hasinit = 1 ) and (flayoutlock = 0) then - updatelayoutstrum(); - - if timerwait.Enabled then + if (hasinit = 1) and (flayoutlock = 0) then + updatelayoutstrum(); + + if timerwait.Enabled then timerwait.restart // to reset else timerwait.Enabled := True; @@ -3801,21 +3800,21 @@ // spect1.face.template := recorderfo.tfacerecorder; with spectrum1fo do begin - tchartleft.colorchart := cl_background; - // tchartleft.traces[0].color := configfo.tcoloredit1.Value; - labelleft.font.color := ltblack; - tchartleft.color := cl_default; - tchartright.color := cl_default; - tchartright.colorchart := cl_background; + tchartleft.colorchart := cl_background; + // tchartleft.traces[0].color := configfo.tcoloredit1.Value; + labelleft.font.color := ltblack; + tchartleft.color := cl_default; + tchartright.color := cl_default; + tchartright.colorchart := cl_background; // tchartright.traces[0].color := configfo.tcoloredit2.Value; - + tchartleft.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit1.Value; tchartright.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit2.Value; tchartleft.traces[0].bar_face.fade_color.items[0] := $F7F7F7; tchartright.traces[0].bar_face.fade_color.items[0] := $F7F7F7; - labelright.font.color := ltblack; - + labelright.font.color := ltblack; + fond.color := cl_default; groupbox1.color := cl_default; @@ -3830,16 +3829,16 @@ // spect1.face.template := recorderfo.tfacerecorder; with spectrum2fo do begin - tchartleft.colorchart := cl_background; + tchartleft.colorchart := cl_background; // tchartleft.traces[0].color := configfo.tcoloredit12.Value; - labelleft.font.color := ltblack; + labelleft.font.color := ltblack; tchartleft.color := cl_default; tchartright.color := cl_default; tchartright.colorchart := cl_background; //tchartright.traces[0].color := configfo.tcoloredit22.Value; - + tchartleft.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit12.Value; tchartright.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit22.Value; tchartleft.traces[0].bar_face.fade_color.items[0] := $F7F7F7; @@ -3860,13 +3859,13 @@ // spect1.face.template := recorderfo.tfacerecorder; with spectrumrecfo do begin - tchartleft.colorchart := cl_background; + tchartleft.colorchart := cl_background; //tchartleft.traces[0].color := $9A9A9A; - labelleft.font.color := ltblack; + labelleft.font.color := ltblack; tchartleft.color := cl_default; tchartright.color := cl_default; - + tchartleft.traces[0].bar_face.fade_color.items[1] := $9A9A9A; tchartright.traces[0].bar_face.fade_color.items[1] := $9A9A9A; tchartleft.traces[0].bar_face.fade_color.items[0] := $F7F7F7; @@ -4049,11 +4048,11 @@ // spect1.face.template := recorderfo.tfacerecorder; begin // labelleft.color := $3A3A3A; // labelright.color := $3A3A3A; - tchartleft.color := $3A3A3A; - tchartleft.colorchart := $3A3A3A; + tchartleft.color := $3A3A3A; + tchartleft.colorchart := $3A3A3A; //tchartleft.traces[0].color := configfo.tcoloredit1.Value; - labelleft.font.color := ltblank; - + labelleft.font.color := ltblank; + tchartleft.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit1.Value; tchartright.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit2.Value; tchartleft.traces[0].bar_face.fade_color.items[0] := $F7F7F7; @@ -4089,12 +4088,12 @@ // spect1.face.template := recorderfo.tfacerecorder; // labelright.color := $3A3A3A; tchartright.colorchart := $3A3A3A; //tchartright.traces[0].color := configfo.tcoloredit22.Value; - tchartleft.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit12.Value; + tchartleft.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit12.Value; tchartright.traces[0].bar_face.fade_color.items[1] := configfo.tcoloredit22.Value; - tchartleft.traces[0].bar_face.fade_color.items[0] := $F7F7F7; + tchartleft.traces[0].bar_face.fade_color.items[0] := $F7F7F7; tchartright.traces[0].bar_face.fade_color.items[0] := $F7F7F7; labelright.font.color := ltblank; - tchartleft.color := $3A3A3A; + tchartleft.color := $3A3A3A; tchartright.color := $3A3A3A; fond.color := $3A3A3A; groupbox1.frame.font.color := ltblank; @@ -4109,15 +4108,15 @@ // spect1.face.template := recorderfo.tfacerecorder; with spectrumrecfo do begin - tchartleft.colorchart := $3A3A3A; + tchartleft.colorchart := $3A3A3A; //tchartleft.traces[0].color := $7A7A7A; - labelleft.font.color := ltblank; + labelleft.font.color := ltblank; // labelleft.color := $3A3A3A; // labelright.color := $3A3A3A; - tchartright.colorchart := $3A3A3A; + tchartright.colorchart := $3A3A3A; //tchartright.traces[0].color := $7A7A7A; - labelright.font.color := ltblank; - + labelright.font.color := ltblank; + tchartleft.traces[0].bar_face.fade_color.items[1] := cl_white; tchartright.traces[0].bar_face.fade_color.items[1] := cl_white; tchartleft.traces[0].bar_face.fade_color.items[0] := $F7F7F7; diff --git a/src/randomnote.pas b/src/randomnote.pas index d662ac3..77fa78e 100644 --- a/src/randomnote.pas +++ b/src/randomnote.pas @@ -5,15 +5,43 @@ interface -uses -msetypes, mseglob, mseguiglob, mseguiintf, mseapplication, msestat, msemenus, msegui, -msegraphics, msegraphutils, mseevent, mseclasses, mseforms, msedock, -msesimplewidgets, msewidgets, mseedit, msestatfile, msestream, SysUtils, mseact, -msedataedits, msedropdownlist, mseificomp, mseificompglob, mseifiglob, -msedispwidgets, mserichstring, msegraphedits, msescrollbar, msechartedit, msesiggui, -msesignal, mseimage; - -type +uses + msetypes, + mseglob, + mseguiglob, + mseguiintf, + mseapplication, + msestat, + msemenus, + msegui, + msegraphics, + msegraphutils, + mseevent, + mseclasses, + mseforms, + msedock, + msesimplewidgets, + msewidgets, + mseedit, + msestatfile, + msestream, + SysUtils, + mseact, + msedataedits, + msedropdownlist, + mseificomp, + mseificompglob, + mseifiglob, + msedispwidgets, + mserichstring, + msegraphedits, + msescrollbar, + msechartedit, + msesiggui, + msesignal, + mseimage; + +type trandomnotefo = class(tdockform) guitar2: tstringdisp; guitar3: tstringdisp; @@ -68,10 +96,10 @@ trandomnotefo = class(tdockform) chord1drop: tdropdownlistedit; chord2drop: tdropdownlistedit; chord3drop: tdropdownlistedit; - bnbchords: tbutton; - btnfixed: tbutton; - tbutton5: tbutton; - chord4: tbutton; + bnbchords: TButton; + btnfixed: TButton; + tbutton5: TButton; + chord4: TButton; chord4drop: tdropdownlistedit; piano4: tstringdisp; keyb4: timage; @@ -88,7 +116,7 @@ trandomnotefo = class(tdockform) belipse4_3: timage; belipse4_1: timage; belipse4_2: timage; - chord5: tbutton; + chord5: TButton; chord5drop: tdropdownlistedit; piano5: tstringdisp; keyb5: timage; @@ -105,13 +133,13 @@ trandomnotefo = class(tdockform) belipse5_3: timage; belipse5_1: timage; belipse5_2: timage; - bchord1: tbutton; - bchord5: tbutton; - bchord4: tbutton; - bchord3: tbutton; - bchord2: tbutton; - tbutton2: tbutton; - tbutton3: tbutton; + bchord1: TButton; + bchord5: TButton; + bchord4: TButton; + bchord3: TButton; + bchord2: TButton; + tbutton2: TButton; + tbutton3: TButton; tgroupbox1: tgroupbox; bool7th: tbooleanedit; boolminor: tbooleanedit; @@ -126,7 +154,7 @@ trandomnotefo = class(tdockform) nodrums: tbooleanedit; withsharp: tbooleanedit; bosound: tbooleanedit; - bconfig: tbutton; + bconfig: TButton; tstringdisp2: tstringdisp; timage3: timage; timage4: timage; @@ -134,39 +162,39 @@ trandomnotefo = class(tdockform) timage7: timage; pconfigtext: tstringdisp; tmemoedit1: tmemoedit; - tbutton6: tbutton; - procedure dorandomchordbut(Const Sender: TObject); - procedure dorandomchord(Const Sender: TObject); - procedure oncreatedev(Const Sender: TObject); - procedure randomnum(Const Sender: TObject); - procedure onclosev(Const Sender: TObject); - procedure doclear(Const Sender: TObject); - procedure onshowdrums(Const Sender: TObject); - procedure doquit(Const Sender: TObject); + tbutton6: TButton; + procedure dorandomchordbut(const Sender: TObject); + procedure dorandomchord(const Sender: TObject); + procedure oncreatedev(const Sender: TObject); + procedure randomnum(const Sender: TObject); + procedure onclosev(const Sender: TObject); + procedure doclear(const Sender: TObject); + procedure onshowdrums(const Sender: TObject); + procedure doquit(const Sender: TObject); procedure pianochord(num, ranchord, ismin, isseven: integer); procedure guitarchord(num, ranchord, ismin, isseven: integer); procedure basschord(num, ranchord, ismin, isseven: integer); - procedure showguit(Const Sender: TObject); - procedure onmouseguit(Const Sender: twidget; Var ainfo: mouseeventinfoty); - procedure onmousepiano(Const Sender: twidget; Var ainfo: mouseeventinfoty); - procedure refreshform(Const Sender: TObject); - procedure onmousev(Const Sender: twidget; Var ainfo: mouseeventinfoty); - procedure ontextmax(Const Sender: tcustomdataedit; Var atext: msestring; Var accept: Boolean); + procedure showguit(const Sender: TObject); + procedure onmouseguit(const Sender: twidget; var ainfo: mouseeventinfoty); + procedure onmousepiano(const Sender: twidget; var ainfo: mouseeventinfoty); + procedure refreshform(const Sender: TObject); + procedure onmousev(const Sender: twidget; var ainfo: mouseeventinfoty); + procedure ontextmax(const Sender: tcustomdataedit; var atext: msestring; var accept: Boolean); procedure playrandomchords(thenum: integer); - procedure ondropchord(Const Sender: twidget; Const dropdown: tdropdownlist); - procedure onchangechorddrop(Const Sender: TObject); - procedure dofixed(Const Sender: TObject); - procedure doinit(Const sender: TObject); - procedure doconfig(Const sender: TObject); - procedure onconfigtext(Const sender: TObject); + procedure ondropchord(const Sender: twidget; const dropdown: tdropdownlist); + procedure onchangechorddrop(const Sender: TObject); + procedure dofixed(const Sender: TObject); + procedure doinit(const Sender: TObject); + procedure doconfig(const Sender: TObject); + procedure onconfigtext(const Sender: TObject); - procedure onhide(const sender: TObject); - procedure onshowrand(const sender: TObject); - procedure crea(const sender: TObject); + procedure onhide(const Sender: TObject); + procedure onshowrand(const Sender: TObject); + procedure crea(const Sender: TObject); end; -var +var randomnotefo: trandomnotefo; chordran: integer; chorddrop: integer = 0; @@ -175,3776 +203,3771 @@ trandomnotefo = class(tdockform) implementation -uses -randomnote_mfm, -main, -config, -uos_flat, -guitars, -drums; +uses + randomnote_mfm, + main, + config, + uos_flat, + guitars, + drums; procedure trandomnotefo.guitarchord(num, ranchord, ismin, isseven: integer); -var - ratioheight : double; +var + ratioheight: double; begin - ratioheight := (bchord1.height /158) ; + ratioheight := (bchord1.Height / 158); if num = 1 then - begin - gelipse1_1.Visible := True; - gelipse1_2.Visible := True; - gelipse1_3.Visible := True; - end + begin + gelipse1_1.Visible := True; + gelipse1_2.Visible := True; + gelipse1_3.Visible := True; + end else if num = 2 then - begin - gelipse2_1.Visible := True; - gelipse2_2.Visible := True; - gelipse2_3.Visible := True; - end + begin + gelipse2_1.Visible := True; + gelipse2_2.Visible := True; + gelipse2_3.Visible := True; + end else if num = 3 then - begin - gelipse3_1.Visible := True; - gelipse3_2.Visible := True; - gelipse3_3.Visible := True; - end + begin + gelipse3_1.Visible := True; + gelipse3_2.Visible := True; + gelipse3_3.Visible := True; + end else if num = 4 then - begin - gelipse4_1.Visible := True; - gelipse4_2.Visible := True; - gelipse4_3.Visible := True; - end + begin + gelipse4_1.Visible := True; + gelipse4_2.Visible := True; + gelipse4_3.Visible := True; + end else if num = 5 then - begin - gelipse5_1.Visible := True; - gelipse5_2.Visible := True; - gelipse5_3.Visible := True; - end; + begin + gelipse5_1.Visible := True; + gelipse5_2.Visible := True; + gelipse5_3.Visible := True; + end; if (ranchord = 1) and (ismin = 1) then // La maj + begin + if num = 1 then begin - if num = 1 then - begin - // 4-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 48; + // 4-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 48; - // 3-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 68; + // 3-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 68; - // 2-2 - gelipse1_3.top := round(74 *ratioheight); - gelipse1_3.left := 88; + // 2-2 + gelipse1_3.top := round(74 * ratioheight); + gelipse1_3.left := 88; - guitar1.Text := ' X 0 0' + lineend + ' ══════════ 0'; + guitar1.Text := ' X 0 0' + lineend + ' ══════════ 0'; - end - else if num = 2 then - begin - // 4-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 48; + end + else if num = 2 then + begin + // 4-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 48; + + // 3-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 68; + + // 2-2 + gelipse2_3.top := round(74 * ratioheight); + gelipse2_3.left := 88; + + guitar2.Text := ' X 0 0' + lineend + ' ══════════ 0'; + + end + else if num = 3 then + begin + // 4-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 48; + + // 3-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 68; - // 3-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 68; + // 2-2 + gelipse3_3.top := round(74 * ratioheight); + gelipse3_3.left := 88; - // 2-2 - gelipse2_3.top := round(74 *ratioheight); - gelipse2_3.left := 88; + guitar3.Text := ' X 0 0' + lineend + ' ══════════ 0'; + end + else if num = 4 then + begin + // 4-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 48; + + // 3-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 68; + + // 2-2 + gelipse4_3.top := round(74 * ratioheight); + gelipse4_3.left := 88; + + guitar4.Text := ' X 0 0' + lineend + ' ══════════ 0'; + end + else if num = 5 then + begin + // 4-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 48; + + // 3-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 68; - guitar2.Text := ' X 0 0' + lineend + ' ══════════ 0'; + // 2-2 + gelipse5_3.top := round(74 * ratioheight); + gelipse5_3.left := 88; - end - else if num = 3 then - begin - // 4-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 48; + guitar5.Text := ' X 0 0' + lineend + ' ══════════ 0'; + end; - // 3-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 68; + end + else if (ranchord = 1) and (ismin <> 1) then + // La min + begin + if num = 1 then + begin + // 4-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 48; - // 2-2 - gelipse3_3.top := round(74 *ratioheight); - gelipse3_3.left := 88; + // 3-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 68; - guitar3.Text := ' X 0 0' + lineend + ' ══════════ 0'; - end - else if num = 4 then - begin - // 4-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 48; + // 2-1 + gelipse1_3.top := round(32 * ratioheight); + gelipse1_3.left := 88; - // 3-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 68; + guitar1.Text := ' X 0 0' + lineend + ' ══════════ 0'; - // 2-2 - gelipse4_3.top := round(74 *ratioheight); - gelipse4_3.left := 88; + end + else if num = 2 then + begin + // 4-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 48; - guitar4.Text := ' X 0 0' + lineend + ' ══════════ 0'; - end - else if num = 5 then - begin - // 4-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 48; + // 3-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 68; - // 3-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 68; + // 2-1 + gelipse2_3.top := round(32 * ratioheight); + gelipse2_3.left := 88; - // 2-2 - gelipse5_3.top := round(74 *ratioheight); - gelipse5_3.left := 88; + guitar2.Text := ' X 0 0' + lineend + ' ══════════ 0'; - guitar5.Text := ' X 0 0' + lineend + ' ══════════ 0'; - end; + end + else if num = 3 then + begin + // 4-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 48; + // 3-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 68; + // 2-1 + gelipse3_3.top := round(32 * ratioheight); + gelipse3_3.left := 88; + guitar3.Text := ' X 0 0' + lineend + ' ══════════ 0'; end - else if (ranchord = 1) and (ismin <> 1) then - // La min - begin - if num = 1 then - begin - // 4-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 48; - - // 3-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 68; - - // 2-1 - gelipse1_3.top := round(32 *ratioheight); - gelipse1_3.left := 88; - - guitar1.Text := ' X 0 0' + lineend + ' ══════════ 0'; - - end - else if num = 2 then - begin - // 4-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 48; - - // 3-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 68; - - // 2-1 - gelipse2_3.top := round(32 *ratioheight); - gelipse2_3.left := 88; - - guitar2.Text := ' X 0 0' + lineend + ' ══════════ 0'; - - end - else if num = 3 then - begin - // 4-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 48; - - // 3-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 68; - - // 2-1 - gelipse3_3.top := round(32 *ratioheight); - gelipse3_3.left := 88; - - guitar3.Text := ' X 0 0' + lineend + ' ══════════ 0'; - end - else if num = 4 then - begin - // 4-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 48; - - // 3-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 68; - - // 2-1 - gelipse4_3.top := round(32 *ratioheight); - gelipse4_3.left := 88; - - guitar4.Text := ' X 0 0' + lineend + ' ══════════ 0'; - end - else if num = 5 then - begin - // 4-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 48; - - // 3-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 68; - - // 2-1 - gelipse5_3.top := round(32 *ratioheight); - gelipse5_3.left := 88; - - guitar5.Text := ' X 0 0' + lineend + ' ══════════ 0'; - end; - end + else if num = 4 then + begin + // 4-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 48; + + // 3-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 68; + + // 2-1 + gelipse4_3.top := round(32 * ratioheight); + gelipse4_3.left := 88; + + guitar4.Text := ' X 0 0' + lineend + ' ══════════ 0'; + end + else if num = 5 then + begin + // 4-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 48; + + // 3-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 68; + + // 2-1 + gelipse5_3.top := round(32 * ratioheight); + gelipse5_3.left := 88; + + guitar5.Text := ' X 0 0' + lineend + ' ══════════ 0'; + end; + end else if ((withsharp.Value = False) and (ranchord = 2) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 3) and (ismin = 1)) then - begin - // Si Maj - if num = 1 then - begin - // 4-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 48; - - // 3-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 68; - - // 2-2 - gelipse1_3.top := round(74 *ratioheight); - gelipse1_3.left := 88; - - guitar1.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - - end - else if num = 2 then - begin - // 4-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 48; - - // 3-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 68; - - // 2-2 - gelipse2_3.top := round(74 *ratioheight); - gelipse2_3.left := 88; - - guitar2.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - - end - else if num = 3 then - begin - // 4-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 48; - - // 3-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 68; - - // 2-2 - gelipse3_3.top := round(74 *ratioheight); - gelipse3_3.left := 88; - - guitar3.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - end - else if num = 4 then - begin - // 4-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 48; - - // 3-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 68; - - // 2-2 - gelipse4_3.top := round(74 *ratioheight); - gelipse4_3.left := 88; - - guitar4.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - end - else if num = 5 then - begin - // 4-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 48; - - // 3-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 68; - - // 2-2 - gelipse5_3.top := round(74 *ratioheight); - gelipse5_3.left := 88; - - guitar5.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - end; - - end + ((withsharp.Value = True) and (ranchord = 3) and (ismin = 1)) then + begin + // Si Maj + if num = 1 then + begin + // 4-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 48; + + // 3-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 68; + + // 2-2 + gelipse1_3.top := round(74 * ratioheight); + gelipse1_3.left := 88; + + guitar1.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + + end + else if num = 2 then + begin + // 4-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 48; + + // 3-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 68; + + // 2-2 + gelipse2_3.top := round(74 * ratioheight); + gelipse2_3.left := 88; + + guitar2.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + + end + else if num = 3 then + begin + // 4-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 48; + + // 3-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 68; + + // 2-2 + gelipse3_3.top := round(74 * ratioheight); + gelipse3_3.left := 88; + + guitar3.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + end + else if num = 4 then + begin + // 4-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 48; + + // 3-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 68; + + // 2-2 + gelipse4_3.top := round(74 * ratioheight); + gelipse4_3.left := 88; + + guitar4.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + end + else if num = 5 then + begin + // 4-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 48; + + // 3-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 68; + + // 2-2 + gelipse5_3.top := round(74 * ratioheight); + gelipse5_3.left := 88; + + guitar5.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + end; + + end else if ((withsharp.Value = False) and (ranchord = 2) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 3) and (ismin <> 1)) then - begin - // Si min - if num = 1 then - begin - // 4-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 48; - - // 3-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 68; - - // 2-1 - gelipse1_3.top := round(32 *ratioheight); - gelipse1_3.left := 88; - - guitar1.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - - end - else if num = 2 then - begin - // 4-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 48; - - // 3-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 68; - - // 2-1 - gelipse2_3.top := round(32 *ratioheight); - gelipse2_3.left := 88; - - guitar2.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - - end - else if num = 3 then - begin - // 4-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 48; - - // 3-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 68; - - // 2-1 - gelipse3_3.top := round(32 *ratioheight); - gelipse3_3.left := 88; - - guitar3.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - end - else if num = 4 then - begin - // 4-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 48; - - // 3-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 68; - - // 2-1 - gelipse4_3.top := round(32 *ratioheight); - gelipse4_3.left := 88; - - guitar4.Text := '═X═0═══════0═ ' + lineend + - ' ══════════ 2'; - end; - end + ((withsharp.Value = True) and (ranchord = 3) and (ismin <> 1)) then + begin + // Si min + if num = 1 then + begin + // 4-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 48; + + // 3-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 68; + + // 2-1 + gelipse1_3.top := round(32 * ratioheight); + gelipse1_3.left := 88; + + guitar1.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + + end + else if num = 2 then + begin + // 4-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 48; + + // 3-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 68; + + // 2-1 + gelipse2_3.top := round(32 * ratioheight); + gelipse2_3.left := 88; + + guitar2.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + + end + else if num = 3 then + begin + // 4-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 48; + + // 3-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 68; + + // 2-1 + gelipse3_3.top := round(32 * ratioheight); + gelipse3_3.left := 88; + + guitar3.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + end + else if num = 4 then + begin + // 4-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 48; + + // 3-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 68; + + // 2-1 + gelipse4_3.top := round(32 * ratioheight); + gelipse4_3.left := 88; + + guitar4.Text := '═X═0═══════0═ ' + lineend + + ' ══════════ 2'; + end; + end else if ((withsharp.Value = False) and (ranchord = 3) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 4) and (ismin = 1)) then - begin - // Do Maj - if num = 1 then - begin - // 5-3 - gelipse1_1.top := round(114 *ratioheight); - gelipse1_1.left := 28; + ((withsharp.Value = True) and (ranchord = 4) and (ismin = 1)) then + begin + // Do Maj + if num = 1 then + begin + // 5-3 + gelipse1_1.top := round(114 * ratioheight); + gelipse1_1.left := 28; - // 4-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 48; + // 4-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 48; - // 2-1 - gelipse1_3.top := round(32 *ratioheight); - gelipse1_3.left := 88; + // 2-1 + gelipse1_3.top := round(32 * ratioheight); + gelipse1_3.left := 88; - guitar1.Text := ' X 0' + lineend + ' ══════════ 0'; + guitar1.Text := ' X 0' + lineend + ' ══════════ 0'; - end - else if num = 2 then - begin - // 4-2 - gelipse2_1.top := round(114 *ratioheight); - gelipse2_1.left := 28; + end + else if num = 2 then + begin + // 4-2 + gelipse2_1.top := round(114 * ratioheight); + gelipse2_1.left := 28; - // 4-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 48; + // 4-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 48; - // 2-1 - gelipse2_3.top := round(32 *ratioheight); - gelipse2_3.left := 88; + // 2-1 + gelipse2_3.top := round(32 * ratioheight); + gelipse2_3.left := 88; - guitar2.Text := ' X 0' + lineend + ' ══════════ 0'; + guitar2.Text := ' X 0' + lineend + ' ══════════ 0'; - end - else if num = 3 then - begin + end + else if num = 3 then + begin - gelipse3_1.top := round(114 *ratioheight); - gelipse3_1.left := 28; + gelipse3_1.top := round(114 * ratioheight); + gelipse3_1.left := 28; - // 4-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 48; + // 4-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 48; - // 2-1 - gelipse3_3.top := round(32 *ratioheight); - gelipse3_3.left := 88; + // 2-1 + gelipse3_3.top := round(32 * ratioheight); + gelipse3_3.left := 88; - guitar3.Text := ' X 0' + lineend + ' ══════════ 0'; - end - else if num = 4 then - begin + guitar3.Text := ' X 0' + lineend + ' ══════════ 0'; + end + else if num = 4 then + begin - gelipse4_1.top := round(114 *ratioheight); - gelipse4_1.left := 28; + gelipse4_1.top := round(114 * ratioheight); + gelipse4_1.left := 28; - // 4-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 48; + // 4-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 48; - // 2-1 - gelipse4_3.top := round(32 *ratioheight); - gelipse4_3.left := 88; + // 2-1 + gelipse4_3.top := round(32 * ratioheight); + gelipse4_3.left := 88; - guitar4.Text := ' X 0' + lineend + ' ══════════ 0'; - end - else if num = 5 then - begin + guitar4.Text := ' X 0' + lineend + ' ══════════ 0'; + end + else if num = 5 then + begin - gelipse5_1.top := round(114 *ratioheight); - gelipse5_1.left := 28; + gelipse5_1.top := round(114 * ratioheight); + gelipse5_1.left := 28; - // 4-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 48; + // 4-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 48; - // 2-1 - gelipse5_3.top := round(32 *ratioheight); - gelipse5_3.left := 88; + // 2-1 + gelipse5_3.top := round(32 * ratioheight); + gelipse5_3.left := 88; - guitar5.Text := ' X 0' + lineend + ' ══════════ 0'; - end; + guitar5.Text := ' X 0' + lineend + ' ══════════ 0'; + end; - end + end else if ((withsharp.Value = False) and (ranchord = 3) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 4) and (ismin <> 1)) then - begin - // Do min - if num = 1 then - begin - // 4-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 48; - - // 3-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 68; - - // 2-1 - gelipse1_3.top := round(32 *ratioheight); - gelipse1_3.left := 88; - - guitar1.Text := '═X═0═══════0═' + lineend + - ' ══════════ 3'; - - end - else if num = 2 then - begin - // 4-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 48; - - // 3-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 68; - - // 2-1 - gelipse2_3.top := round(32 *ratioheight); - gelipse2_3.left := 88; - - guitar2.Text := '═X═0═══════0═' + lineend + - ' ══════════ 3'; - - end - else if num = 3 then - begin - // 4-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 48; - - // 3-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 68; - - // 2-1 - gelipse3_3.top := round(32 *ratioheight); - gelipse3_3.left := 88; - - guitar3.Text := '═X═0═══════0═' + lineend + - ' ══════════ 3'; - end - else if num = 4 then - begin - // 4-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 48; - - // 3-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 68; - - // 2-1 - gelipse4_3.top := round(32 *ratioheight); - gelipse4_3.left := 88; - - guitar4.Text := '═X═0═══════0═' + lineend + - ' ══════════ 3'; - end - else if num = 5 then - begin - // 4-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 48; - - // 3-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 68; - - // 2-1 - gelipse5_3.top := round(32 *ratioheight); - gelipse5_3.left := 88; - - guitar5.Text := '═X═0═══════0═' + lineend + - ' ══════════ 3'; - end; - end - else if ((withsharp.Value = False) and (ranchord = 4) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 6) and (ismin = 1)) then - begin - // Ré Maj - if num = 1 then - begin - // 3-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 68; - - // 2-3 - gelipse1_2.top := round(116 *ratioheight); - gelipse1_2.left := 90; - - // 2-1 - gelipse1_3.top := round(74 *ratioheight); - gelipse1_3.left := 108; - - guitar1.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - - end - else if num = 2 then - begin - // 3-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 68; - - // 2-3 - gelipse2_2.top := round(116 *ratioheight); - gelipse2_2.left := 90; - - // 2-1 - gelipse2_3.top := round(74 *ratioheight); - gelipse2_3.left := 108; - - guitar2.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - - end - else if num = 3 then - begin - // 3-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 68; - - // 2-3 - gelipse3_2.top := round(116 *ratioheight); - gelipse3_2.left := 90; - - // 2-1 - gelipse3_3.top := round(74 *ratioheight); - gelipse3_3.left := 108; - - guitar3.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - end - else if num = 4 then - begin - // 3-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 68; - - // 2-3 - gelipse4_2.top := round(116 *ratioheight); - gelipse4_2.left := 90; - - // 2-1 - gelipse4_3.top := round(74 *ratioheight); - gelipse4_3.left := 108; - - guitar4.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - end - else if num = 5 then - begin - // 3-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 68; - - // 2-3 - gelipse5_2.top := round(116 *ratioheight); - gelipse5_2.left := 90; - - // 2-1 - gelipse5_3.top := round(74 *ratioheight); - gelipse5_3.left := 108; - - guitar5.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 4) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 6) and (ismin <> 1)) then - begin - // Ré min - if num = 1 then - begin - // 3-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 68; - - // 2-3 - gelipse1_2.top := round(116 *ratioheight); - gelipse1_2.left := 90; - - // 2-1 - gelipse1_3.top := round(32 *ratioheight); - gelipse1_3.left := 108; - - guitar1.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - end - else if num = 2 then - begin - // 3-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 68; - - // 2-3 - gelipse2_2.top := round(116 *ratioheight); - gelipse2_2.left := 90; - - // 2-1 - gelipse2_3.top := round(32 *ratioheight); - gelipse2_3.left := 108; - - guitar2.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - - end - else if num = 3 then - begin - // 3-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 68; - - // 2-3 - gelipse3_2.top := round(116 *ratioheight); - gelipse3_2.left := 90; - - // 2-1 - gelipse3_3.top := round(32 *ratioheight); - gelipse3_3.left := 108; - - guitar3.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - end - else if num = 4 then - begin - // 3-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 68; - - // 2-3 - gelipse4_2.top := round(116 *ratioheight); - gelipse4_2.left := 90; - - // 2-1 - gelipse4_3.top := round(32 *ratioheight); - gelipse4_3.left := 108; - - guitar4.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - end - else if num = 5 then - begin - // 3-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 68; - - // 2-3 - gelipse5_2.top := round(116 *ratioheight); - gelipse5_2.left := 90; - - // 2-1 - gelipse5_3.top := round(32 *ratioheight); - gelipse5_3.left := 108; - - guitar5.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - end; - end - else if ((withsharp.Value = False) and (ranchord = 5) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 8) and (ismin = 1)) then - begin - // Mi Maj - if num = 1 then - begin - // 5-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 26; - - // 4-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 48; - - // 3-1 - gelipse1_3.top := round(30 *ratioheight); - gelipse1_3.left := 70; - - guitar1.Text := ' 0 0 0' + lineend + ' ══════════ 0'; - - end - else if num = 2 then - begin - // 5-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 26; - - // 4-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 48; - - // 3-1 - gelipse2_3.top := round(30 *ratioheight); - gelipse2_3.left := 70; - ; - - guitar2.Text := ' 0 0 0' + lineend + ' ══════════ 0'; - - end - else if num = 3 then - begin - // 5-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 26; - - // 4-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 48; - - // 3-1 - gelipse3_3.top := round(30 *ratioheight); - gelipse3_3.left := 70; - - guitar3.Text := ' 0 0 0' + lineend + ' ══════════ 0'; - end - else if num = 4 then - begin - // 5-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 26; - - // 4-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 48; - - // 3-1 - gelipse4_3.top := round(30 *ratioheight); - gelipse4_3.left := 70; - - guitar4.Text := ' 0 0 0' + lineend + ' ══════════ 0'; - end - else if num = 5 then - begin - // 5-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 26; - - // 4-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 48; - - // 3-1 - gelipse5_3.top := round(30 *ratioheight); - gelipse5_3.left := 70; - - guitar5.Text := ' 0 0 0' + lineend + ' ══════════ 0'; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 5) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 8) and (ismin <> 1)) then - begin - // mi min - if num = 1 then - begin - // 5-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 26; - - // 4-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 48; - - gelipse1_3.Visible := False; - - guitar1.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; - end - else if num = 2 then - begin - // 5-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 26; - - // 4-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 48; - - gelipse2_3.Visible := False; - - guitar2.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; - - end - else if num = 3 then - begin - // 5-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 26; - - // 4-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 48; - - gelipse3_3.Visible := False; - - guitar3.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; - end - else if num = 4 then - begin - // 5-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 26; - - // 4-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 48; - - gelipse4_3.Visible := False; - - guitar4.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; - end - else if num = 5 then - begin - // 5-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 26; - - // 4-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 48; - - gelipse5_3.Visible := False; - - guitar5.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 6) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 9) and (ismin = 1)) then - begin - // Fa Maj - if num = 1 then - begin - // 5-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 26; - - // 4-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 48; - - // 3-1 - gelipse1_3.top := round(30 *ratioheight); - gelipse1_3.left := 70; - - guitar1.Text := '═0═══════0═0═' + lineend + - ' ══════════ 1'; - - end - else if num = 2 then - begin - // 5-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 26; - - // 4-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 48; - - // 3-1 - gelipse2_3.top := round(30 *ratioheight); - gelipse2_3.left := 70; - ; - - guitar2.Text := '═0═══════0═0═' + lineend + - ' ══════════ 1'; - - end - else if num = 3 then - begin - // 5-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 26; - - // 4-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 48; - - // 3-1 - gelipse3_3.top := round(30 *ratioheight); - gelipse3_3.left := 70; - - guitar3.Text := '═0═══════0═0═' + lineend + - ' ══════════ 1'; - end - else if num = 4 then - begin - // 5-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 26; - - // 4-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 48; - - // 3-1 - gelipse4_3.top := round(30 *ratioheight); - gelipse4_3.left := 70; - - guitar4.Text := '═0═══════0═0═' + lineend + - ' ══════════ 1'; - end - else if num = 5 then - begin - // 5-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 26; - - // 4-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 48; - - // 3-1 - gelipse5_3.top := round(30 *ratioheight); - gelipse5_3.left := 70; - - guitar5.Text := '═0═══════0═0═' + lineend + - ' ══════════ 1'; - end; - - - end - else if ((withsharp.Value = False) and (ranchord = 6) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 9) and (ismin <> 1)) then - begin - // Fa min - if num = 1 then - begin - // 5-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 26; - - // 4-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 48; - - gelipse1_3.Visible := False; - - guitar1.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 1'; - end - else if num = 2 then - begin - // 5-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 26; - - // 4-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 48; - - gelipse2_3.Visible := False; - - guitar2.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 1'; - - end - else if num = 3 then - begin - // 5-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 26; - - // 4-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 48; - - gelipse3_3.Visible := False; - - guitar3.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 1'; - end - else if num = 4 then - begin - // 5-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 26; - - // 4-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 48; - - gelipse4_3.Visible := False; - - guitar3.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 1'; - end - else if num = 5 then - begin - // 5-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 26; - - // 4-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 48; - - gelipse5_3.Visible := False; - - guitar5.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 1'; - end; - end - else if ((withsharp.Value = False) and (ranchord = 7) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 11) and (ismin = 1)) then - begin - // Sol Maj - if num = 1 then - begin - // 6-3 - gelipse1_1.top := round(114 *ratioheight); - gelipse1_1.left := 6; - - // 5-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 26; - - // 1-3 - gelipse1_3.top := round(114 *ratioheight); - gelipse1_3.left := 110; - - guitar1.Text := ' 0 0 0 ' + lineend + ' ══════════ 0'; - - end - else if num = 2 then - begin - // 6-3 - gelipse2_1.top := round(114 *ratioheight); - gelipse2_1.left := 6; - - // 5-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 26; - - // 1-3 - gelipse2_3.top := round(114 *ratioheight); - gelipse2_3.left := 110; - guitar2.Text := ' 0 0 0 ' + lineend + - ' ══════════ 0'; - - end - else if num = 3 then - begin - // 6-3 - gelipse3_1.top := round(114 *ratioheight); - gelipse3_1.left := 6; - - // 5-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 26; - - // 1-3 - gelipse3_3.top := round(114 *ratioheight); - gelipse3_3.left := 110; - guitar3.Text := ' 0 0 0 ' + lineend + - ' ══════════ 0'; - end - else if num = 4 then - begin - // 6-3 - gelipse4_1.top := round(114 *ratioheight); - gelipse4_1.left := 6; - - // 5-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 26; - - // 1-3 - gelipse4_3.top := round(114 *ratioheight); - gelipse4_3.left := 110; - guitar4.Text := ' 0 0 0 ' + lineend + - ' ══════════ 0'; - end - else if num = 5 then - begin - // 6-3 - gelipse5_1.top := round(114 *ratioheight); - gelipse5_1.left := 6; - - // 5-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 26; - - // 1-3 - gelipse5_3.top := round(114 *ratioheight); - gelipse5_3.left := 110; - guitar5.Text := ' 0 0 0 ' + lineend + - ' ══════════ 0'; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 7) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 11) and (ismin <> 1)) then - begin - // Sol min - if num = 1 then - begin - // 5-2 - gelipse1_1.top := round(74 *ratioheight); - gelipse1_1.left := 26; - - // 4-2 - gelipse1_2.top := round(74 *ratioheight); - gelipse1_2.left := 48; - - gelipse1_3.Visible := False; - - guitar1.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 3'; - end - else if num = 2 then - begin - // 5-2 - gelipse2_1.top := round(74 *ratioheight); - gelipse2_1.left := 26; - - // 4-2 - gelipse2_2.top := round(74 *ratioheight); - gelipse2_2.left := 48; - - gelipse2_3.Visible := False; - - guitar2.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 3'; - - end - else if num = 3 then - begin - // 5-2 - gelipse3_1.top := round(74 *ratioheight); - gelipse3_1.left := 26; - - // 4-2 - gelipse3_2.top := round(74 *ratioheight); - gelipse3_2.left := 48; - - gelipse3_3.Visible := False; - - guitar3.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 3'; - end - else if num = 4 then - begin - // 5-2 - gelipse4_1.top := round(74 *ratioheight); - gelipse4_1.left := 26; - - // 4-2 - gelipse4_2.top := round(74 *ratioheight); - gelipse4_2.left := 48; - - gelipse4_3.Visible := False; - - guitar4.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 3'; - end - else if num = 5 then - begin - // 5-2 - gelipse5_1.top := round(74 *ratioheight); - gelipse5_1.left := 26; - - // 4-2 - gelipse5_2.top := round(74 *ratioheight); - gelipse5_2.left := 48; - - gelipse5_3.Visible := False; - - guitar5.Text := '═0═════0═0═0═' + lineend + - ' ══════════ 3'; - end; - - end - else if num = 1 then - begin - guitar1.Text := ''; - gelipse1_1.Visible := False; - gelipse1_2.Visible := False; - gelipse1_3.Visible := False; - end - else if num = 2 then - begin - guitar2.Text := ''; - gelipse2_1.Visible := False; - gelipse2_2.Visible := False; - gelipse2_3.Visible := False; - end - else if num = 3 then - begin - guitar3.Text := ''; - gelipse3_1.Visible := False; - gelipse3_2.Visible := False; - gelipse3_3.Visible := False; - end - else if num = 4 then - begin - guitar4.Text := ''; - gelipse4_1.Visible := False; - gelipse4_2.Visible := False; - gelipse4_3.Visible := False; - end - else if num = 5 then - begin - guitar5.Text := ''; - gelipse5_1.Visible := False; - gelipse5_2.Visible := False; - gelipse5_3.Visible := False; - end; + ((withsharp.Value = True) and (ranchord = 4) and (ismin <> 1)) then + begin + // Do min + if num = 1 then + begin + // 4-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 48; -end; + // 3-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 68; + // 2-1 + gelipse1_3.top := round(32 * ratioheight); + gelipse1_3.left := 88; -procedure trandomnotefo.pianochord(num, ranchord, ismin, isseven: integer); -var - ratioheight : double; + guitar1.Text := '═X═0═══════0═' + lineend + + ' ══════════ 3'; -begin - ratioheight := (bchord1.height /158); - if num = 1 then + end + else if num = 2 then begin - elipse1_1.Visible := True; - elipse1_2.Visible := True; - elipse1_3.Visible := True; + // 4-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 48; + + // 3-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 68; + + // 2-1 + gelipse2_3.top := round(32 * ratioheight); + gelipse2_3.left := 88; + + guitar2.Text := '═X═0═══════0═' + lineend + + ' ══════════ 3'; + end - else if num = 2 then - begin - elipse2_1.Visible := True; - elipse2_2.Visible := True; - elipse2_3.Visible := True; - end - else if num = 3 then - begin - elipse3_1.Visible := True; - elipse3_2.Visible := True; - elipse3_3.Visible := True; - end - else if num = 4 then - begin - elipse4_1.Visible := True; - elipse4_2.Visible := True; - elipse4_3.Visible := True; - end - else if num = 5 then - begin - elipse5_1.Visible := True; - elipse5_2.Visible := True; - elipse5_3.Visible := True; - end; + else if num = 3 then + begin + // 4-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 48; + // 3-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 68; - if (ranchord = 1) and (ismin = 1) then - // La maj + // 2-1 + gelipse3_3.top := round(32 * ratioheight); + gelipse3_3.left := 88; + + guitar3.Text := '═X═0═══════0═' + lineend + + ' ══════════ 3'; + end + else if num = 4 then begin - if num = 1 then - begin - // la - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 136; + // 4-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 48; - // do# 2 - elipse1_2.top := round(24 *ratioheight); - elipse1_2.left := 201; + // 3-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 68; - // mi 2 - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 240; - end - else if num = 2 then - begin - // la - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 136; - - // do# 2 - elipse2_2.top := round(24 *ratioheight); - elipse2_2.left := 201; - - // mi 2 - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 240; - end - else if num = 3 then - begin - // la - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 136; - - // do# 2 - elipse3_2.top := round(24 *ratioheight); - elipse3_2.left := 201; - - // mi 2 - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 240; - end - else if num = 4 then - begin - // la - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 136; - - // do# 2 - elipse4_2.top := round(24 *ratioheight); - elipse4_2.left := 201; - - // mi 2 - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 240; - end - else if num = 5 then - begin - // la - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 136; - - // do# 2 - elipse5_2.top := round(24 *ratioheight); - elipse5_2.left := 201; - - // mi 2 - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 240; - end; + // 2-1 + gelipse4_3.top := round(32 * ratioheight); + gelipse4_3.left := 88; + guitar4.Text := '═X═0═══════0═' + lineend + + ' ══════════ 3'; end - else if (ranchord = 1) and (ismin <> 1) then - // La min - begin - if num = 1 then - begin - // la - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 136; - - // do 2 - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 188; - - // mi 2 - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 240; - end - else if num = 2 then - begin - // la - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 136; - - // do 2 - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 188; - - // mi 2 - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 240; - end - else if num = 3 then - begin - // la - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 136; - - // do 2 - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 188; - - // mi 2 - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 240; - end - else if num = 4 then - begin - // la - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 136; - - // do 2 - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 188; - - // mi 2 - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 240; - end - else if num = 5 then - begin - // la - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 136; - - // do 2 - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 188; - - // mi 2 - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 240; - end; - end - else if ((withsharp.Value = False) and (ranchord = 2) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 3) and (ismin = 1)) then - begin - // Si Maj - if num = 1 then - begin - // fa# - elipse1_1.top := round(24 *ratioheight); - elipse1_1.left := 92; - - // si - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 160; - - // ré# 2 - elipse1_3.top := round(24 *ratioheight); - elipse1_3.left := 228; - end - else if num = 2 then - begin - // fa# - elipse2_1.top := round(24 *ratioheight); - elipse2_1.left := 92; - - // si - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 160; - - // ré# 2 - elipse2_3.top := round(24 *ratioheight); - elipse2_3.left := 228; - end - else if num = 3 then - begin - // fa# - elipse3_1.top := round(24 *ratioheight); - elipse3_1.left := 92; - - // si - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 160; - - // ré# 2 - elipse3_3.top := round(24 *ratioheight); - elipse3_3.left := 228; - end - else if num = 4 then - begin - // fa# - elipse4_1.top := round(24 *ratioheight); - elipse4_1.left := 92; - - // si - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 160; - - // ré# 2 - elipse4_3.top := round(24 *ratioheight); - elipse4_3.left := 228; - end - else if num = 5 then - begin - // fa# - elipse5_1.top := round(24 *ratioheight); - elipse5_1.left := 92; - - // si - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 160; - - // ré# 2 - elipse5_3.top := round(24 *ratioheight); - elipse5_3.left := 228; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 2) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 3) and (ismin <> 1)) then - begin - // Si min - if num = 1 then - begin - // fa# - elipse1_1.top := round(24 *ratioheight); - elipse1_1.left := 92; - - // si - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 160; - - // ré 2 - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 214; - end - else if num = 2 then - begin - // fa# - elipse2_1.top := round(24 *ratioheight); - elipse2_1.left := 92; - - // si - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 160; - - // ré 2 - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 214; - end - else if num = 3 then - begin - // fa# - elipse3_1.top := round(24 *ratioheight); - elipse3_1.left := 92; - - // si - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 160; - - // ré 2 - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 214; - end - else if num = 4 then - begin - // fa# - elipse4_1.top := round(24 *ratioheight); - elipse4_1.left := 92; - - // si - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 160; - - // ré 2 - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 214; - end - else if num = 5 then - begin - // fa# - elipse5_1.top := round(24 *ratioheight); - elipse5_1.left := 92; - - // si - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 160; - - // ré 2 - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 214; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 3) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 4) and (ismin = 1)) then - begin - // do Maj - - if num = 1 then - begin - // do - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 0; - - // mi - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 54; - - // sol - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 108; - end - else if num = 2 then - begin - // do - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 0; - - // mi - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 54; - - // sol - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 108; - end - else if num = 3 then - begin - // do - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 0; - - // mi - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 54; - - // sol - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 108; - end - else if num = 4 then - begin - // do - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 0; - - // mi - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 54; - - // sol - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 108; - end - else if num = 5 then - begin - // do - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 0; - - // mi - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 54; - - // sol - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 108; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 3) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 4) and (ismin <> 1)) then - begin - // do min - if num = 1 then - begin - // do - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 0; - - // ré # - elipse1_2.top := round(24 *ratioheight); - elipse1_2.left := 40; - - // sol - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 108; - end - else if num = 2 then - begin - // do - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 0; - - // ré # - elipse2_2.top := round(24 *ratioheight); - elipse2_2.left := 40; - - // sol - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 108; - end - else if num = 3 then - begin - // do - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 0; - - // ré # - elipse3_2.top := round(24 *ratioheight); - elipse3_2.left := 40; - - // sol - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 108; - end - else if num = 4 then - begin - // do - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 0; - - // ré # - elipse4_2.top := round(24 *ratioheight); - elipse4_2.left := 40; - - // sol - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 108; - end - else if num = 5 then - begin - // do - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 0; - - // ré # - elipse5_2.top := round(24 *ratioheight); - elipse5_2.left := 40; - - // sol - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 108; - end; - end + else if num = 5 then + begin + // 4-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 48; + + // 3-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 68; + + // 2-1 + gelipse5_3.top := round(32 * ratioheight); + gelipse5_3.left := 88; + + guitar5.Text := '═X═0═══════0═' + lineend + + ' ══════════ 3'; + end; + end else if ((withsharp.Value = False) and (ranchord = 4) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 6) and (ismin = 1)) then - begin - // ré Maj - // ré - if num = 1 then - begin - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 28; - - // fa # - elipse1_2.top := round(24 *ratioheight); - elipse1_2.left := 94; - - // la - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 134; - end - else if num = 2 then - begin - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 28; - - // fa # - elipse2_2.top := round(24 *ratioheight); - elipse2_2.left := 94; - - // la - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 134; - end - else if num = 3 then - begin - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 28; - - // fa # - elipse3_2.top := round(24 *ratioheight); - elipse3_2.left := 94; - - // la - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 134; - end - else if num = 4 then - begin - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 28; - - // fa # - elipse4_2.top := round(24 *ratioheight); - elipse4_2.left := 94; - - // la - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 134; - end - else if num = 5 then - begin - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 28; - - // fa # - elipse5_2.top := round(26 *ratioheight); - elipse5_2.left := 94; - - // la - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 134; - end; - end - else if ((withsharp.Value = False) and (ranchord = 4) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 6) and (ismin <> 1)) then - begin - // ré min - if num = 1 then - begin - // ré - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 28; - - // fa - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 80; - - // la - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 134; - end - else if num = 2 then - begin - // ré - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 28; - - // fa - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 80; - - // la - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 134; - end - else if num = 3 then - begin - // ré - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 28; - - // fa - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 80; - - // la - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 134; - end - else if num = 4 then - begin - // ré - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 28; - - // fa - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 80; - - // la - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 134; - end - else if num = 5 then - begin - // ré - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 28; - - // fa - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 80; - - // la - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 134; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 5) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 8) and (ismin = 1)) then - begin - // mi Maj - if num = 1 then - begin - // mi - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 54; - - // sol # - elipse1_2.top := round(24 *ratioheight); - elipse1_2.left := 122; - - // si - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 162; - end - else if num = 2 then - begin - // mi - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 54; - - // sol # - elipse2_2.top := round(24 *ratioheight); - elipse2_2.left := 122; - - // si - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 162; - end - else if num = 3 then - begin - // mi - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 54; - - // sol # - elipse3_2.top := round(24 *ratioheight); - elipse3_2.left := 122; - - // si - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 162; - end - else if num = 4 then - begin - // mi - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 54; - - // sol # - elipse4_2.top := round(24 *ratioheight); - elipse4_2.left := 122; - - // si - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 162; - end - else if num = 5 then - begin - // mi - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 54; - - // sol # - elipse5_2.top := round(24 *ratioheight); - elipse5_2.left := 122; - - // si - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 162; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 5) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 8) and (ismin <> 1)) then - begin - // mi min - // mi - if num = 1 then - begin - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 54; - - // sol - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 108; - - // si - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 162; - end - else if num = 2 then - begin - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 54; - - // sol - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 108; - - // si - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 162; - end - else if num = 3 then - begin - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 54; - - // sol - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 108; - - // si - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 162; - end - else if num = 4 then - begin - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 54; - - // sol - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 108; - - // si - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 162; - end - else if num = 5 then - begin - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 54; - - // sol - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 108; - - // si - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 162; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 6) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 9) and (ismin = 1)) then - begin - // fa Maj - if num = 1 then - begin - // fa - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 80; - - // la - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 134; - - // do 2 - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 190; - end - else if num = 2 then - begin - // fa - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 80; - - // la - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 134; - - // do 2 - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 190; - end - else if num = 3 then - begin - // fa - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 80; - - // la - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 134; - - // do 2 - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 190; - end - else if num = 4 then - begin - // fa - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 80; - - // la - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 134; - - // do 2 - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 190; - end - else if num = 5 then - begin - // fa - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 80; - - // la - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 134; - - // do 2 - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 190; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 6) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 9) and (ismin <> 1)) then - begin - // fa min - if num = 1 then - begin - // fa - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 80; - - // la - elipse1_2.top := round(24 *ratioheight); - elipse1_2.left := 120; - - // do 2 - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 190; - end - else if num = 2 then - begin - // fa - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 80; - - // la - elipse2_2.top := round(24 *ratioheight); - elipse2_2.left := 120; - - // do 2 - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 190; - end - else if num = 3 then - begin - // fa - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 80; - - // la - elipse3_2.top := round(24 *ratioheight); - elipse3_2.left := 120; - - // do 2 - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 190; - end - else if num = 4 then - begin - // fa - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 80; - - // la - elipse4_2.top := round(24 *ratioheight); - elipse4_2.left := 120; - - // do 2 - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 190; - end - else if num = 5 then - begin - // fa - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 80; - - // la - elipse5_2.top := round(24 *ratioheight); - elipse5_2.left := 120; - - // do 2 - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 190; - end; - end - else if ((withsharp.Value = False) and (ranchord = 7) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 11) and (ismin = 1)) then - begin - // sol Maj - // sol - if num = 1 then - begin - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 108; - - // si - elipse1_2.top := round(96 *ratioheight); - elipse1_2.left := 160; - - // ré 2 - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 218; - end - else if num = 2 then - begin - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 108; - - // si - elipse2_2.top := round(96 *ratioheight); - elipse2_2.left := 160; - - // ré 2 - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 218; - end - else if num = 3 then - begin - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 108; - - // si - elipse3_2.top := round(96 *ratioheight); - elipse3_2.left := 160; - - // ré 2 - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 218; - end - else if num = 4 then - begin - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 108; - - // si - elipse4_2.top := round(96 *ratioheight); - elipse4_2.left := 160; - - // ré 2 - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 218; - end - else if num = 5 then - begin - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 108; - - // si - elipse5_2.top := round(96 *ratioheight); - elipse5_2.left := 160; - - // ré 2 - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 218; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 7) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 11) and (ismin <> 1)) then - begin - // sol min - if num = 1 then - begin - // sol - elipse1_1.top := round(96 *ratioheight); - elipse1_1.left := 108; - - // la# - elipse1_2.top := round(24 *ratioheight); - elipse1_2.left := 148; - - // ré 2 - elipse1_3.top := round(96 *ratioheight); - elipse1_3.left := 218; - end - else if num = 2 then - begin - // sol - elipse2_1.top := round(96 *ratioheight); - elipse2_1.left := 108; - - // la# - elipse2_2.top := round(24 *ratioheight); - elipse2_2.left := 148; - - // ré 2 - elipse2_3.top := round(96 *ratioheight); - elipse2_3.left := 218; - end - else if num = 3 then - begin - // sol - elipse3_1.top := round(96 *ratioheight); - elipse3_1.left := 108; - - // la# - elipse3_2.top := round(24 *ratioheight); - elipse3_2.left := 148; - - // ré 2 - elipse3_3.top := round(96 *ratioheight); - elipse3_3.left := 218; - end - else if num = 4 then - begin - // sol - elipse4_1.top := round(96 *ratioheight); - elipse4_1.left := 108; - - // la# - elipse4_2.top := round(24 *ratioheight); - elipse4_2.left := 148; - - // ré 2 - elipse4_3.top := round(96 *ratioheight); - elipse4_3.left := 218; - end - else if num = 5 then - begin - // sol - elipse5_1.top := round(96 *ratioheight); - elipse5_1.left := 108; - - // la# - elipse5_2.top := round(24 *ratioheight); - elipse5_2.left := 148; - - // ré 2 - elipse5_3.top := round(96 *ratioheight); - elipse5_3.left := 218; - end; - end - else if num = 1 then - begin - elipse1_1.Visible := False; - elipse1_2.Visible := False; - elipse1_3.Visible := False; - end - else if num = 2 then - begin - elipse2_1.Visible := False; - elipse2_2.Visible := False; - elipse2_3.Visible := False; - end - else if num = 3 then - begin - elipse3_1.Visible := False; - elipse3_2.Visible := False; - elipse3_3.Visible := False; - end - else if num = 4 then - begin - elipse4_1.Visible := False; - elipse4_2.Visible := False; - elipse4_3.Visible := False; - end - else if num = 5 then - begin - elipse5_1.Visible := False; - elipse5_2.Visible := False; - elipse5_3.Visible := False; - end; + ((withsharp.Value = True) and (ranchord = 6) and (ismin = 1)) then + begin + // Ré Maj + if num = 1 then + begin + // 3-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 68; -end; + // 2-3 + gelipse1_2.top := round(116 * ratioheight); + gelipse1_2.left := 90; -procedure trandomnotefo.basschord(num, ranchord, ismin, isseven: integer); -var - ratioheight : double; -begin - ratioheight := (bchord1.height /158) ; + // 2-1 + gelipse1_3.top := round(74 * ratioheight); + gelipse1_3.left := 108; - if num = 1 then - belipse1_1.Visible := True// belipse1_2.visible := true; - // belipse1_3.visible := true; - else if num = 2 then - belipse2_1.Visible := True// belipse2_2.visible := true; - // belipse2_3.visible := true; - else if num = 3 then - belipse3_1.Visible := True// belipse3_2.visible := true; - // belipse3_3.visible := true; - else if num = 4 then - belipse4_1.Visible := True - else if num = 5 then - belipse5_1.Visible := True - ; + guitar1.Text := ' X X 0 ' + lineend + ' ══════════ 0'; - if (ranchord = 1) and (ismin = 1) then - // La maj + end + else if num = 2 then begin - if num = 1 then - begin - // la - belipse1_1.top := round(130 *ratioheight); - belipse1_1.left := 10; + // 3-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 68; - // do# 2 - belipse1_2.top := 24; - belipse1_2.left := 201; + // 2-3 + gelipse2_2.top := round(116 * ratioheight); + gelipse2_2.left := 90; - // mi 2 - belipse1_3.top := 96; - belipse1_3.left := 240; - end - else if num = 2 then - begin - // la - belipse2_1.top := round(130 *ratioheight); - belipse2_1.left := 10; - - // do# 2 - belipse2_2.top := 24; - belipse2_2.left := 201; - - // mi 2 - belipse2_3.top := 96; - belipse2_3.left := 240; - end - else if num = 3 then - begin - // la - belipse3_1.top := round(130 *ratioheight); - belipse3_1.left := 10; - - // do# 2 - belipse3_2.top := 24; - belipse3_2.left := 201; - - // mi 2 - belipse3_3.top := 96; - belipse3_3.left := 240; - end - else if num = 4 then - begin - // la - belipse4_1.top := round(130 *ratioheight); - belipse4_1.left := 10; - - // do# 2 - belipse4_2.top := 24; - belipse4_2.left := 201; - - // mi 2 - belipse4_3.top := 96; - belipse4_3.left := 240; - end - else if num = 5 then - begin - // la - belipse5_1.top := round(130 *ratioheight); - belipse5_1.left := 10; - - // do# 2 - belipse5_2.top := 24; - belipse5_2.left := 201; - - // mi 2 - belipse5_3.top := 96; - belipse5_3.left := 240; - end; + // 2-1 + gelipse2_3.top := round(74 * ratioheight); + gelipse2_3.left := 108; + + guitar2.Text := ' X X 0 ' + lineend + ' ══════════ 0'; end - else if (ranchord = 1) and (ismin <> 1) then - // La min - begin - if num = 1 then - begin - // la - belipse1_1.top := round(130 *ratioheight); - belipse1_1.left := 10; - - // do 2 - belipse1_2.top := 96; - belipse1_2.left := 188; - - // mi 2 - belipse1_3.top := 96; - belipse1_3.left := 240; - end - else if num = 2 then - begin - // la - belipse2_1.top := round(130 *ratioheight); - belipse2_1.left := 10; - - // do 2 - belipse2_2.top := 96; - belipse2_2.left := 188; - - // mi 2 - belipse2_3.top := 96; - belipse2_3.left := 240; - end - else if num = 3 then - begin - // la - belipse3_1.top := round(130 *ratioheight); - belipse3_1.left := 10; - - // do 2 - belipse3_2.top := 96; - belipse3_2.left := 188; - - // mi 2 - belipse3_3.top := 96; - belipse3_3.left := 240; - end - else if num = 4 then - begin - // la - belipse4_1.top := round(130 *ratioheight); - belipse4_1.left := 10; - - // do 2 - belipse4_2.top := 96; - belipse4_2.left := 188; - - // mi 2 - belipse4_3.top := 96; - belipse4_3.left := 240; - end - else if num = 5 then - begin - // la - belipse5_1.top := round(130 *ratioheight); - belipse5_1.left := 10; - - // do 2 - belipse5_2.top := 96; - belipse5_2.left := 188; - - // mi 2 - belipse5_3.top := 96; - belipse5_3.left := 240; - end; - end - else if ((withsharp.Value = False) and (ranchord = 2) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 3) and (ismin = 1)) then - begin - // Si Maj - if num = 1 then - begin - // fa# - belipse1_1.top := round(42 *ratioheight); - belipse1_1.left := 38; - - // si - belipse1_2.top := 96; - belipse1_2.left := 160; - - // ré# 2 - belipse1_3.top := 24; - belipse1_3.left := 228; - end - else if num = 2 then - begin - // fa# - belipse2_1.top := round(42 *ratioheight); - belipse2_1.left := 38; - - // si - belipse2_2.top := 96; - belipse2_2.left := 160; - - // ré# 2 - belipse2_3.top := 24; - belipse2_3.left := 228; - end - else if num = 3 then - begin - // fa# - belipse3_1.top := round(42 *ratioheight); - belipse3_1.left := 38; - - // si - belipse3_2.top := 96; - belipse3_2.left := 160; - - // ré# 2 - belipse3_3.top := 24; - belipse3_3.left := 228; - end - else if num = 4 then - begin - // fa# - belipse4_1.top := round(42 *ratioheight); - belipse4_1.left := 38; - - // si - belipse4_2.top := 96; - belipse4_2.left := 160; - - // ré# 2 - belipse4_3.top := 24; - belipse4_3.left := 228; - end - else if num = 5 then - begin - // fa# - belipse5_1.top := round(42 *ratioheight); - belipse5_1.left := 38; - - // si - belipse5_2.top := 96; - belipse5_2.left := 160; - - // ré# 2 - belipse5_3.top := 24; - belipse5_3.left := 228; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 2) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 3) and (ismin <> 1)) then - begin - // Si min - if num = 1 then - begin - // fa# - belipse1_1.top := round(42 *ratioheight); - belipse1_1.left := 38; - - // si - belipse1_2.top := 96; - belipse1_2.left := 160; - - // ré 2 - belipse1_3.top := 96; - belipse1_3.left := 214; - end - else if num = 2 then - begin - // fa# - belipse2_1.top := round(42 *ratioheight); - belipse2_1.left := 38; - - // si - belipse2_2.top := 96; - belipse2_2.left := 160; - - // ré 2 - belipse2_3.top := 96; - belipse2_3.left := 214; - end - else if num = 3 then - begin - // fa# - belipse3_1.top := round(42 *ratioheight); - belipse3_1.left := 38; - - // si - belipse3_2.top := 96; - belipse3_2.left := 160; - - // ré 2 - belipse3_3.top := 96; - belipse3_3.left := 214; - end - else if num = 4 then - begin - // fa# - belipse4_1.top := round(42 *ratioheight); - belipse4_1.left := 38; - - // si - belipse4_2.top := 96; - belipse4_2.left := 160; - - // ré 2 - belipse4_3.top := 96; - belipse4_3.left := 214; - end - else if num = 5 then - begin - // fa# - belipse5_1.top := round(42 *ratioheight); - belipse5_1.left := 38; - - // si - belipse5_2.top := 96; - belipse5_2.left := 160; - - // ré 2 - belipse5_3.top := 96; - belipse5_3.left := 214; - end; - end - else if ((withsharp.Value = False) and (ranchord = 3) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 4) and (ismin = 1)) then - begin - // do Maj - - if num = 1 then - begin - // do - belipse1_1.top := round(74 *ratioheight); - belipse1_1.left := 38; - - // mi - belipse1_2.top := 96; - belipse1_2.left := 54; - - // sol - belipse1_3.top := 96; - belipse1_3.left := 108; - end - else if num = 2 then - begin - // do - belipse2_1.top := round(74 *ratioheight); - belipse2_1.left := 38; - - // mi - belipse2_2.top := 96; - belipse2_2.left := 54; - - // sol - belipse2_3.top := 96; - belipse2_3.left := 108; - end - else if num = 3 then - begin - // do - belipse3_1.top := round(74 *ratioheight); - belipse3_1.left := 38; - - // mi - belipse3_2.top := 96; - belipse3_2.left := 54; - - // sol - belipse3_3.top := 96; - belipse3_3.left := 108; - end - else if num = 4 then - begin - // do - belipse4_1.top := round(74 *ratioheight); - belipse4_1.left := 38; - - // mi - belipse4_2.top := 96; - belipse4_2.left := 54; - - // sol - belipse4_3.top := 96; - belipse4_3.left := 108; - end - else if num = 5 then - begin - // do - belipse5_1.top := round(74 *ratioheight); - belipse5_1.left := 38; - - // mi - belipse5_2.top := 96; - belipse5_2.left := 54; - - // sol - belipse5_3.top := 96; - belipse5_3.left := 108; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 3) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 4) and (ismin <> 1)) then - begin - // do min - if num = 1 then - begin - // do - belipse1_1.top := round(74 *ratioheight); - belipse1_1.left := 38; - - // ré # - belipse1_2.top := 24; - belipse1_2.left := 40; - - // sol - belipse1_3.top := 96; - belipse1_3.left := 108; - end - else if num = 2 then - begin - // do - belipse2_1.top := round(74 *ratioheight); - belipse2_1.left := 38; - - // ré # - belipse2_2.top := 24; - belipse2_2.left := 40; - - // sol - belipse2_3.top := 96; - belipse2_3.left := 108; - end - else if num = 3 then - begin - // do - belipse3_1.top := round(74 *ratioheight); - belipse3_1.left := 38; - - // ré # - belipse3_2.top := 24; - belipse3_2.left := 40; - - // sol - belipse3_3.top := 96; - belipse3_3.left := 108; - end - else if num = 4 then - begin - // do - belipse4_1.top := round(74 *ratioheight); - belipse4_1.left := 38; - - // ré # - belipse4_2.top := 24; - belipse4_2.left := 40; - - // sol - belipse4_3.top := 96; - belipse4_3.left := 108; - end - else if num = 5 then - begin - // do - belipse5_1.top := round(74 *ratioheight); - belipse5_1.left := 38; - - // ré # - belipse5_2.top := 24; - belipse5_2.left := 40; - - // sol - belipse5_3.top := 96; - belipse5_3.left := 108; - end; - end - else if ((withsharp.Value = False) and (ranchord = 4) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 6) and (ismin = 1)) then - begin - // ré Maj - // ré - if num = 1 then - begin - belipse1_1.top := round(128 *ratioheight); - belipse1_1.left := 36; - - // fa # - belipse1_2.top := 26; - belipse1_2.left := 94; - - // la - belipse1_3.top := 96; - belipse1_3.left := 134; - end - else if num = 2 then - begin - belipse2_1.top := round(128 *ratioheight); - belipse2_1.left := 36; - - // fa # - belipse2_2.top := 26; - belipse2_2.left := 94; - - // la - belipse2_3.top := 96; - belipse2_3.left := 134; - end - else if num = 3 then - begin - belipse3_1.top := round(128 *ratioheight); - belipse3_1.left := 36; - - // fa # - belipse3_2.top := 26; - belipse3_2.left := 94; - - // la - belipse3_3.top := 96; - belipse3_3.left := 134; - end - else if num = 4 then - begin - belipse4_1.top := round(128 *ratioheight); - belipse4_1.left := 36; - - // fa # - belipse4_2.top := 26; - belipse4_2.left := 94; - - // la - belipse4_3.top := 96; - belipse4_3.left := 134; - end - else if num = 5 then - begin - belipse5_1.top := round(128 *ratioheight); - belipse5_1.left := 36; - - // fa # - belipse5_2.top := 26; - belipse5_2.left := 94; - - // la - belipse5_3.top := 96; - belipse5_3.left := 134; - end; - end + else if num = 3 then + begin + // 3-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 68; + + // 2-3 + gelipse3_2.top := round(116 * ratioheight); + gelipse3_2.left := 90; + + // 2-1 + gelipse3_3.top := round(74 * ratioheight); + gelipse3_3.left := 108; + + guitar3.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + end + else if num = 4 then + begin + // 3-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 68; + + // 2-3 + gelipse4_2.top := round(116 * ratioheight); + gelipse4_2.left := 90; + + // 2-1 + gelipse4_3.top := round(74 * ratioheight); + gelipse4_3.left := 108; + + guitar4.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + end + else if num = 5 then + begin + // 3-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 68; + + // 2-3 + gelipse5_2.top := round(116 * ratioheight); + gelipse5_2.left := 90; + + // 2-1 + gelipse5_3.top := round(74 * ratioheight); + gelipse5_3.left := 108; + + guitar5.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + end; + + end else if ((withsharp.Value = False) and (ranchord = 4) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 6) and (ismin <> 1)) then - begin - // ré min - if num = 1 then - begin - // ré - belipse1_1.top := round(128 *ratioheight); - belipse1_1.left := 36; - - // fa - belipse1_2.top := 96; - belipse1_2.left := 80; - - // la - belipse1_3.top := 96; - belipse1_3.left := 134; - end - else if num = 2 then - begin - // ré - belipse2_1.top := round(128 *ratioheight); - belipse2_1.left := 36; - - // fa - belipse2_2.top := 96; - belipse2_2.left := 80; - - // la - belipse2_3.top := 96; - belipse2_3.left := 134; - end - else if num = 3 then - begin - // ré - belipse3_1.top := round(128 *ratioheight); - belipse3_1.left := 36; - - // fa - belipse3_2.top := 96; - belipse3_2.left := 80; - - // la - belipse3_3.top := 96; - belipse3_3.left := 134; - end - else if num = 4 then - begin - // ré - belipse4_1.top := round(128 *ratioheight); - belipse4_1.left := 36; - - // fa - belipse4_2.top := 96; - belipse4_2.left := 80; - - // la - belipse4_3.top := 96; - belipse4_3.left := 134; - end - else if num = 5 then - begin - // ré - belipse5_1.top := round(128 *ratioheight); - belipse5_1.left := 36; - - // fa - belipse5_2.top := 96; - belipse5_2.left := 80; - - // la - belipse5_3.top := 96; - belipse5_3.left := 134; - end; - end + ((withsharp.Value = True) and (ranchord = 6) and (ismin <> 1)) then + begin + // Ré min + if num = 1 then + begin + // 3-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 68; + + // 2-3 + gelipse1_2.top := round(116 * ratioheight); + gelipse1_2.left := 90; + + // 2-1 + gelipse1_3.top := round(32 * ratioheight); + gelipse1_3.left := 108; + + guitar1.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + end + else if num = 2 then + begin + // 3-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 68; + + // 2-3 + gelipse2_2.top := round(116 * ratioheight); + gelipse2_2.left := 90; + + // 2-1 + gelipse2_3.top := round(32 * ratioheight); + gelipse2_3.left := 108; + + guitar2.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + + end + else if num = 3 then + begin + // 3-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 68; + + // 2-3 + gelipse3_2.top := round(116 * ratioheight); + gelipse3_2.left := 90; + + // 2-1 + gelipse3_3.top := round(32 * ratioheight); + gelipse3_3.left := 108; + + guitar3.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + end + else if num = 4 then + begin + // 3-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 68; + + // 2-3 + gelipse4_2.top := round(116 * ratioheight); + gelipse4_2.left := 90; + + // 2-1 + gelipse4_3.top := round(32 * ratioheight); + gelipse4_3.left := 108; + + guitar4.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + end + else if num = 5 then + begin + // 3-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 68; + + // 2-3 + gelipse5_2.top := round(116 * ratioheight); + gelipse5_2.left := 90; + + // 2-1 + gelipse5_3.top := round(32 * ratioheight); + gelipse5_3.left := 108; + + guitar5.Text := ' X X 0 ' + lineend + ' ══════════ 0'; + end; + end else if ((withsharp.Value = False) and (ranchord = 5) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 8) and (ismin = 1)) then - begin - // mi Maj - if num = 1 then - begin - // mi - belipse1_1.top := round(42 *ratioheight); - belipse1_1.left := 68; - - // sol # - belipse1_2.top := 24; - belipse1_2.left := 122; - - // si - belipse1_3.top := 96; - belipse1_3.left := 162; - end - else if num = 2 then - begin - // mi - belipse2_1.top := round(42 *ratioheight); - belipse2_1.left := 68; - - // sol # - belipse2_2.top := 24; - belipse2_2.left := 122; - - // si - belipse2_3.top := 96; - belipse2_3.left := 162; - end - else if num = 3 then - begin - // mi - belipse3_1.top := round(42 *ratioheight); - belipse3_1.left := 68; - - // sol # - belipse3_2.top := 24; - belipse3_2.left := 122; - - // si - belipse3_3.top := 96; - belipse3_3.left := 162; - end - else if num = 4 then - begin - // mi - belipse4_1.top := round(42 *ratioheight); - belipse4_1.left := 68; - - // sol # - belipse4_2.top := 24; - belipse4_2.left := 122; - - // si - belipse4_3.top := 96; - belipse4_3.left := 162; - end - else if num = 5 then - begin - // mi - belipse5_1.top := round(42 *ratioheight); - belipse5_1.left := 68; - - // sol # - belipse5_2.top := 24; - belipse5_2.left := 122; - - // si - belipse5_3.top := 96; - belipse5_3.left := 162; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 5) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 8) and (ismin <> 1)) then - begin - // mi min - // mi - if num = 1 then - begin - belipse1_1.top := round(42 *ratioheight); - belipse1_1.left := 68; - - // sol - belipse1_2.top := 96; - belipse1_2.left := 108; - - // si - belipse1_3.top := 96; - belipse1_3.left := 162; - end - else if num = 2 then - begin - belipse2_1.top := round(42 *ratioheight); - belipse2_1.left := 68; - - // sol - belipse2_2.top := 96; - belipse2_2.left := 108; - - // si - belipse2_3.top := 96; - belipse2_3.left := 162; - end - else if num = 3 then - begin - belipse3_1.top := round(42 *ratioheight); - belipse3_1.left := 68; - - // sol - belipse3_2.top := 96; - belipse3_2.left := 108; - - // si - belipse3_3.top := 96; - belipse3_3.left := 162; - end - else if num = 4 then - begin - belipse4_1.top := round(42 *ratioheight); - belipse4_1.left := 68; - - // sol - belipse4_2.top := 96; - belipse4_2.left := 108; - - // si - belipse4_3.top := 96; - belipse4_3.left := 162; - end - else if num = 5 then - begin - belipse5_1.top := round(42 *ratioheight); - belipse5_1.left := 68; - - // sol - belipse5_2.top := 96; - belipse5_2.left := 108; - - // si - belipse5_3.top := 96; - belipse5_3.left := 162; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 6) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 9) and (ismin = 1)) then - begin - // fa Maj - if num = 1 then - begin - // fa - belipse1_1.top := round(8 *ratioheight); - belipse1_1.left := 12; - - // la - belipse1_2.top := 96; - belipse1_2.left := 134; - - // do 2 - belipse1_3.top := 96; - belipse1_3.left := 190; - end - else if num = 2 then - begin - // fa - belipse2_1.top := round(8 *ratioheight); - belipse2_1.left := 12; - - // la - belipse2_2.top := 96; - belipse2_2.left := 134; - - // do 2 - belipse2_3.top := 96; - belipse2_3.left := 190; - end - else if num = 3 then - begin - // fa - belipse3_1.top := round(8 *ratioheight); - belipse3_1.left := 12; - - // la - belipse3_2.top := 96; - belipse3_2.left := 134; - - // do 2 - belipse3_3.top := 96; - belipse3_3.left := 190; - end - else if num = 4 then - begin - // fa - belipse4_1.top := round(8 *ratioheight); - belipse4_1.left := 12; - - // la - belipse4_2.top := 96; - belipse4_2.left := 134; - - // do 2 - belipse4_3.top := 96; - belipse4_3.left := 190; - end - else if num = 5 then - begin - // fa - belipse5_1.top := round(8 *ratioheight); - belipse5_1.left := 12; - - // la - belipse5_2.top := 96; - belipse5_2.left := 134; - - // do 2 - belipse5_3.top := 96; - belipse5_3.left := 190; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 6) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 9) and (ismin <> 1)) then - begin - // fa min - if num = 1 then - begin - // fa - belipse1_1.top := round(8 *ratioheight); - belipse1_1.left := 12; - - // la - belipse1_2.top := 24; - belipse1_2.left := 120; - - // do 2 - belipse1_3.top := 96; - belipse1_3.left := 190; - end - else if num = 2 then - begin - // fa - belipse2_1.top := round(8 *ratioheight); - belipse2_1.left := 12; - - // la - belipse2_2.top := 24; - belipse2_2.left := 120; - - // do 2 - belipse2_3.top := 96; - belipse2_3.left := 190; - end - else if num = 3 then - begin - // fa - belipse3_1.top := round(8 *ratioheight); - belipse3_1.left := 12; - - // la - belipse3_2.top := 24; - belipse3_2.left := 120; - - // do 2 - belipse3_3.top := 96; - belipse3_3.left := 190; - end - else if num = 4 then - begin - // fa - belipse4_1.top := round(8 *ratioheight); - belipse4_1.left := 12; - - // la - belipse4_2.top := 24; - belipse4_2.left := 120; - - // do 2 - belipse4_3.top := 96; - belipse4_3.left := 190; - end - else if num = 5 then - begin - // fa - belipse5_1.top := round(8 *ratioheight); - belipse5_1.left := 12; - - // la - belipse5_2.top := 24; - belipse5_2.left := 120; - - // do 2 - belipse5_3.top := 96; - belipse5_3.left := 190; - end; - end - else if ((withsharp.Value = False) and (ranchord = 7) and (ismin = 1)) or - ((withsharp.Value = True) and (ranchord = 11) and (ismin = 1)) then - begin - // sol Maj - // sol - if num = 1 then - begin - belipse1_1.top := round(74 *ratioheight); - belipse1_1.left := 10; - - // si - belipse1_2.top := 96; - belipse1_2.left := 160; - - // ré 2 - belipse1_3.top := 96; - belipse1_3.left := 218; - end - else if num = 2 then - begin - belipse2_1.top := round(74 *ratioheight); - belipse2_1.left := 10; - - // si - belipse2_2.top := 96; - belipse2_2.left := 160; - - // ré 2 - belipse2_3.top := 96; - belipse2_3.left := 218; - end - else if num = 3 then - begin - belipse3_1.top := round(74 *ratioheight); - belipse3_1.left := 10; - - // si - belipse3_2.top := 96; - belipse3_2.left := 160; - - // ré 2 - belipse3_3.top := 96; - belipse3_3.left := 218; - end - else if num = 4 then - begin - belipse4_1.top := round(74 *ratioheight); - belipse4_1.left := 10; - - // si - belipse4_2.top := 96; - belipse4_2.left := 160; - - // ré 2 - belipse4_3.top := 96; - belipse4_3.left := 218; - end - else if num = 5 then - begin - belipse5_1.top := round(74 *ratioheight); - belipse5_1.left := 10; - - // si - belipse5_2.top := 96; - belipse5_2.left := 160; - - // ré 2 - belipse5_3.top := 96; - belipse5_3.left := 218; - end; - - end - else if ((withsharp.Value = False) and (ranchord = 7) and (ismin <> 1)) or - ((withsharp.Value = True) and (ranchord = 11) and (ismin <> 1)) then - begin - // sol min - if num = 1 then - begin - // sol - belipse1_1.top := round(74 *ratioheight); - belipse1_1.left := 10; - - // la# - belipse1_2.top := 24; - belipse1_2.left := 148; - - // ré 2 - belipse1_3.top := 96; - belipse1_3.left := 218; - end - else if num = 2 then - begin - // sol - belipse2_1.top := round(74 *ratioheight); - belipse2_1.left := 10; - - // la# - belipse2_2.top := 24; - belipse2_2.left := 148; - - // ré 2 - belipse2_3.top := 96; - belipse2_3.left := 218; - end - else if num = 3 then - begin - // sol - belipse3_1.top := round(74 *ratioheight); - belipse3_1.left := 10; - - // la# - belipse3_2.top := 24; - belipse3_2.left := 148; - - // ré 2 - belipse3_3.top := 96; - belipse3_3.left := 218; - end - else if num = 4 then - begin - // sol - belipse4_1.top := round(74 *ratioheight); - belipse4_1.left := 10; - - // la# - belipse4_2.top := 24; - belipse4_2.left := 148; - - // ré 2 - belipse4_3.top := 96; - belipse4_3.left := 218; - end - else if num = 5 then - begin - // sol - belipse5_1.top := round(74 *ratioheight); - belipse5_1.left := 10; - - // la# - belipse5_2.top := 24; - belipse5_2.left := 148; - - // ré 2 - belipse5_3.top := 96; - belipse5_3.left := 218; - end; - end - else if num = 1 then - begin - belipse1_1.Visible := False; - belipse1_2.Visible := False; - belipse1_3.Visible := False; - end - else if num = 2 then - begin - belipse2_1.Visible := False; - belipse2_2.Visible := False; - belipse2_3.Visible := False; - end - else if num = 3 then - begin - belipse3_1.Visible := False; - belipse3_2.Visible := False; - belipse3_3.Visible := False; - end - else if num = 4 then - begin - belipse4_1.Visible := False; - belipse4_2.Visible := False; - belipse4_3.Visible := False; - end - else if num = 5 then - begin - belipse5_1.Visible := False; - belipse5_2.Visible := False; - belipse5_3.Visible := False; - end; -end; + ((withsharp.Value = True) and (ranchord = 8) and (ismin = 1)) then + begin + // Mi Maj + if num = 1 then + begin + // 5-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 26; -procedure trandomnotefo.dorandomchordbut(Const Sender: TObject); -begin - if blocked = 0 then + // 4-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 48; + + // 3-1 + gelipse1_3.top := round(30 * ratioheight); + gelipse1_3.left := 70; + + guitar1.Text := ' 0 0 0' + lineend + ' ══════════ 0'; + + end + else if num = 2 then begin - blocked := 1; - dorandomchord(Sender); + // 5-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 26; + + // 4-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 48; + + // 3-1 + gelipse2_3.top := round(30 * ratioheight); + gelipse2_3.left := 70; + ; + + guitar2.Text := ' 0 0 0' + lineend + ' ══════════ 0'; + + end + else if num = 3 then + begin + // 5-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 26; + + // 4-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 48; + + // 3-1 + gelipse3_3.top := round(30 * ratioheight); + gelipse3_3.left := 70; + + guitar3.Text := ' 0 0 0' + lineend + ' ══════════ 0'; + end + else if num = 4 then + begin + // 5-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 26; + + // 4-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 48; + + // 3-1 + gelipse4_3.top := round(30 * ratioheight); + gelipse4_3.left := 70; + + guitar4.Text := ' 0 0 0' + lineend + ' ══════════ 0'; + end + else if num = 5 then + begin + // 5-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 26; + + // 4-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 48; + + // 3-1 + gelipse5_3.top := round(30 * ratioheight); + gelipse5_3.left := 70; + + guitar5.Text := ' 0 0 0' + lineend + ' ══════════ 0'; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 5) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 8) and (ismin <> 1)) then + begin + // mi min + if num = 1 then + begin + // 5-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 26; + + // 4-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 48; + + gelipse1_3.Visible := False; + + guitar1.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; + end + else if num = 2 then + begin + // 5-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 26; + + // 4-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 48; + + gelipse2_3.Visible := False; + + guitar2.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; + + end + else if num = 3 then + begin + // 5-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 26; + + // 4-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 48; + + gelipse3_3.Visible := False; + + guitar3.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; + end + else if num = 4 then + begin + // 5-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 26; + + // 4-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 48; + + gelipse4_3.Visible := False; + + guitar4.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; + end + else if num = 5 then + begin + // 5-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 26; + + // 4-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 48; + + gelipse5_3.Visible := False; + + guitar5.Text := ' 0 0 0 0' + lineend + ' ══════════ 0'; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 6) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 9) and (ismin = 1)) then + begin + // Fa Maj + if num = 1 then + begin + // 5-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 26; + + // 4-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 48; + + // 3-1 + gelipse1_3.top := round(30 * ratioheight); + gelipse1_3.left := 70; + + guitar1.Text := '═0═══════0═0═' + lineend + + ' ══════════ 1'; + + end + else if num = 2 then + begin + // 5-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 26; + + // 4-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 48; + + // 3-1 + gelipse2_3.top := round(30 * ratioheight); + gelipse2_3.left := 70; + ; + + guitar2.Text := '═0═══════0═0═' + lineend + + ' ══════════ 1'; + + end + else if num = 3 then + begin + // 5-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 26; + + // 4-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 48; + + // 3-1 + gelipse3_3.top := round(30 * ratioheight); + gelipse3_3.left := 70; + + guitar3.Text := '═0═══════0═0═' + lineend + + ' ══════════ 1'; + end + else if num = 4 then + begin + // 5-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 26; + + // 4-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 48; + + // 3-1 + gelipse4_3.top := round(30 * ratioheight); + gelipse4_3.left := 70; + + guitar4.Text := '═0═══════0═0═' + lineend + + ' ══════════ 1'; + end + else if num = 5 then + begin + // 5-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 26; + + // 4-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 48; + + // 3-1 + gelipse5_3.top := round(30 * ratioheight); + gelipse5_3.left := 70; + + guitar5.Text := '═0═══════0═0═' + lineend + + ' ══════════ 1'; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 6) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 9) and (ismin <> 1)) then + begin + // Fa min + if num = 1 then + begin + // 5-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 26; + + // 4-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 48; + + gelipse1_3.Visible := False; + + guitar1.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 1'; + end + else if num = 2 then + begin + // 5-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 26; + + // 4-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 48; + + gelipse2_3.Visible := False; + + guitar2.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 1'; + + end + else if num = 3 then + begin + // 5-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 26; + + // 4-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 48; + + gelipse3_3.Visible := False; + + guitar3.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 1'; + end + else if num = 4 then + begin + // 5-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 26; + + // 4-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 48; + + gelipse4_3.Visible := False; + + guitar3.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 1'; + end + else if num = 5 then + begin + // 5-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 26; + + // 4-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 48; + + gelipse5_3.Visible := False; + + guitar5.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 1'; + end; + end + else if ((withsharp.Value = False) and (ranchord = 7) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 11) and (ismin = 1)) then + begin + // Sol Maj + if num = 1 then + begin + // 6-3 + gelipse1_1.top := round(114 * ratioheight); + gelipse1_1.left := 6; + + // 5-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 26; + + // 1-3 + gelipse1_3.top := round(114 * ratioheight); + gelipse1_3.left := 110; + + guitar1.Text := ' 0 0 0 ' + lineend + ' ══════════ 0'; + + end + else if num = 2 then + begin + // 6-3 + gelipse2_1.top := round(114 * ratioheight); + gelipse2_1.left := 6; + + // 5-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 26; + + // 1-3 + gelipse2_3.top := round(114 * ratioheight); + gelipse2_3.left := 110; + guitar2.Text := ' 0 0 0 ' + lineend + + ' ══════════ 0'; + + end + else if num = 3 then + begin + // 6-3 + gelipse3_1.top := round(114 * ratioheight); + gelipse3_1.left := 6; + + // 5-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 26; + + // 1-3 + gelipse3_3.top := round(114 * ratioheight); + gelipse3_3.left := 110; + guitar3.Text := ' 0 0 0 ' + lineend + + ' ══════════ 0'; + end + else if num = 4 then + begin + // 6-3 + gelipse4_1.top := round(114 * ratioheight); + gelipse4_1.left := 6; + + // 5-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 26; + + // 1-3 + gelipse4_3.top := round(114 * ratioheight); + gelipse4_3.left := 110; + guitar4.Text := ' 0 0 0 ' + lineend + + ' ══════════ 0'; + end + else if num = 5 then + begin + // 6-3 + gelipse5_1.top := round(114 * ratioheight); + gelipse5_1.left := 6; + + // 5-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 26; + + // 1-3 + gelipse5_3.top := round(114 * ratioheight); + gelipse5_3.left := 110; + guitar5.Text := ' 0 0 0 ' + lineend + + ' ══════════ 0'; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 7) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 11) and (ismin <> 1)) then + begin + // Sol min + if num = 1 then + begin + // 5-2 + gelipse1_1.top := round(74 * ratioheight); + gelipse1_1.left := 26; + + // 4-2 + gelipse1_2.top := round(74 * ratioheight); + gelipse1_2.left := 48; + + gelipse1_3.Visible := False; + + guitar1.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 3'; + end + else if num = 2 then + begin + // 5-2 + gelipse2_1.top := round(74 * ratioheight); + gelipse2_1.left := 26; + + // 4-2 + gelipse2_2.top := round(74 * ratioheight); + gelipse2_2.left := 48; + + gelipse2_3.Visible := False; + + guitar2.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 3'; + + end + else if num = 3 then + begin + // 5-2 + gelipse3_1.top := round(74 * ratioheight); + gelipse3_1.left := 26; + + // 4-2 + gelipse3_2.top := round(74 * ratioheight); + gelipse3_2.left := 48; + + gelipse3_3.Visible := False; + + guitar3.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 3'; + end + else if num = 4 then + begin + // 5-2 + gelipse4_1.top := round(74 * ratioheight); + gelipse4_1.left := 26; + + // 4-2 + gelipse4_2.top := round(74 * ratioheight); + gelipse4_2.left := 48; + + gelipse4_3.Visible := False; + + guitar4.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 3'; + end + else if num = 5 then + begin + // 5-2 + gelipse5_1.top := round(74 * ratioheight); + gelipse5_1.left := 26; + + // 4-2 + gelipse5_2.top := round(74 * ratioheight); + gelipse5_2.left := 48; + + gelipse5_3.Visible := False; + + guitar5.Text := '═0═════0═0═0═' + lineend + + ' ══════════ 3'; + end; + + end + else if num = 1 then + begin + guitar1.Text := ''; + gelipse1_1.Visible := False; + gelipse1_2.Visible := False; + gelipse1_3.Visible := False; + end + else if num = 2 then + begin + guitar2.Text := ''; + gelipse2_1.Visible := False; + gelipse2_2.Visible := False; + gelipse2_3.Visible := False; + end + else if num = 3 then + begin + guitar3.Text := ''; + gelipse3_1.Visible := False; + gelipse3_2.Visible := False; + gelipse3_3.Visible := False; + end + else if num = 4 then + begin + guitar4.Text := ''; + gelipse4_1.Visible := False; + gelipse4_2.Visible := False; + gelipse4_3.Visible := False; + end + else if num = 5 then + begin + guitar5.Text := ''; + gelipse5_1.Visible := False; + gelipse5_2.Visible := False; + gelipse5_3.Visible := False; + end; + +end; + + +procedure trandomnotefo.pianochord(num, ranchord, ismin, isseven: integer); +var + ratioheight: double; +begin + ratioheight := (bchord1.Height / 158); + if num = 1 then + begin + elipse1_1.Visible := True; + elipse1_2.Visible := True; + elipse1_3.Visible := True; + end + else if num = 2 then + begin + elipse2_1.Visible := True; + elipse2_2.Visible := True; + elipse2_3.Visible := True; + end + else if num = 3 then + begin + elipse3_1.Visible := True; + elipse3_2.Visible := True; + elipse3_3.Visible := True; + end + else if num = 4 then + begin + elipse4_1.Visible := True; + elipse4_2.Visible := True; + elipse4_3.Visible := True; + end + else if num = 5 then + begin + elipse5_1.Visible := True; + elipse5_2.Visible := True; + elipse5_3.Visible := True; + end; + + + if (ranchord = 1) and (ismin = 1) then + // La maj + begin + if num = 1 then + begin + // la + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 136; + + // do# 2 + elipse1_2.top := round(24 * ratioheight); + elipse1_2.left := 201; + + // mi 2 + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 240; + end + else if num = 2 then + begin + // la + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 136; + + // do# 2 + elipse2_2.top := round(24 * ratioheight); + elipse2_2.left := 201; + + // mi 2 + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 240; + end + else if num = 3 then + begin + // la + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 136; + + // do# 2 + elipse3_2.top := round(24 * ratioheight); + elipse3_2.left := 201; + + // mi 2 + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 240; + end + else if num = 4 then + begin + // la + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 136; + + // do# 2 + elipse4_2.top := round(24 * ratioheight); + elipse4_2.left := 201; + + // mi 2 + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 240; + end + else if num = 5 then + begin + // la + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 136; + + // do# 2 + elipse5_2.top := round(24 * ratioheight); + elipse5_2.left := 201; + + // mi 2 + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 240; + end; + + end + else if (ranchord = 1) and (ismin <> 1) then + // La min + begin + if num = 1 then + begin + // la + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 136; + + // do 2 + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 188; + + // mi 2 + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 240; + end + else if num = 2 then + begin + // la + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 136; + + // do 2 + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 188; + + // mi 2 + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 240; + end + else if num = 3 then + begin + // la + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 136; + + // do 2 + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 188; + + // mi 2 + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 240; + end + else if num = 4 then + begin + // la + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 136; + + // do 2 + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 188; + + // mi 2 + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 240; + end + else if num = 5 then + begin + // la + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 136; + + // do 2 + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 188; + + // mi 2 + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 240; + end; + end + else if ((withsharp.Value = False) and (ranchord = 2) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 3) and (ismin = 1)) then + begin + // Si Maj + if num = 1 then + begin + // fa# + elipse1_1.top := round(24 * ratioheight); + elipse1_1.left := 92; + + // si + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 160; + + // ré# 2 + elipse1_3.top := round(24 * ratioheight); + elipse1_3.left := 228; + end + else if num = 2 then + begin + // fa# + elipse2_1.top := round(24 * ratioheight); + elipse2_1.left := 92; + + // si + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 160; + + // ré# 2 + elipse2_3.top := round(24 * ratioheight); + elipse2_3.left := 228; + end + else if num = 3 then + begin + // fa# + elipse3_1.top := round(24 * ratioheight); + elipse3_1.left := 92; + + // si + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 160; + + // ré# 2 + elipse3_3.top := round(24 * ratioheight); + elipse3_3.left := 228; + end + else if num = 4 then + begin + // fa# + elipse4_1.top := round(24 * ratioheight); + elipse4_1.left := 92; + + // si + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 160; + + // ré# 2 + elipse4_3.top := round(24 * ratioheight); + elipse4_3.left := 228; + end + else if num = 5 then + begin + // fa# + elipse5_1.top := round(24 * ratioheight); + elipse5_1.left := 92; + + // si + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 160; + + // ré# 2 + elipse5_3.top := round(24 * ratioheight); + elipse5_3.left := 228; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 2) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 3) and (ismin <> 1)) then + begin + // Si min + if num = 1 then + begin + // fa# + elipse1_1.top := round(24 * ratioheight); + elipse1_1.left := 92; + + // si + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 160; + + // ré 2 + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 214; + end + else if num = 2 then + begin + // fa# + elipse2_1.top := round(24 * ratioheight); + elipse2_1.left := 92; + + // si + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 160; + + // ré 2 + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 214; + end + else if num = 3 then + begin + // fa# + elipse3_1.top := round(24 * ratioheight); + elipse3_1.left := 92; + + // si + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 160; + + // ré 2 + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 214; + end + else if num = 4 then + begin + // fa# + elipse4_1.top := round(24 * ratioheight); + elipse4_1.left := 92; + + // si + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 160; + + // ré 2 + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 214; + end + else if num = 5 then + begin + // fa# + elipse5_1.top := round(24 * ratioheight); + elipse5_1.left := 92; + + // si + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 160; + + // ré 2 + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 214; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 3) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 4) and (ismin = 1)) then + begin + // do Maj + + if num = 1 then + begin + // do + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 0; + + // mi + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 54; + + // sol + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 108; + end + else if num = 2 then + begin + // do + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 0; + + // mi + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 54; + + // sol + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 108; + end + else if num = 3 then + begin + // do + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 0; + + // mi + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 54; + + // sol + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 108; + end + else if num = 4 then + begin + // do + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 0; + + // mi + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 54; + + // sol + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 108; + end + else if num = 5 then + begin + // do + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 0; + + // mi + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 54; + + // sol + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 108; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 3) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 4) and (ismin <> 1)) then + begin + // do min + if num = 1 then + begin + // do + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 0; + + // ré # + elipse1_2.top := round(24 * ratioheight); + elipse1_2.left := 40; + + // sol + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 108; + end + else if num = 2 then + begin + // do + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 0; + + // ré # + elipse2_2.top := round(24 * ratioheight); + elipse2_2.left := 40; + + // sol + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 108; + end + else if num = 3 then + begin + // do + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 0; + + // ré # + elipse3_2.top := round(24 * ratioheight); + elipse3_2.left := 40; + + // sol + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 108; + end + else if num = 4 then + begin + // do + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 0; + + // ré # + elipse4_2.top := round(24 * ratioheight); + elipse4_2.left := 40; + + // sol + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 108; + end + else if num = 5 then + begin + // do + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 0; + + // ré # + elipse5_2.top := round(24 * ratioheight); + elipse5_2.left := 40; + + // sol + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 108; + end; + end + else if ((withsharp.Value = False) and (ranchord = 4) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 6) and (ismin = 1)) then + begin + // ré Maj + // ré + if num = 1 then + begin + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 28; + + // fa # + elipse1_2.top := round(24 * ratioheight); + elipse1_2.left := 94; + + // la + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 134; + end + else if num = 2 then + begin + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 28; + + // fa # + elipse2_2.top := round(24 * ratioheight); + elipse2_2.left := 94; + + // la + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 134; + end + else if num = 3 then + begin + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 28; + + // fa # + elipse3_2.top := round(24 * ratioheight); + elipse3_2.left := 94; + + // la + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 134; + end + else if num = 4 then + begin + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 28; + + // fa # + elipse4_2.top := round(24 * ratioheight); + elipse4_2.left := 94; + + // la + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 134; + end + else if num = 5 then + begin + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 28; + + // fa # + elipse5_2.top := round(26 * ratioheight); + elipse5_2.left := 94; + + // la + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 134; + end; + end + else if ((withsharp.Value = False) and (ranchord = 4) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 6) and (ismin <> 1)) then + begin + // ré min + if num = 1 then + begin + // ré + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 28; + + // fa + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 80; + + // la + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 134; + end + else if num = 2 then + begin + // ré + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 28; + + // fa + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 80; + + // la + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 134; + end + else if num = 3 then + begin + // ré + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 28; + + // fa + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 80; + + // la + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 134; + end + else if num = 4 then + begin + // ré + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 28; + + // fa + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 80; + + // la + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 134; + end + else if num = 5 then + begin + // ré + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 28; + + // fa + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 80; + + // la + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 134; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 5) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 8) and (ismin = 1)) then + begin + // mi Maj + if num = 1 then + begin + // mi + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 54; + + // sol # + elipse1_2.top := round(24 * ratioheight); + elipse1_2.left := 122; + + // si + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 162; + end + else if num = 2 then + begin + // mi + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 54; + + // sol # + elipse2_2.top := round(24 * ratioheight); + elipse2_2.left := 122; + + // si + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 162; + end + else if num = 3 then + begin + // mi + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 54; + + // sol # + elipse3_2.top := round(24 * ratioheight); + elipse3_2.left := 122; + + // si + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 162; + end + else if num = 4 then + begin + // mi + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 54; + + // sol # + elipse4_2.top := round(24 * ratioheight); + elipse4_2.left := 122; + + // si + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 162; + end + else if num = 5 then + begin + // mi + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 54; + + // sol # + elipse5_2.top := round(24 * ratioheight); + elipse5_2.left := 122; + + // si + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 162; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 5) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 8) and (ismin <> 1)) then + begin + // mi min + // mi + if num = 1 then + begin + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 54; + + // sol + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 108; + + // si + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 162; + end + else if num = 2 then + begin + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 54; + + // sol + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 108; + + // si + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 162; + end + else if num = 3 then + begin + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 54; + + // sol + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 108; + + // si + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 162; + end + else if num = 4 then + begin + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 54; + + // sol + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 108; + + // si + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 162; + end + else if num = 5 then + begin + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 54; + + // sol + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 108; + + // si + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 162; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 6) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 9) and (ismin = 1)) then + begin + // fa Maj + if num = 1 then + begin + // fa + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 80; + + // la + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 134; + + // do 2 + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 190; + end + else if num = 2 then + begin + // fa + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 80; + + // la + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 134; + + // do 2 + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 190; + end + else if num = 3 then + begin + // fa + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 80; + + // la + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 134; + + // do 2 + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 190; + end + else if num = 4 then + begin + // fa + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 80; + + // la + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 134; + + // do 2 + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 190; + end + else if num = 5 then + begin + // fa + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 80; + + // la + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 134; + + // do 2 + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 190; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 6) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 9) and (ismin <> 1)) then + begin + // fa min + if num = 1 then + begin + // fa + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 80; + + // la + elipse1_2.top := round(24 * ratioheight); + elipse1_2.left := 120; + + // do 2 + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 190; + end + else if num = 2 then + begin + // fa + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 80; + + // la + elipse2_2.top := round(24 * ratioheight); + elipse2_2.left := 120; + + // do 2 + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 190; + end + else if num = 3 then + begin + // fa + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 80; + + // la + elipse3_2.top := round(24 * ratioheight); + elipse3_2.left := 120; + + // do 2 + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 190; + end + else if num = 4 then + begin + // fa + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 80; + + // la + elipse4_2.top := round(24 * ratioheight); + elipse4_2.left := 120; + + // do 2 + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 190; + end + else if num = 5 then + begin + // fa + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 80; + + // la + elipse5_2.top := round(24 * ratioheight); + elipse5_2.left := 120; + + // do 2 + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 190; + end; + end + else if ((withsharp.Value = False) and (ranchord = 7) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 11) and (ismin = 1)) then + begin + // sol Maj + // sol + if num = 1 then + begin + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 108; + + // si + elipse1_2.top := round(96 * ratioheight); + elipse1_2.left := 160; + + // ré 2 + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 218; + end + else if num = 2 then + begin + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 108; + + // si + elipse2_2.top := round(96 * ratioheight); + elipse2_2.left := 160; + + // ré 2 + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 218; + end + else if num = 3 then + begin + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 108; + + // si + elipse3_2.top := round(96 * ratioheight); + elipse3_2.left := 160; + + // ré 2 + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 218; + end + else if num = 4 then + begin + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 108; + + // si + elipse4_2.top := round(96 * ratioheight); + elipse4_2.left := 160; + + // ré 2 + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 218; + end + else if num = 5 then + begin + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 108; + + // si + elipse5_2.top := round(96 * ratioheight); + elipse5_2.left := 160; + + // ré 2 + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 218; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 7) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 11) and (ismin <> 1)) then + begin + // sol min + if num = 1 then + begin + // sol + elipse1_1.top := round(96 * ratioheight); + elipse1_1.left := 108; + + // la# + elipse1_2.top := round(24 * ratioheight); + elipse1_2.left := 148; + + // ré 2 + elipse1_3.top := round(96 * ratioheight); + elipse1_3.left := 218; + end + else if num = 2 then + begin + // sol + elipse2_1.top := round(96 * ratioheight); + elipse2_1.left := 108; + + // la# + elipse2_2.top := round(24 * ratioheight); + elipse2_2.left := 148; + + // ré 2 + elipse2_3.top := round(96 * ratioheight); + elipse2_3.left := 218; + end + else if num = 3 then + begin + // sol + elipse3_1.top := round(96 * ratioheight); + elipse3_1.left := 108; + + // la# + elipse3_2.top := round(24 * ratioheight); + elipse3_2.left := 148; + + // ré 2 + elipse3_3.top := round(96 * ratioheight); + elipse3_3.left := 218; + end + else if num = 4 then + begin + // sol + elipse4_1.top := round(96 * ratioheight); + elipse4_1.left := 108; + + // la# + elipse4_2.top := round(24 * ratioheight); + elipse4_2.left := 148; + + // ré 2 + elipse4_3.top := round(96 * ratioheight); + elipse4_3.left := 218; + end + else if num = 5 then + begin + // sol + elipse5_1.top := round(96 * ratioheight); + elipse5_1.left := 108; + + // la# + elipse5_2.top := round(24 * ratioheight); + elipse5_2.left := 148; + + // ré 2 + elipse5_3.top := round(96 * ratioheight); + elipse5_3.left := 218; + end; + end + else if num = 1 then + begin + elipse1_1.Visible := False; + elipse1_2.Visible := False; + elipse1_3.Visible := False; + end + else if num = 2 then + begin + elipse2_1.Visible := False; + elipse2_2.Visible := False; + elipse2_3.Visible := False; + end + else if num = 3 then + begin + elipse3_1.Visible := False; + elipse3_2.Visible := False; + elipse3_3.Visible := False; + end + else if num = 4 then + begin + elipse4_1.Visible := False; + elipse4_2.Visible := False; + elipse4_3.Visible := False; + end + else if num = 5 then + begin + elipse5_1.Visible := False; + elipse5_2.Visible := False; + elipse5_3.Visible := False; + end; + +end; + +procedure trandomnotefo.basschord(num, ranchord, ismin, isseven: integer); +var + ratioheight: double; +begin + ratioheight := (bchord1.Height / 158); + + if num = 1 then + belipse1_1.Visible := True// belipse1_2.visible := true; + // belipse1_3.visible := true; + else if num = 2 then + belipse2_1.Visible := True// belipse2_2.visible := true; + // belipse2_3.visible := true; + else if num = 3 then + belipse3_1.Visible := True// belipse3_2.visible := true; + // belipse3_3.visible := true; + else if num = 4 then + belipse4_1.Visible := True + else if num = 5 then + belipse5_1.Visible := True; + + if (ranchord = 1) and (ismin = 1) then + // La maj + begin + if num = 1 then + begin + // la + belipse1_1.top := round(130 * ratioheight); + belipse1_1.left := 10; + + // do# 2 + belipse1_2.top := 24; + belipse1_2.left := 201; + + // mi 2 + belipse1_3.top := 96; + belipse1_3.left := 240; + end + else if num = 2 then + begin + // la + belipse2_1.top := round(130 * ratioheight); + belipse2_1.left := 10; + + // do# 2 + belipse2_2.top := 24; + belipse2_2.left := 201; + + // mi 2 + belipse2_3.top := 96; + belipse2_3.left := 240; + end + else if num = 3 then + begin + // la + belipse3_1.top := round(130 * ratioheight); + belipse3_1.left := 10; + + // do# 2 + belipse3_2.top := 24; + belipse3_2.left := 201; + + // mi 2 + belipse3_3.top := 96; + belipse3_3.left := 240; + end + else if num = 4 then + begin + // la + belipse4_1.top := round(130 * ratioheight); + belipse4_1.left := 10; + + // do# 2 + belipse4_2.top := 24; + belipse4_2.left := 201; + + // mi 2 + belipse4_3.top := 96; + belipse4_3.left := 240; + end + else if num = 5 then + begin + // la + belipse5_1.top := round(130 * ratioheight); + belipse5_1.left := 10; + + // do# 2 + belipse5_2.top := 24; + belipse5_2.left := 201; + + // mi 2 + belipse5_3.top := 96; + belipse5_3.left := 240; + end; + + end + else if (ranchord = 1) and (ismin <> 1) then + // La min + begin + if num = 1 then + begin + // la + belipse1_1.top := round(130 * ratioheight); + belipse1_1.left := 10; + + // do 2 + belipse1_2.top := 96; + belipse1_2.left := 188; + + // mi 2 + belipse1_3.top := 96; + belipse1_3.left := 240; + end + else if num = 2 then + begin + // la + belipse2_1.top := round(130 * ratioheight); + belipse2_1.left := 10; + + // do 2 + belipse2_2.top := 96; + belipse2_2.left := 188; + + // mi 2 + belipse2_3.top := 96; + belipse2_3.left := 240; + end + else if num = 3 then + begin + // la + belipse3_1.top := round(130 * ratioheight); + belipse3_1.left := 10; + + // do 2 + belipse3_2.top := 96; + belipse3_2.left := 188; + + // mi 2 + belipse3_3.top := 96; + belipse3_3.left := 240; + end + else if num = 4 then + begin + // la + belipse4_1.top := round(130 * ratioheight); + belipse4_1.left := 10; + + // do 2 + belipse4_2.top := 96; + belipse4_2.left := 188; + + // mi 2 + belipse4_3.top := 96; + belipse4_3.left := 240; + end + else if num = 5 then + begin + // la + belipse5_1.top := round(130 * ratioheight); + belipse5_1.left := 10; + + // do 2 + belipse5_2.top := 96; + belipse5_2.left := 188; + + // mi 2 + belipse5_3.top := 96; + belipse5_3.left := 240; + end; + end + else if ((withsharp.Value = False) and (ranchord = 2) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 3) and (ismin = 1)) then + begin + // Si Maj + if num = 1 then + begin + // fa# + belipse1_1.top := round(42 * ratioheight); + belipse1_1.left := 38; + + // si + belipse1_2.top := 96; + belipse1_2.left := 160; + + // ré# 2 + belipse1_3.top := 24; + belipse1_3.left := 228; + end + else if num = 2 then + begin + // fa# + belipse2_1.top := round(42 * ratioheight); + belipse2_1.left := 38; + + // si + belipse2_2.top := 96; + belipse2_2.left := 160; + + // ré# 2 + belipse2_3.top := 24; + belipse2_3.left := 228; + end + else if num = 3 then + begin + // fa# + belipse3_1.top := round(42 * ratioheight); + belipse3_1.left := 38; + + // si + belipse3_2.top := 96; + belipse3_2.left := 160; + + // ré# 2 + belipse3_3.top := 24; + belipse3_3.left := 228; + end + else if num = 4 then + begin + // fa# + belipse4_1.top := round(42 * ratioheight); + belipse4_1.left := 38; + + // si + belipse4_2.top := 96; + belipse4_2.left := 160; + + // ré# 2 + belipse4_3.top := 24; + belipse4_3.left := 228; + end + else if num = 5 then + begin + // fa# + belipse5_1.top := round(42 * ratioheight); + belipse5_1.left := 38; + + // si + belipse5_2.top := 96; + belipse5_2.left := 160; + + // ré# 2 + belipse5_3.top := 24; + belipse5_3.left := 228; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 2) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 3) and (ismin <> 1)) then + begin + // Si min + if num = 1 then + begin + // fa# + belipse1_1.top := round(42 * ratioheight); + belipse1_1.left := 38; + + // si + belipse1_2.top := 96; + belipse1_2.left := 160; + + // ré 2 + belipse1_3.top := 96; + belipse1_3.left := 214; + end + else if num = 2 then + begin + // fa# + belipse2_1.top := round(42 * ratioheight); + belipse2_1.left := 38; + + // si + belipse2_2.top := 96; + belipse2_2.left := 160; + + // ré 2 + belipse2_3.top := 96; + belipse2_3.left := 214; + end + else if num = 3 then + begin + // fa# + belipse3_1.top := round(42 * ratioheight); + belipse3_1.left := 38; + + // si + belipse3_2.top := 96; + belipse3_2.left := 160; + + // ré 2 + belipse3_3.top := 96; + belipse3_3.left := 214; + end + else if num = 4 then + begin + // fa# + belipse4_1.top := round(42 * ratioheight); + belipse4_1.left := 38; + + // si + belipse4_2.top := 96; + belipse4_2.left := 160; + + // ré 2 + belipse4_3.top := 96; + belipse4_3.left := 214; + end + else if num = 5 then + begin + // fa# + belipse5_1.top := round(42 * ratioheight); + belipse5_1.left := 38; + + // si + belipse5_2.top := 96; + belipse5_2.left := 160; + + // ré 2 + belipse5_3.top := 96; + belipse5_3.left := 214; + end; + end + else if ((withsharp.Value = False) and (ranchord = 3) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 4) and (ismin = 1)) then + begin + // do Maj + + if num = 1 then + begin + // do + belipse1_1.top := round(74 * ratioheight); + belipse1_1.left := 38; + + // mi + belipse1_2.top := 96; + belipse1_2.left := 54; + + // sol + belipse1_3.top := 96; + belipse1_3.left := 108; + end + else if num = 2 then + begin + // do + belipse2_1.top := round(74 * ratioheight); + belipse2_1.left := 38; + + // mi + belipse2_2.top := 96; + belipse2_2.left := 54; + + // sol + belipse2_3.top := 96; + belipse2_3.left := 108; + end + else if num = 3 then + begin + // do + belipse3_1.top := round(74 * ratioheight); + belipse3_1.left := 38; + + // mi + belipse3_2.top := 96; + belipse3_2.left := 54; + + // sol + belipse3_3.top := 96; + belipse3_3.left := 108; + end + else if num = 4 then + begin + // do + belipse4_1.top := round(74 * ratioheight); + belipse4_1.left := 38; + + // mi + belipse4_2.top := 96; + belipse4_2.left := 54; + + // sol + belipse4_3.top := 96; + belipse4_3.left := 108; + end + else if num = 5 then + begin + // do + belipse5_1.top := round(74 * ratioheight); + belipse5_1.left := 38; + + // mi + belipse5_2.top := 96; + belipse5_2.left := 54; + + // sol + belipse5_3.top := 96; + belipse5_3.left := 108; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 3) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 4) and (ismin <> 1)) then + begin + // do min + if num = 1 then + begin + // do + belipse1_1.top := round(74 * ratioheight); + belipse1_1.left := 38; + + // ré # + belipse1_2.top := 24; + belipse1_2.left := 40; + + // sol + belipse1_3.top := 96; + belipse1_3.left := 108; + end + else if num = 2 then + begin + // do + belipse2_1.top := round(74 * ratioheight); + belipse2_1.left := 38; + + // ré # + belipse2_2.top := 24; + belipse2_2.left := 40; + + // sol + belipse2_3.top := 96; + belipse2_3.left := 108; + end + else if num = 3 then + begin + // do + belipse3_1.top := round(74 * ratioheight); + belipse3_1.left := 38; + + // ré # + belipse3_2.top := 24; + belipse3_2.left := 40; + + // sol + belipse3_3.top := 96; + belipse3_3.left := 108; + end + else if num = 4 then + begin + // do + belipse4_1.top := round(74 * ratioheight); + belipse4_1.left := 38; + + // ré # + belipse4_2.top := 24; + belipse4_2.left := 40; + + // sol + belipse4_3.top := 96; + belipse4_3.left := 108; + end + else if num = 5 then + begin + // do + belipse5_1.top := round(74 * ratioheight); + belipse5_1.left := 38; + + // ré # + belipse5_2.top := 24; + belipse5_2.left := 40; + + // sol + belipse5_3.top := 96; + belipse5_3.left := 108; + end; + end + else if ((withsharp.Value = False) and (ranchord = 4) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 6) and (ismin = 1)) then + begin + // ré Maj + // ré + if num = 1 then + begin + belipse1_1.top := round(128 * ratioheight); + belipse1_1.left := 36; + + // fa # + belipse1_2.top := 26; + belipse1_2.left := 94; + + // la + belipse1_3.top := 96; + belipse1_3.left := 134; + end + else if num = 2 then + begin + belipse2_1.top := round(128 * ratioheight); + belipse2_1.left := 36; + + // fa # + belipse2_2.top := 26; + belipse2_2.left := 94; + + // la + belipse2_3.top := 96; + belipse2_3.left := 134; + end + else if num = 3 then + begin + belipse3_1.top := round(128 * ratioheight); + belipse3_1.left := 36; + + // fa # + belipse3_2.top := 26; + belipse3_2.left := 94; + + // la + belipse3_3.top := 96; + belipse3_3.left := 134; + end + else if num = 4 then + begin + belipse4_1.top := round(128 * ratioheight); + belipse4_1.left := 36; + + // fa # + belipse4_2.top := 26; + belipse4_2.left := 94; + + // la + belipse4_3.top := 96; + belipse4_3.left := 134; + end + else if num = 5 then + begin + belipse5_1.top := round(128 * ratioheight); + belipse5_1.left := 36; + + // fa # + belipse5_2.top := 26; + belipse5_2.left := 94; + + // la + belipse5_3.top := 96; + belipse5_3.left := 134; + end; + end + else if ((withsharp.Value = False) and (ranchord = 4) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 6) and (ismin <> 1)) then + begin + // ré min + if num = 1 then + begin + // ré + belipse1_1.top := round(128 * ratioheight); + belipse1_1.left := 36; + + // fa + belipse1_2.top := 96; + belipse1_2.left := 80; + + // la + belipse1_3.top := 96; + belipse1_3.left := 134; + end + else if num = 2 then + begin + // ré + belipse2_1.top := round(128 * ratioheight); + belipse2_1.left := 36; + + // fa + belipse2_2.top := 96; + belipse2_2.left := 80; + + // la + belipse2_3.top := 96; + belipse2_3.left := 134; + end + else if num = 3 then + begin + // ré + belipse3_1.top := round(128 * ratioheight); + belipse3_1.left := 36; + + // fa + belipse3_2.top := 96; + belipse3_2.left := 80; + + // la + belipse3_3.top := 96; + belipse3_3.left := 134; + end + else if num = 4 then + begin + // ré + belipse4_1.top := round(128 * ratioheight); + belipse4_1.left := 36; + + // fa + belipse4_2.top := 96; + belipse4_2.left := 80; + + // la + belipse4_3.top := 96; + belipse4_3.left := 134; + end + else if num = 5 then + begin + // ré + belipse5_1.top := round(128 * ratioheight); + belipse5_1.left := 36; + + // fa + belipse5_2.top := 96; + belipse5_2.left := 80; + + // la + belipse5_3.top := 96; + belipse5_3.left := 134; + end; + end + else if ((withsharp.Value = False) and (ranchord = 5) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 8) and (ismin = 1)) then + begin + // mi Maj + if num = 1 then + begin + // mi + belipse1_1.top := round(42 * ratioheight); + belipse1_1.left := 68; + + // sol # + belipse1_2.top := 24; + belipse1_2.left := 122; + + // si + belipse1_3.top := 96; + belipse1_3.left := 162; + end + else if num = 2 then + begin + // mi + belipse2_1.top := round(42 * ratioheight); + belipse2_1.left := 68; + + // sol # + belipse2_2.top := 24; + belipse2_2.left := 122; + + // si + belipse2_3.top := 96; + belipse2_3.left := 162; + end + else if num = 3 then + begin + // mi + belipse3_1.top := round(42 * ratioheight); + belipse3_1.left := 68; + + // sol # + belipse3_2.top := 24; + belipse3_2.left := 122; + + // si + belipse3_3.top := 96; + belipse3_3.left := 162; + end + else if num = 4 then + begin + // mi + belipse4_1.top := round(42 * ratioheight); + belipse4_1.left := 68; + + // sol # + belipse4_2.top := 24; + belipse4_2.left := 122; + + // si + belipse4_3.top := 96; + belipse4_3.left := 162; + end + else if num = 5 then + begin + // mi + belipse5_1.top := round(42 * ratioheight); + belipse5_1.left := 68; + + // sol # + belipse5_2.top := 24; + belipse5_2.left := 122; + + // si + belipse5_3.top := 96; + belipse5_3.left := 162; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 5) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 8) and (ismin <> 1)) then + begin + // mi min + // mi + if num = 1 then + begin + belipse1_1.top := round(42 * ratioheight); + belipse1_1.left := 68; + + // sol + belipse1_2.top := 96; + belipse1_2.left := 108; + + // si + belipse1_3.top := 96; + belipse1_3.left := 162; + end + else if num = 2 then + begin + belipse2_1.top := round(42 * ratioheight); + belipse2_1.left := 68; + + // sol + belipse2_2.top := 96; + belipse2_2.left := 108; + + // si + belipse2_3.top := 96; + belipse2_3.left := 162; + end + else if num = 3 then + begin + belipse3_1.top := round(42 * ratioheight); + belipse3_1.left := 68; + + // sol + belipse3_2.top := 96; + belipse3_2.left := 108; + + // si + belipse3_3.top := 96; + belipse3_3.left := 162; + end + else if num = 4 then + begin + belipse4_1.top := round(42 * ratioheight); + belipse4_1.left := 68; + + // sol + belipse4_2.top := 96; + belipse4_2.left := 108; + + // si + belipse4_3.top := 96; + belipse4_3.left := 162; + end + else if num = 5 then + begin + belipse5_1.top := round(42 * ratioheight); + belipse5_1.left := 68; + + // sol + belipse5_2.top := 96; + belipse5_2.left := 108; + + // si + belipse5_3.top := 96; + belipse5_3.left := 162; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 6) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 9) and (ismin = 1)) then + begin + // fa Maj + if num = 1 then + begin + // fa + belipse1_1.top := round(8 * ratioheight); + belipse1_1.left := 12; + + // la + belipse1_2.top := 96; + belipse1_2.left := 134; + + // do 2 + belipse1_3.top := 96; + belipse1_3.left := 190; + end + else if num = 2 then + begin + // fa + belipse2_1.top := round(8 * ratioheight); + belipse2_1.left := 12; + + // la + belipse2_2.top := 96; + belipse2_2.left := 134; + + // do 2 + belipse2_3.top := 96; + belipse2_3.left := 190; + end + else if num = 3 then + begin + // fa + belipse3_1.top := round(8 * ratioheight); + belipse3_1.left := 12; + + // la + belipse3_2.top := 96; + belipse3_2.left := 134; + + // do 2 + belipse3_3.top := 96; + belipse3_3.left := 190; + end + else if num = 4 then + begin + // fa + belipse4_1.top := round(8 * ratioheight); + belipse4_1.left := 12; + + // la + belipse4_2.top := 96; + belipse4_2.left := 134; + + // do 2 + belipse4_3.top := 96; + belipse4_3.left := 190; + end + else if num = 5 then + begin + // fa + belipse5_1.top := round(8 * ratioheight); + belipse5_1.left := 12; + + // la + belipse5_2.top := 96; + belipse5_2.left := 134; + + // do 2 + belipse5_3.top := 96; + belipse5_3.left := 190; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 6) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 9) and (ismin <> 1)) then + begin + // fa min + if num = 1 then + begin + // fa + belipse1_1.top := round(8 * ratioheight); + belipse1_1.left := 12; + + // la + belipse1_2.top := 24; + belipse1_2.left := 120; + + // do 2 + belipse1_3.top := 96; + belipse1_3.left := 190; + end + else if num = 2 then + begin + // fa + belipse2_1.top := round(8 * ratioheight); + belipse2_1.left := 12; + + // la + belipse2_2.top := 24; + belipse2_2.left := 120; + + // do 2 + belipse2_3.top := 96; + belipse2_3.left := 190; + end + else if num = 3 then + begin + // fa + belipse3_1.top := round(8 * ratioheight); + belipse3_1.left := 12; + + // la + belipse3_2.top := 24; + belipse3_2.left := 120; + + // do 2 + belipse3_3.top := 96; + belipse3_3.left := 190; + end + else if num = 4 then + begin + // fa + belipse4_1.top := round(8 * ratioheight); + belipse4_1.left := 12; + + // la + belipse4_2.top := 24; + belipse4_2.left := 120; + + // do 2 + belipse4_3.top := 96; + belipse4_3.left := 190; + end + else if num = 5 then + begin + // fa + belipse5_1.top := round(8 * ratioheight); + belipse5_1.left := 12; + + // la + belipse5_2.top := 24; + belipse5_2.left := 120; + + // do 2 + belipse5_3.top := 96; + belipse5_3.left := 190; + end; + end + else if ((withsharp.Value = False) and (ranchord = 7) and (ismin = 1)) or + ((withsharp.Value = True) and (ranchord = 11) and (ismin = 1)) then + begin + // sol Maj + // sol + if num = 1 then + begin + belipse1_1.top := round(74 * ratioheight); + belipse1_1.left := 10; + + // si + belipse1_2.top := 96; + belipse1_2.left := 160; + + // ré 2 + belipse1_3.top := 96; + belipse1_3.left := 218; + end + else if num = 2 then + begin + belipse2_1.top := round(74 * ratioheight); + belipse2_1.left := 10; + + // si + belipse2_2.top := 96; + belipse2_2.left := 160; + + // ré 2 + belipse2_3.top := 96; + belipse2_3.left := 218; + end + else if num = 3 then + begin + belipse3_1.top := round(74 * ratioheight); + belipse3_1.left := 10; + + // si + belipse3_2.top := 96; + belipse3_2.left := 160; + + // ré 2 + belipse3_3.top := 96; + belipse3_3.left := 218; + end + else if num = 4 then + begin + belipse4_1.top := round(74 * ratioheight); + belipse4_1.left := 10; + + // si + belipse4_2.top := 96; + belipse4_2.left := 160; + + // ré 2 + belipse4_3.top := 96; + belipse4_3.left := 218; + end + else if num = 5 then + begin + belipse5_1.top := round(74 * ratioheight); + belipse5_1.left := 10; + + // si + belipse5_2.top := 96; + belipse5_2.left := 160; + + // ré 2 + belipse5_3.top := 96; + belipse5_3.left := 218; + end; + + end + else if ((withsharp.Value = False) and (ranchord = 7) and (ismin <> 1)) or + ((withsharp.Value = True) and (ranchord = 11) and (ismin <> 1)) then + begin + // sol min + if num = 1 then + begin + // sol + belipse1_1.top := round(74 * ratioheight); + belipse1_1.left := 10; + + // la# + belipse1_2.top := 24; + belipse1_2.left := 148; + + // ré 2 + belipse1_3.top := 96; + belipse1_3.left := 218; + end + else if num = 2 then + begin + // sol + belipse2_1.top := round(74 * ratioheight); + belipse2_1.left := 10; + + // la# + belipse2_2.top := 24; + belipse2_2.left := 148; + + // ré 2 + belipse2_3.top := 96; + belipse2_3.left := 218; + end + else if num = 3 then + begin + // sol + belipse3_1.top := round(74 * ratioheight); + belipse3_1.left := 10; + + // la# + belipse3_2.top := 24; + belipse3_2.left := 148; + + // ré 2 + belipse3_3.top := 96; + belipse3_3.left := 218; + end + else if num = 4 then + begin + // sol + belipse4_1.top := round(74 * ratioheight); + belipse4_1.left := 10; + + // la# + belipse4_2.top := 24; + belipse4_2.left := 148; + + // ré 2 + belipse4_3.top := 96; + belipse4_3.left := 218; + end + else if num = 5 then + begin + // sol + belipse5_1.top := round(74 * ratioheight); + belipse5_1.left := 10; + + // la# + belipse5_2.top := 24; + belipse5_2.left := 148; + + // ré 2 + belipse5_3.top := 96; + belipse5_3.left := 218; + end; + end + else if num = 1 then + begin + belipse1_1.Visible := False; + belipse1_2.Visible := False; + belipse1_3.Visible := False; + end + else if num = 2 then + begin + belipse2_1.Visible := False; + belipse2_2.Visible := False; + belipse2_3.Visible := False; + end + else if num = 3 then + begin + belipse3_1.Visible := False; + belipse3_2.Visible := False; + belipse3_3.Visible := False; + end + else if num = 4 then + begin + belipse4_1.Visible := False; + belipse4_2.Visible := False; + belipse4_3.Visible := False; + end + else if num = 5 then + begin + belipse5_1.Visible := False; + belipse5_2.Visible := False; + belipse5_3.Visible := False; + end; +end; + +procedure trandomnotefo.dorandomchordbut(const Sender: TObject); +begin + if blocked = 0 then + begin + blocked := 1; + dorandomchord(Sender); + + if bosound.Value then + playrandomchords(TButton(Sender).tag - 1); + application.ProcessMessages; + blocked := 0; + end; +end; + +procedure trandomnotefo.dorandomchord(const Sender: TObject); +var + str2, str3: msestring; + ismin, isseven, x, ranchord: integer; + isminstr, issevenstr: msestring; +begin + refreshform(Sender); + x := 0; + + if Sender is TButton then + begin + while x < 50 do + begin + + if (boolmajor.Value) and (boolminor.Value) then + + ismin := Random(2) + else + if (boolmajor.Value) and (boolminor.Value = False) then + ismin := 1 + else + if (boolmajor.Value = False) and (boolminor.Value) then + ismin := 0 + else + ismin := 1; + + if ismin = 1 then + begin + isminstr := ''; + str3 := 'Major'; + end + else + begin + isminstr := 'm'; + str3 := 'minor'; + end; + + if (bool7th.Value) then + + isseven := Random(2) + else + isseven := 0; + + // isseven := 0 ; + + if isseven = 1 then + issevenstr := '7' + else + issevenstr := ''; + + + str3 := lineend + str3 + ' ' + issevenstr; + + if withsharp.Value = False then + begin + ranchord := Random(7) + 1; + if ranchord = 1 then + str2 := 'A / La' + str3 + else if ranchord = 2 then + str2 := 'B / Si' + str3 + else if ranchord = 3 then + str2 := 'C / Do' + str3 + else if ranchord = 4 then + str2 := 'D / Ré' + str3 + else if ranchord = 5 then + str2 := 'E / Mi' + str3 + else if ranchord = 6 then + str2 := 'F / Fa' + str3 + else if ranchord = 7 then + str2 := 'G / Sol' + str3; + + end + else + begin + ranchord := Random(12) + 1; + if ranchord = 1 then + str2 := 'A / La' + str3 + else if ranchord = 2 then + str2 := 'A# / La#' + str3 + else if ranchord = 3 then + str2 := 'B / Si' + str3 + else if ranchord = 4 then + str2 := 'C / Do' + str3 + else if ranchord = 5 then + str2 := 'C# / Do#' + str3 + else if ranchord = 6 then + str2 := 'D / Ré' + str3 + else if ranchord = 7 then + str2 := 'D# / Ré#' + str3 + else if ranchord = 8 then + str2 := 'E / Mi' + str3 + else if ranchord = 9 then + str2 := 'F / Fa' + str3 + else if ranchord = 10 then + str2 := 'F# / Fa#' + str3 + else if ranchord = 11 then + str2 := 'G / Sol' + str3 + else if ranchord = 12 then + str2 := 'G# / Sol#' + str3; + end; + + if ((Sender is TButton) and (TButton(Sender).tag = 0)) then + begin + if chordran = 1 then + begin + chord1.Caption := str2; + chord1drop.Value := str2; + chordmem1 := copy(str2, 1, 1) + isminstr + issevenstr; + end + else if chordran = 2 then + begin + chord2.Caption := str2; + chord2drop.Value := str2; + chordmem2 := copy(str2, 1, 1) + isminstr + issevenstr; + end + else if chordran = 3 then + begin + chord3.Caption := str2; + chord3drop.Value := str2; + chordmem3 := copy(str2, 1, 1) + isminstr + issevenstr; + end + else if chordran = 4 then + begin + chord4.Caption := str2; + chord4drop.Value := str2; + chordmem4 := copy(str2, 1, 1) + isminstr + issevenstr; + end + else if chordran = 5 then + begin + chord5.Caption := str2; + chord5drop.Value := str2; + chordmem5 := copy(str2, 1, 1) + isminstr + issevenstr; + end; + + if (x = 49) then + begin + pianochord(chordran, ranchord, ismin, isseven); + guitarchord(chordran, ranchord, ismin, isseven); + basschord(chordran, ranchord, ismin, isseven); + refreshform(Sender); + end; + end + else + begin + if (TButton(Sender).tag = 1) then + begin + chord1.Caption := str2; + chord1drop.Value := str2; + chordmem1 := copy(str2, 1, 1) + isminstr + issevenstr; + end + else if (TButton(Sender).tag = 2) then + begin + chord2.Caption := str2; + chord2drop.Value := str2; + chordmem2 := copy(str2, 1, 1) + isminstr + issevenstr; + end + else if (TButton(Sender).tag = 3) then + begin + chordmem3 := copy(str2, 1, 1) + isminstr + issevenstr; + chord3.Caption := str2; + chord3drop.Value := str2; + end + else if TButton(Sender).tag = 4 then + begin + chordmem4 := copy(str2, 1, 1) + isminstr + issevenstr; + chord4.Caption := str2; + chord4drop.Value := str2; + end + else if TButton(Sender).tag = 5 then + begin + chordmem5 := copy(str2, 1, 1) + isminstr + issevenstr; + chord5.Caption := str2; + chord5drop.Value := str2; + end; - if bosound.value then + if (x = 49) then begin - playrandomchords(TButton(Sender).tag - 1); + pianochord(TButton(Sender).tag, ranchord, ismin, isseven); + guitarchord(TButton(Sender).tag, ranchord, ismin, isseven); + basschord(TButton(Sender).tag, ranchord, ismin, isseven); + refreshform(Sender); end; + end; + + Inc(x); application.ProcessMessages; - blocked := 0; + sleep(20); end; -end; -procedure trandomnotefo.dorandomchord(Const Sender: TObject); -var - str2, str3: msestring; - ismin, isseven, x, ranchord: integer; - isminstr, issevenstr: msestring; -begin - refreshform(Sender); - x := 0; + end + else // drop box - if Sender is TButton then + if (Sender is tdropdownlistedit) then + begin + if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'A' then + ranchord := 1 + else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'B' then + ranchord := 2 + else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'C' then + ranchord := 3 + else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'D' then + ranchord := 4 + else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'E' then + ranchord := 5 + else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'F' then + ranchord := 6 + else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'G' then + ranchord := 7; + + if System.Pos('Major', tdropdownlistedit(Sender).Value) > 0 then begin - while x < 50 do - begin - - if (boolmajor.value) and (boolminor.value) then - - ismin := Random(2) - else - - if (boolmajor.value) and (boolminor.value = false) then - ismin := 1 - else - - if (boolmajor.value = false) and (boolminor.value) then - ismin := 0 - else ismin := 1; - - if ismin = 1 then - begin - isminstr := ''; - str3 := 'Major'; - end - else - begin - isminstr := 'm'; - str3 := 'minor'; - end; - - if (bool7th.value) then - - isseven := Random(2) - else isseven := 0; - - // isseven := 0 ; - - if isseven = 1 then issevenstr := '7' - else issevenstr := ''; - - - str3 := lineend + str3 + ' ' + issevenstr; - - if withsharp.Value = False then - begin - ranchord := Random(7) + 1; - if ranchord = 1 then - str2 := 'A / La' + str3 - else if ranchord = 2 then - str2 := 'B / Si' + str3 - else if ranchord = 3 then - str2 := 'C / Do' + str3 - else if ranchord = 4 then - str2 := 'D / Ré' + str3 - else if ranchord = 5 then - str2 := 'E / Mi' + str3 - else if ranchord = 6 then - str2 := 'F / Fa' + str3 - else if ranchord = 7 then - str2 := 'G / Sol' + str3; - - end - else - begin - ranchord := Random(12) + 1; - if ranchord = 1 then - str2 := 'A / La' + str3 - else if ranchord = 2 then - str2 := 'A# / La#' + str3 - else if ranchord = 3 then - str2 := 'B / Si' + str3 - else if ranchord = 4 then - str2 := 'C / Do' + str3 - else if ranchord = 5 then - str2 := 'C# / Do#' + str3 - else if ranchord = 6 then - str2 := 'D / Ré' + str3 - else if ranchord = 7 then - str2 := 'D# / Ré#' + str3 - else if ranchord = 8 then - str2 := 'E / Mi' + str3 - else if ranchord = 9 then - str2 := 'F / Fa' + str3 - else if ranchord = 10 then - str2 := 'F# / Fa#' + str3 - else if ranchord = 11 then - str2 := 'G / Sol' + str3 - else if ranchord = 12 then - str2 := 'G# / Sol#' + str3; - end; - - if ((Sender is TButton) and (TButton(Sender).tag = 0)) then - begin - if chordran = 1 then - begin - chord1.Caption := str2; - chord1drop.Value := str2; - chordmem1 := copy(str2, 1, 1) + isminstr + issevenstr; - end - else if chordran = 2 then - begin - chord2.Caption := str2; - chord2drop.Value := str2; - chordmem2 := copy(str2, 1, 1) + isminstr + issevenstr; - end - else if chordran = 3 then - begin - chord3.Caption := str2; - chord3drop.Value := str2; - chordmem3 := copy(str2, 1, 1) + isminstr + issevenstr; - end - else if chordran = 4 then - begin - chord4.Caption := str2; - chord4drop.Value := str2; - chordmem4 := copy(str2, 1, 1) + isminstr + issevenstr; - end - else if chordran = 5 then - begin - chord5.Caption := str2; - chord5drop.Value := str2; - chordmem5 := copy(str2, 1, 1) + isminstr + issevenstr; - end; - - if (x = 49) then - begin - pianochord(chordran, ranchord, ismin, isseven); - guitarchord(chordran, ranchord, ismin, isseven); - basschord(chordran, ranchord, ismin, isseven); - refreshform(Sender); - end; - end - else - begin - if (TButton(Sender).tag = 1) then - begin - chord1.Caption := str2; - chord1drop.Value := str2; - chordmem1 := copy(str2, 1, 1) + isminstr + issevenstr; - end - else if (TButton(Sender).tag = 2) then - begin - chord2.Caption := str2; - chord2drop.Value := str2; - chordmem2 := copy(str2, 1, 1) + isminstr + issevenstr; - end - else if (TButton(Sender).tag = 3) then - begin - chordmem3 := copy(str2, 1, 1) + isminstr + issevenstr; - chord3.Caption := str2; - chord3drop.Value := str2; - end - else if TButton(Sender).tag = 4 then - begin - chordmem4 := copy(str2, 1, 1) + isminstr + issevenstr; - chord4.Caption := str2; - chord4drop.Value := str2; - end - else if TButton(Sender).tag = 5 then - begin - chordmem5 := copy(str2, 1, 1) + isminstr + issevenstr; - chord5.Caption := str2; - chord5drop.Value := str2; - end; - - if (x = 49) then - begin - pianochord(TButton(Sender).tag, ranchord, ismin, isseven); - guitarchord(TButton(Sender).tag, ranchord, ismin, isseven); - basschord(TButton(Sender).tag, ranchord, ismin, isseven); - refreshform(Sender); - end; - end; - - Inc(x); - application.ProcessMessages; - sleep(20); - end; - + isminstr := ''; + ismin := 1; end - else // drop box - - if (Sender is tdropdownlistedit) then - begin - if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'A' then - ranchord := 1 - else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'B' then - ranchord := 2 - else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'C' then - ranchord := 3 - else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'D' then - ranchord := 4 - else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'E' then - ranchord := 5 - else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'F' then - ranchord := 6 - else if copy(tdropdownlistedit(Sender).Value, 1, 1) = 'G' then - ranchord := 7; - - if System.Pos('Major', tdropdownlistedit(Sender).Value) > 0 then - begin - isminstr := ''; - ismin := 1; - end - else - begin - isminstr := 'm'; - ismin := 0; - end; - - if (tdropdownlistedit(Sender).tag = 1) then - chordmem1 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr - else if (tdropdownlistedit(Sender).tag = 2) then - chordmem2 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr - else if (tdropdownlistedit(Sender).tag = 3) then - chordmem3 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr - else if (tdropdownlistedit(Sender).tag = 4) then - chordmem4 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr - else if (tdropdownlistedit(Sender).tag = 5) then - chordmem5 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr; - + else + begin + isminstr := 'm'; + ismin := 0; + end; - application.ProcessMessages; - pianochord(tdropdownlistedit(Sender).tag, ranchord, ismin, 0); - guitarchord(tdropdownlistedit(Sender).tag, ranchord, ismin, 0); - basschord(tdropdownlistedit(Sender).tag, ranchord, ismin, 0); - refreshform(Sender); - end; + if (tdropdownlistedit(Sender).tag = 1) then + chordmem1 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr + else if (tdropdownlistedit(Sender).tag = 2) then + chordmem2 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr + else if (tdropdownlistedit(Sender).tag = 3) then + chordmem3 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr + else if (tdropdownlistedit(Sender).tag = 4) then + chordmem4 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr + else if (tdropdownlistedit(Sender).tag = 5) then + chordmem5 := copy(tdropdownlistedit(Sender).Value, 1, 1) + isminstr; + + + application.ProcessMessages; + pianochord(tdropdownlistedit(Sender).tag, ranchord, ismin, 0); + guitarchord(tdropdownlistedit(Sender).tag, ranchord, ismin, 0); + basschord(tdropdownlistedit(Sender).tag, ranchord, ismin, 0); + refreshform(Sender); + end; end; -procedure trandomnotefo.oncreatedev(Const Sender: TObject); +procedure trandomnotefo.oncreatedev(const Sender: TObject); begin randomize; //tstringdisp1.text := 'Los acordes de la suerte' + -//lineend + lineend + '_____________________' + lineending + lineending + lineending + 'The chords of chance'; + //lineend + lineend + '_____________________' + lineending + lineending + lineending + 'The chords of chance'; // Visible := False; keyb2.bitmap := keyb1.bitmap; keyb3.bitmap := keyb1.bitmap; @@ -3952,12 +3975,12 @@ procedure trandomnotefo.oncreatedev(Const Sender: TObject); keyb5.bitmap := keyb1.bitmap; timage8.bitmap := timage1.bitmap; timage12.bitmap := timage1.bitmap; - timage9.bitmap := timage1.bitmap; + timage9.bitmap := timage1.bitmap; timage23.bitmap := timage1.bitmap; timage6.bitmap := timage2.bitmap; timage11.bitmap := timage2.bitmap; - timage15.bitmap := timage2.bitmap; + timage15.bitmap := timage2.bitmap; timage27.bitmap := timage2.bitmap; elipse1_2.bitmap := elipse1_1.bitmap; @@ -4005,401 +4028,399 @@ procedure trandomnotefo.oncreatedev(Const Sender: TObject); doinit(Sender); - - end; -procedure trandomnotefo.randomnum(Const Sender: TObject); -var +procedure trandomnotefo.randomnum(const Sender: TObject); +var x, ax: integer; begin if blocked = 0 then + begin + blocked := 1; + doclear(Sender); + numchord.Visible := True; + + tbutton5.Visible := False; + + bnbchords.Visible := False; + btnfixed.Visible := False; + + bnbchords.left := 130; + bnbchords.top := tbutton2.top; + bnbchords.Width := 202; + bnbchords.Height := tbutton2.Height; + + btnfixed.left := 338; + btnfixed.Width := 144; + btnfixed.Height := tbutton2.Height; + ; + btnfixed.top := bnbchords.top; + + bnbchords.font.Height := 30; + btnfixed.font.Height := 30; + + // bnbchords.left := 64; + // bnbchords.top := 184; + + // bnbchords.width := 400; + // bnbchords.height := 120; + tstringdisp1.Visible := False; + + if withrandom.Value = False then + numchord.Value := StrToInt(ansistring(maxnote.Value)) + else begin - blocked := 1; - doclear(Sender); - numchord.Visible := True; - tbutton5.Visible := False; + x := 0; + while x < 50 do + begin - bnbchords.Visible := False; - btnfixed.Visible := False; + numchord.Value := Random(StrToInt(ansistring(maxnote.Value))) + 1; + Inc(x); + application.ProcessMessages; + sleep(20); + end; + end; - bnbchords.left := 130; - bnbchords.top := tbutton2.top; - bnbchords.width := 202; - bnbchords.height := tbutton2.height; - btnfixed.left := 338; - btnfixed.width := 144; - btnfixed.height := tbutton2.height;; - btnfixed.top := bnbchords.top; + bchord1.Height := (Height div numchord.Value) - 10; - bnbchords.font.height := 30; - btnfixed.font.height := 30; + if numchord.Value > 0 then + begin - // bnbchords.left := 64; - // bnbchords.top := 184; + bchord1.top := 2; - // bnbchords.width := 400; - // bnbchords.height := 120; - tstringdisp1.Visible := False; + chord1.Height := bchord1.Height; + piano1.Height := bchord1.Height; + bass1.Height := bchord1.Height; + chord1.top := bchord1.top; + piano1.top := bchord1.top; + bass1.top := bchord1.top; + guitar1.Height := bchord1.Height; + guitar1.top := bchord1.top; - if withrandom.Value = False then - numchord.Value := strtoint(ansistring(maxnote.Value)) - else - begin + bchord1.Visible := True; + chord1.Visible := True; - x := 0; - while x < 50 do - begin + chordran := 1; + dorandomchord(Sender); - numchord.Value := Random(strtoint(ansistring(maxnote.Value))) + 1; - Inc(x); - application.ProcessMessages; - sleep(20); - end; - end; + piano1.Visible := True; + guitar1.Visible := True; + bass1.Visible := True; - bchord1.height := (height Div numchord.Value) - 10; + chord1drop.Value := chord1.Caption; + chord1drop.Visible := True; - if numchord.Value > 0 then - begin - bchord1.top := 2; + application.ProcessMessages; + if bosound.Value then + begin + playrandomchords(0); - chord1.height := bchord1.height; - piano1.height := bchord1.height; - bass1.height := bchord1.height; - chord1.top := bchord1.top; - piano1.top := bchord1.top; - bass1.top := bchord1.top; - guitar1.height := bchord1.height; - guitar1.top := bchord1.top; + application.ProcessMessages; + end; + end; - bchord1.Visible := True; - chord1.Visible := True; + if numchord.Value > 1 then + begin - chordran := 1; - dorandomchord(Sender); + chord2.Caption := chord1.Caption; + x := 0; - piano1.Visible := True; - guitar1.Visible := True; - bass1.Visible := True; + bchord2.Height := bchord1.Height; + chord2.Height := bchord1.Height; + piano2.Height := bchord1.Height; + bass2.Height := bchord1.Height; + bchord2.top := bchord1.bottom + 10; + chord2.top := bchord2.top; + piano2.top := bchord2.top; + bass2.top := bchord2.top; - chord1drop.Value := chord1.Caption; - chord1drop.Visible := True; + guitar2.Height := bchord1.Height; + guitar2.top := bchord2.top; - application.ProcessMessages; - if bosound.value then - begin - playrandomchords(0); + bchord2.Visible := True; + chord2.Visible := True; + chordran := 2; - application.ProcessMessages; - end; - end; + while (x < 10) and (chord2.Caption = chord1.Caption) do + begin + dorandomchord(Sender); + Inc(x); + end; - if numchord.Value > 1 then - begin + piano2.Visible := True; + guitar2.Visible := True; + bass2.Visible := True; - chord2.Caption := chord1.Caption; - x := 0; + chord2drop.Value := chord2.Caption; + chord2drop.Visible := True; - bchord2.height := bchord1.height; - chord2.height := bchord1.height; - piano2.height := bchord1.height; - bass2.height := bchord1.height; - bchord2.top := bchord1.bottom + 10; - chord2.top := bchord2.top; - piano2.top := bchord2.top; - bass2.top := bchord2.top; + application.ProcessMessages; - guitar2.height := bchord1.height; - guitar2.top := bchord2.top; + if bosound.Value then + begin + playrandomchords(1); + application.ProcessMessages; + end; - bchord2.Visible := True; - chord2.Visible := True; - chordran := 2; + end; - while (x < 10) and (chord2.Caption = chord1.Caption) do - begin - dorandomchord(Sender); - Inc(x); - end; + if numchord.Value > 2 then + begin + chord3.Caption := chord2.Caption; + bchord3.Visible := True; + chord3.Visible := True; + x := 0; - piano2.Visible := True; - guitar2.Visible := True; - bass2.Visible := True; + bchord3.Height := bchord1.Height; + chord3.Height := bchord1.Height; + piano3.Height := bchord1.Height; + bass3.Height := bchord1.Height; - chord2drop.Value := chord2.Caption; - chord2drop.Visible := True; + bchord3.top := bchord2.bottom + 10; + chord3.top := bchord3.top; + piano3.top := bchord3.top; + bass3.top := bchord3.top; + guitar3.Height := bchord1.Height; + guitar3.top := bchord3.top; - application.ProcessMessages; + chordran := 3; - if bosound.value then - begin - playrandomchords(1); + while (x < 10) and ((chord2.Caption = chord3.Caption) or (chord1.Caption = chord3.Caption) + ) do + begin + dorandomchord(Sender); + Inc(x); + end; + piano3.Visible := True; + guitar3.Visible := True; + bass3.Visible := True; - application.ProcessMessages; - end; + chord3drop.Value := chord3.Caption; + chord3drop.Visible := True; - end; + application.ProcessMessages; - if numchord.Value > 2 then - begin - chord3.Caption := chord2.Caption; - bchord3.Visible := True; - chord3.Visible := True; - x := 0; - - bchord3.height := bchord1.height; - chord3.height := bchord1.height; - piano3.height := bchord1.height; - bass3.height := bchord1.height; - - bchord3.top := bchord2.bottom + 10; - chord3.top := bchord3.top; - piano3.top := bchord3.top; - bass3.top := bchord3.top; - - guitar3.height := bchord1.height; - guitar3.top := bchord3.top; - - chordran := 3; - - while (x < 10) and ((chord2.Caption = chord3.Caption) or (chord1.Caption = chord3.Caption) - ) do - begin - dorandomchord(Sender); - Inc(x); - end; - piano3.Visible := True; - guitar3.Visible := True; - bass3.Visible := True; - - chord3drop.Value := chord3.Caption; - chord3drop.Visible := True; + if bosound.Value then + begin + playrandomchords(2); - application.ProcessMessages; + application.ProcessMessages; + end; - if bosound.value then - begin - playrandomchords(2); + end; - application.ProcessMessages; - end; + if numchord.Value > 3 then + begin - end; + chord4.Caption := chord3.Caption; + bchord4.Visible := True; + chord4.Visible := True; + x := 0; - if numchord.Value > 3 then - begin + bchord4.Height := bchord1.Height; + chord4.Height := bchord1.Height; + piano4.Height := bchord1.Height; + bass4.Height := bchord1.Height; - chord4.Caption := chord3.Caption; - bchord4.Visible := True; - chord4.Visible := True; - x := 0; + bchord4.top := bchord3.bottom + 10; + chord4.top := bchord4.top; + piano4.top := bchord4.top; + bass4.top := bchord4.top; - bchord4.height := bchord1.height; - chord4.height := bchord1.height; - piano4.height := bchord1.height; - bass4.height := bchord1.height; + guitar4.Height := bchord1.Height; + guitar4.top := bchord4.top; - bchord4.top := bchord3.bottom + 10; - chord4.top := bchord4.top; - piano4.top := bchord4.top; - bass4.top := bchord4.top; + chordran := 4; - guitar4.height := bchord1.height; - guitar4.top := bchord4.top; + while (x < 10) and ((chord3.Caption = chord4.Caption) or (chord1.Caption = chord4.Caption) + ) do + begin + dorandomchord(Sender); + Inc(x); + end; - chordran := 4; + piano4.Visible := True; + guitar4.Visible := True; + bass4.Visible := True; - while (x < 10) and ((chord3.Caption = chord4.Caption) or (chord1.Caption = chord4.Caption) - ) do - begin - dorandomchord(Sender); - Inc(x); - end; + chord4drop.Value := chord4.Caption; + chord4drop.Visible := True; - piano4.Visible := True; - guitar4.Visible := True; - bass4.Visible := True; + application.ProcessMessages; - chord4drop.Value := chord4.Caption; - chord4drop.Visible := True; + if bosound.Value then + begin + playrandomchords(3); - application.ProcessMessages; + application.ProcessMessages; + end; - if bosound.value then - begin - playrandomchords(3); + end; - application.ProcessMessages; - end; + if numchord.Value > 4 then + begin + bchord5.Visible := True; + chord5.Visible := True; + chord5.Caption := chord4.Caption; - end; + x := 0; - if numchord.Value > 4 then - begin - bchord5.Visible := True; - chord5.Visible := True; - chord5.Caption := chord4.Caption; + bchord5.Height := bchord1.Height; + chord5.Height := bchord1.Height; + piano5.Height := bchord1.Height; + bass5.Height := bchord1.Height; - x := 0; + bchord5.top := bchord4.bottom + 10; + chord5.top := bchord5.top; + piano5.top := bchord5.top; + bass5.top := bchord5.top; - bchord5.height := bchord1.height; - chord5.height := bchord1.height; - piano5.height := bchord1.height; - bass5.height := bchord1.height; + guitar5.Height := bchord1.Height; + guitar5.top := bchord5.top; - bchord5.top := bchord4.bottom + 10; - chord5.top := bchord5.top; - piano5.top := bchord5.top; - bass5.top := bchord5.top; + chordran := 5; - guitar5.height := bchord1.height; - guitar5.top := bchord5.top; + while (x < 10) and ((chord5.Caption = chord4.Caption) or (chord1.Caption = chord5.Caption) + ) do + begin + dorandomchord(Sender); + Inc(x); + end; - chordran := 5; + piano5.Visible := True; + guitar5.Visible := True; + bass5.Visible := True; - while (x < 10) and ((chord5.Caption = chord4.Caption) or (chord1.Caption = chord5.Caption) - ) do - begin - dorandomchord(Sender); - Inc(x); - end; + chord5drop.Value := chord5.Caption; - piano5.Visible := True; - guitar5.Visible := True; - bass5.Visible := True; + chord5drop.Width := chord5.Width; - chord5drop.Value := chord5.Caption; + chord5drop.Visible := True; - chord5drop.width := chord5.width; - chord5drop.Visible := True; + application.ProcessMessages; + if bosound.Value then + begin + playrandomchords(4); - application.ProcessMessages; + application.ProcessMessages; + end; - if bosound.value then - begin - playrandomchords(4); + end; - application.ProcessMessages; - end; + if nodrums.Value = True then + begin + tbutton3.Visible := True; + drum_beats[0] := 'x000x000x000x000'; + // closed hat + drum_beats[1] := '0000000000000000'; + // opened hat + drum_beats[2] := '0000000000000000'; + // snare + drum_beats[3] := 'x000000000000000'; + // kick + drumsfo.novoice.Value := True; + for ax := 0 to 15 do + begin + if (Copy(drum_beats[0], ax + 1, 1) = 'x') then + ach[ax].Value := True + else + ach[ax].Value := False; + if (Copy(drum_beats[1], ax + 1, 1) = 'x') then + aoh[ax].Value := True + else + aoh[ax].Value := False; - end; + if (Copy(drum_beats[2], ax + 1, 1) = 'x') then + asd[ax].Value := True + else + asd[ax].Value := False; - if nodrums.Value = True then - begin - tbutton3.Visible := True; - drum_beats[0] := 'x000x000x000x000'; - // closed hat - drum_beats[1] := '0000000000000000'; - // opened hat - drum_beats[2] := '0000000000000000'; - // snare - drum_beats[3] := 'x000000000000000'; - // kick - drumsfo.novoice.Value := True; - for ax := 0 to 15 do - begin - if (Copy(drum_beats[0], ax + 1, 1) = 'x') then - ach[ax].Value := True - else - ach[ax].Value := False; - - if (Copy(drum_beats[1], ax + 1, 1) = 'x') then - aoh[ax].Value := True - else - aoh[ax].Value := False; - - if (Copy(drum_beats[2], ax + 1, 1) = 'x') then - asd[ax].Value := True - else - asd[ax].Value := False; - - if (Copy(drum_beats[3], ax + 1, 1) = 'x') then - abd[ax].Value := True - else - abd[ax].Value := False; - end; - - drumsfo.dragdock.float(); - drumsfo.Visible := True; + if (Copy(drum_beats[3], ax + 1, 1) = 'x') then + abd[ax].Value := True + else + abd[ax].Value := False; + end; - refreshform(Sender); + drumsfo.dragdock.float(); + drumsfo.Visible := True; - bpm.Visible := True; - bpm.Value := (80 + random(80)); - drumsfo.edittempo.Value := bpm.Value * 2; - drumsfo.dostart(Sender); - //bnbchords.visible := true; - end; - tbutton2.Visible := True; - tbutton3.Visible := True; - tbutton5.Visible := True; - bnbchords.Visible := true; - btnfixed.Visible := true; - blocked := 0; + refreshform(Sender); + bpm.Visible := True; + bpm.Value := (80 + random(80)); + drumsfo.edittempo.Value := bpm.Value * 2; + drumsfo.dostart(Sender); + //bnbchords.visible := true; end; + tbutton2.Visible := True; + tbutton3.Visible := True; + tbutton5.Visible := True; + bnbchords.Visible := True; + btnfixed.Visible := True; + blocked := 0; + + end; end; -procedure trandomnotefo.onclosev(Const Sender: TObject); +procedure trandomnotefo.onclosev(const Sender: TObject); begin doinit(Sender); end; -procedure trandomnotefo.doclear(Const Sender: TObject); +procedure trandomnotefo.doclear(const Sender: TObject); begin - bchord1.Visible := False; - numchord.Visible := False; - drumsfo.Visible := False; + bchord1.Visible := False; + numchord.Visible := False; + drumsfo.Visible := False; //guitarsfo.visible := false; - chord1.Visible := False; - - chord1drop.Visible := False; - chord2drop.Visible := False; - chord3drop.Visible := False; - chord4drop.Visible := False; - chord5drop.Visible := False; - bchord2.Visible := False; - chord2.Visible := False; - bchord3.Visible := False; - chord3.Visible := False; - bchord4.Visible := False; - chord4.Visible := False; - bchord5.Visible := False; - chord5.Visible := False; - guitar1.Visible := False; - guitar2.Visible := False; - guitar3.Visible := False; - guitar4.Visible := False; - guitar5.Visible := False; - piano1.Visible := False; - piano2.Visible := False; - piano3.Visible := False; - piano4.Visible := False; - piano5.Visible := False; - bass1.Visible := False; - bass2.Visible := False; - bass3.Visible := False; - bass4.Visible := False; - bass5.Visible := False; - bpm.Visible := False; - drumsfo.Visible := False; - tbutton3.Visible := False; - tbutton2.Visible := False; + chord1.Visible := False; + + chord1drop.Visible := False; + chord2drop.Visible := False; + chord3drop.Visible := False; + chord4drop.Visible := False; + chord5drop.Visible := False; + bchord2.Visible := False; + chord2.Visible := False; + bchord3.Visible := False; + chord3.Visible := False; + bchord4.Visible := False; + chord4.Visible := False; + bchord5.Visible := False; + chord5.Visible := False; + guitar1.Visible := False; + guitar2.Visible := False; + guitar3.Visible := False; + guitar4.Visible := False; + guitar5.Visible := False; + piano1.Visible := False; + piano2.Visible := False; + piano3.Visible := False; + piano4.Visible := False; + piano5.Visible := False; + bass1.Visible := False; + bass2.Visible := False; + bass3.Visible := False; + bass4.Visible := False; + bass5.Visible := False; + bpm.Visible := False; + drumsfo.Visible := False; + tbutton3.Visible := False; + tbutton2.Visible := False; drumsfo.dostop(Sender); //bnbchords.width := 1310; //bnbchords.Height := 92; @@ -4408,37 +4429,37 @@ procedure trandomnotefo.doclear(Const Sender: TObject); // refreshform(sender); end; -procedure trandomnotefo.refreshform(Const Sender: TObject); +procedure trandomnotefo.refreshform(const Sender: TObject); begin if guitarsfo.Visible then - begin - guitarsfo.top := top + tbutton5.top + 18; - guitarsfo.left := left + 40; - guitarsfo.Visible := True; - guitarsfo.bringtofront; - end; + begin + guitarsfo.top := top + tbutton5.top + 18; + guitarsfo.left := left + 40; + guitarsfo.Visible := True; + guitarsfo.bringtofront; + end; if drumsfo.Visible then - begin - drumsfo.top := top + 254; - drumsfo.left := left + 40; - drumsfo.Visible := True; - drumsfo.bringtofront; - end; + begin + drumsfo.top := top + 254; + drumsfo.left := left + 40; + drumsfo.Visible := True; + drumsfo.bringtofront; + end; end; -procedure trandomnotefo.onshowdrums(Const Sender: TObject); +procedure trandomnotefo.onshowdrums(const Sender: TObject); begin drumsfo.dragdock.float(); drumsfo.Visible := True; - bpm.Visible := True; - bpm.Value := round(drumsfo.edittempo.Value / 2); + bpm.Visible := True; + bpm.Value := round(drumsfo.edittempo.Value / 2); refreshform(Sender); end; -procedure trandomnotefo.doquit(Const Sender: TObject); +procedure trandomnotefo.doquit(const Sender: TObject); begin if drumsfo.Visible then drumsfo.Visible := False; @@ -4446,7 +4467,7 @@ procedure trandomnotefo.doquit(Const Sender: TObject); mainfo.onexit(Sender); end; -procedure trandomnotefo.showguit(Const Sender: TObject); +procedure trandomnotefo.showguit(const Sender: TObject); begin guitarsfo.dragdock.float(); guitarsfo.Visible := True; @@ -4542,440 +4563,437 @@ procedure trandomnotefo.playrandomchords(thenum: integer); end; -procedure trandomnotefo.onmouseguit(Const Sender: twidget; Var ainfo: mouseeventinfoty); -var +procedure trandomnotefo.onmouseguit(const Sender: twidget; var ainfo: mouseeventinfoty); +var thedir, afile: msestring; begin with ainfo do if eventkind in [ek_buttonpress] then - begin + begin - if Timage(Sender).tag = 0 then - afile := chordmem1 + '_GUIT' - else if Timage(Sender).tag = 1 then - afile := chordmem2 + '_GUIT' - else if Timage(Sender).tag = 2 then - afile := chordmem3 + '_GUIT' - else if Timage(Sender).tag = 3 then - afile := chordmem4 + '_GUIT' - else if Timage(Sender).tag = 4 then - afile := chordmem5 + '_GUIT' - else - afile := ''; + if Timage(Sender).tag = 0 then + afile := chordmem1 + '_GUIT' + else if Timage(Sender).tag = 1 then + afile := chordmem2 + '_GUIT' + else if Timage(Sender).tag = 2 then + afile := chordmem3 + '_GUIT' + else if Timage(Sender).tag = 3 then + afile := chordmem4 + '_GUIT' + else if Timage(Sender).tag = 4 then + afile := chordmem5 + '_GUIT' + else + afile := ''; - thedir := IncludeTrailingBackslash(ExtractFilePath(msestring(ParamStr(0)))) + - 'sound' + directoryseparator + 'guitar' + directoryseparator + afile + '.ogg'; + thedir := IncludeTrailingBackslash(ExtractFilePath(msestring(ParamStr(0)))) + + 'sound' + directoryseparator + 'guitar' + directoryseparator + afile + '.ogg'; - if fileexists(thedir) then - begin + if fileexists(thedir) then + begin - uos_Stop(Timage(Sender).tag + 10); + uos_Stop(Timage(Sender).tag + 10); - if uos_CreatePlayer(Timage(Sender).tag + 10) then - application.processmessages; + if uos_CreatePlayer(Timage(Sender).tag + 10) then + application.ProcessMessages; - if uos_AddFromFile(Timage(Sender).tag + 10, PChar(thedir)) > -1 then + if uos_AddFromFile(Timage(Sender).tag + 10, PChar(thedir)) > -1 then {$if defined(cpuarm)} if uos_AddIntoDevOut(Timage(Sender).tag + 10, -1, 0.3, -1, -1, -1, -1, -1) > -1 then {$else} - if uos_AddIntoDevOut(Timage(Sender).tag + 10) > -1 then + if uos_AddIntoDevOut(Timage(Sender).tag + 10) > -1 then {$endif} - uos_Play(Timage(Sender).tag + 10); - - end; - refreshform(Sender); + uos_Play(Timage(Sender).tag + 10); end; + refreshform(Sender); + + end; end; -procedure trandomnotefo.onmousepiano(Const Sender: twidget; Var ainfo: mouseeventinfoty); -var +procedure trandomnotefo.onmousepiano(const Sender: twidget; var ainfo: mouseeventinfoty); +var thedir, afile: msestring; begin with ainfo do if eventkind in [ek_buttonpress] then - begin - - if Timage(Sender).tag = 0 then - afile := chordmem1 + '_PIANO' - else if Timage(Sender).tag = 1 then - afile := chordmem2 + '_PIANO' - else if Timage(Sender).tag = 2 then - afile := chordmem3 + '_PIANO' - else if Timage(Sender).tag = 3 then - afile := chordmem4 + '_PIANO' - else if Timage(Sender).tag = 4 then - afile := chordmem5 + '_PIANO' - else - afile := ''; + begin - thedir := IncludeTrailingBackslash(ExtractFilePath(msestring(ParamStr(0)))) + - 'sound' + directoryseparator + 'piano' + directoryseparator + afile + '.ogg'; + if Timage(Sender).tag = 0 then + afile := chordmem1 + '_PIANO' + else if Timage(Sender).tag = 1 then + afile := chordmem2 + '_PIANO' + else if Timage(Sender).tag = 2 then + afile := chordmem3 + '_PIANO' + else if Timage(Sender).tag = 3 then + afile := chordmem4 + '_PIANO' + else if Timage(Sender).tag = 4 then + afile := chordmem5 + '_PIANO' + else + afile := ''; - if fileexists(thedir) then - begin + thedir := IncludeTrailingBackslash(ExtractFilePath(msestring(ParamStr(0)))) + + 'sound' + directoryseparator + 'piano' + directoryseparator + afile + '.ogg'; + if fileexists(thedir) then + begin - uos_Stop(Timage(Sender).tag + 20); + uos_Stop(Timage(Sender).tag + 20); - if uos_CreatePlayer(Timage(Sender).tag + 20) then - application.processmessages; + if uos_CreatePlayer(Timage(Sender).tag + 20) then + application.ProcessMessages; - if uos_AddFromFile(Timage(Sender).tag + 20, PChar(thedir)) > -1 then + if uos_AddFromFile(Timage(Sender).tag + 20, PChar(thedir)) > -1 then {$if defined(cpuarm)} if uos_AddIntoDevOut(Timage(Sender).tag + 20, configfo.devoutcfg.value, 0.3, -1, -1, -1, -1, -1) > -1 then {$else} - if uos_AddIntoDevOut(Timage(Sender).tag + 20, configfo.devoutcfg.value, -1, -1, -1, -1, -1, -1) > -1 then + if uos_AddIntoDevOut(Timage(Sender).tag + 20, configfo.devoutcfg.Value, -1, -1, -1, -1, -1, -1) > -1 then {$endif} - uos_Play(Timage(Sender).tag + 20); - - end; - refreshform(Sender); + uos_Play(Timage(Sender).tag + 20); end; + refreshform(Sender); + + end; end; -procedure trandomnotefo.onmousev(Const Sender: twidget; - Var ainfo: mouseeventinfoty); +procedure trandomnotefo.onmousev(const Sender: twidget; var ainfo: mouseeventinfoty); begin with ainfo do if eventkind in [ek_buttonpress] then refreshform(Sender); end; -procedure trandomnotefo.ontextmax(Const Sender: tcustomdataedit; Var atext: msestring; Var accept: - Boolean); +procedure trandomnotefo.ontextmax(const Sender: tcustomdataedit; var atext: msestring; var accept: Boolean); begin refreshform(Sender); end; -procedure trandomnotefo.ondropchord(Const Sender: twidget; Const dropdown: tdropdownlist); +procedure trandomnotefo.ondropchord(const Sender: twidget; const dropdown: tdropdownlist); begin chorddrop := 1; //refreshform(sender); end; -procedure trandomnotefo.onchangechorddrop(Const Sender: TObject); +procedure trandomnotefo.onchangechorddrop(const Sender: TObject); begin if chorddrop = 1 then if blocked = 0 then - begin - blocked := 1; - dorandomchord(Sender); - application.ProcessMessages; - if bosound.value then - begin - playrandomchords(tdropdownlistedit(Sender).tag - 1); - end; - application.ProcessMessages; - refreshform(Sender); - blocked := 0; - end; + begin + blocked := 1; + dorandomchord(Sender); + application.ProcessMessages; + if bosound.Value then + playrandomchords(tdropdownlistedit(Sender).tag - 1); + application.ProcessMessages; + refreshform(Sender); + blocked := 0; + end; chorddrop := 0; end; -procedure trandomnotefo.dofixed(Const Sender: TObject); -var +procedure trandomnotefo.dofixed(const Sender: TObject); +var ax: integer; begin if blocked = 0 then + begin + bnbchords.Visible := False; + btnfixed.Visible := False; + tstringdisp1.Visible := False; + blocked := 1; + doclear(Sender); + application.ProcessMessages; + numchord.Visible := True; + numchord.Value := StrToInt(ansistring(maxnote.Value)); + + bchord1.Height := (Height div numchord.Value) - 10; + bchord1.top := 2; + chord1.Height := bchord1.Height; + piano1.Height := bchord1.Height; + bass1.Height := bchord1.Height; + chord1.top := bchord1.top; + piano1.top := bchord1.top; + bass1.top := bchord1.top; + guitar1.Height := bchord1.Height; + guitar1.top := bchord1.top; + + if numchord.Value > 0 then begin - bnbchords.Visible := False; - btnfixed.Visible := False; - tstringdisp1.Visible := False; - blocked := 1; - doclear(Sender); - application.processmessages; - numchord.Visible := True; - numchord.Value := strtoint(ansistring(maxnote.Value)); - - bchord1.height := (height Div numchord.Value) - 10; - bchord1.top := 2; - chord1.height := bchord1.height; - piano1.height := bchord1.height; - bass1.height := bchord1.height; - chord1.top := bchord1.top; - piano1.top := bchord1.top; - bass1.top := bchord1.top; - guitar1.height := bchord1.height; - guitar1.top := bchord1.top; - - if numchord.Value > 0 then - begin - bchord1.Visible := True; - chord1.Visible := True; - chord1.Caption := 'A / La' + lineend + 'Major'; - piano1.Visible := True; - guitar1.Visible := True; - bass1.Visible := True; - chord1drop.Visible := True; - chord1drop.Value := 'A / La Major'; - pianochord(1, 1, 1, 0); - guitarchord(1, 1, 1, 0); - basschord(1, 1, 1, 0); - chordmem1 := 'A'; - application.ProcessMessages; - end; + bchord1.Visible := True; + chord1.Visible := True; + chord1.Caption := 'A / La' + lineend + 'Major'; + piano1.Visible := True; + guitar1.Visible := True; + bass1.Visible := True; + chord1drop.Visible := True; + chord1drop.Value := 'A / La Major'; + pianochord(1, 1, 1, 0); + guitarchord(1, 1, 1, 0); + basschord(1, 1, 1, 0); + chordmem1 := 'A'; + application.ProcessMessages; + end; - if numchord.Value > 1 then - begin - bchord2.height := bchord1.height; - chord2.height := bchord1.height; - piano2.height := bchord1.height; - bass2.height := bchord1.height; - - bchord2.top := bchord1.bottom + 10; - chord2.top := bchord2.top; - piano2.top := bchord2.top; - bass2.top := bchord2.top; - - guitar2.height := bchord1.height; - guitar2.top := bchord2.top; - chord2.Caption := 'A / La' + lineend + 'Major'; - chord2drop.Value := chord1drop.Value; - chord2drop.Visible := True; - bchord2.Visible := True; - chord2.Visible := True; - piano2.Visible := True; - guitar2.Visible := True; - bass2.Visible := True; - - chordmem2 := chordmem1; - - pianochord(2, 1, 1, 0); - guitarchord(2, 1, 1, 0); - basschord(2, 1, 1, 0); + if numchord.Value > 1 then + begin + bchord2.Height := bchord1.Height; + chord2.Height := bchord1.Height; + piano2.Height := bchord1.Height; + bass2.Height := bchord1.Height; + + bchord2.top := bchord1.bottom + 10; + chord2.top := bchord2.top; + piano2.top := bchord2.top; + bass2.top := bchord2.top; + + guitar2.Height := bchord1.Height; + guitar2.top := bchord2.top; + chord2.Caption := 'A / La' + lineend + 'Major'; + chord2drop.Value := chord1drop.Value; + chord2drop.Visible := True; + bchord2.Visible := True; + chord2.Visible := True; + piano2.Visible := True; + guitar2.Visible := True; + bass2.Visible := True; + + chordmem2 := chordmem1; + + pianochord(2, 1, 1, 0); + guitarchord(2, 1, 1, 0); + basschord(2, 1, 1, 0); - application.ProcessMessages; - end; + application.ProcessMessages; + end; - if numchord.Value > 2 then - begin - bchord3.height := bchord1.height; - chord3.height := bchord1.height; - piano3.height := bchord1.height; - bass3.height := bchord1.height; - - bchord3.top := bchord2.bottom + 10; - chord3.top := bchord3.top; - piano3.top := bchord3.top; - bass3.top := bchord3.top; - - guitar3.height := bchord1.height; - guitar3.top := bchord3.top; - chord3.Caption := chord1.Caption; - chord3drop.Value := chord1drop.Value; - chord3drop.Visible := True; - bchord3.Visible := True; - chord3.Visible := True; - piano3.Visible := True; - guitar3.Visible := True; - bass3.Visible := True; - - chordmem3 := chordmem1 ; - - pianochord(3, 1, 1, 0); - guitarchord(3, 1, 1, 0); - basschord(3, 1, 1, 0); + if numchord.Value > 2 then + begin + bchord3.Height := bchord1.Height; + chord3.Height := bchord1.Height; + piano3.Height := bchord1.Height; + bass3.Height := bchord1.Height; + + bchord3.top := bchord2.bottom + 10; + chord3.top := bchord3.top; + piano3.top := bchord3.top; + bass3.top := bchord3.top; + + guitar3.Height := bchord1.Height; + guitar3.top := bchord3.top; + chord3.Caption := chord1.Caption; + chord3drop.Value := chord1drop.Value; + chord3drop.Visible := True; + bchord3.Visible := True; + chord3.Visible := True; + piano3.Visible := True; + guitar3.Visible := True; + bass3.Visible := True; + + chordmem3 := chordmem1; + + pianochord(3, 1, 1, 0); + guitarchord(3, 1, 1, 0); + basschord(3, 1, 1, 0); - application.ProcessMessages; - end; + application.ProcessMessages; + end; - if numchord.Value > 3 then - begin - bchord4.height := bchord1.height; - chord4.height := bchord1.height; - piano4.height := bchord1.height; - bass4.height := bchord1.height; - - bchord4.top := bchord3.bottom + 10; - chord4.top := bchord4.top; - piano4.top := bchord4.top; - bass4.top := bchord4.top; - - guitar4.height := bchord1.height; - guitar4.top := bchord4.top; - chord4.Caption := chord1.Caption; - chord4drop.Value := chord1drop.Value; - chord4drop.Visible := True; - bchord4.Visible := True; - chord4.Visible := True; - piano4.Visible := True; - guitar4.Visible := True; - bass4.Visible := True; + if numchord.Value > 3 then + begin + bchord4.Height := bchord1.Height; + chord4.Height := bchord1.Height; + piano4.Height := bchord1.Height; + bass4.Height := bchord1.Height; + + bchord4.top := bchord3.bottom + 10; + chord4.top := bchord4.top; + piano4.top := bchord4.top; + bass4.top := bchord4.top; + + guitar4.Height := bchord1.Height; + guitar4.top := bchord4.top; + chord4.Caption := chord1.Caption; + chord4drop.Value := chord1drop.Value; + chord4drop.Visible := True; + bchord4.Visible := True; + chord4.Visible := True; + piano4.Visible := True; + guitar4.Visible := True; + bass4.Visible := True; - application.ProcessMessages; + application.ProcessMessages; - chordmem4 := chordmem1 ; + chordmem4 := chordmem1; - pianochord(4, 1, 1, 0); - guitarchord(4, 1, 1, 0); - basschord(4, 1, 1, 0); + pianochord(4, 1, 1, 0); + guitarchord(4, 1, 1, 0); + basschord(4, 1, 1, 0); - application.ProcessMessages; - end; + application.ProcessMessages; + end; - if numchord.Value > 4 then - begin - bchord5.height := bchord1.height; - chord5.height := bchord1.height; - piano5.height := bchord1.height; - bass5.height := bchord1.height; - - bchord5.top := bchord4.bottom + 10; - chord5.top := bchord5.top; - piano5.top := bchord5.top; - bass5.top := bchord5.top; - - guitar5.height := bchord1.height; - guitar5.top := bchord5.top; - chord5.Caption := chord1.Caption; - chord5drop.Value := chord1drop.Value; - chord5drop.Visible := True; - bchord5.Visible := True; - chord5.Visible := True; - piano5.Visible := True; - guitar5.Visible := True; - bass5.Visible := True; + if numchord.Value > 4 then + begin + bchord5.Height := bchord1.Height; + chord5.Height := bchord1.Height; + piano5.Height := bchord1.Height; + bass5.Height := bchord1.Height; + + bchord5.top := bchord4.bottom + 10; + chord5.top := bchord5.top; + piano5.top := bchord5.top; + bass5.top := bchord5.top; + + guitar5.Height := bchord1.Height; + guitar5.top := bchord5.top; + chord5.Caption := chord1.Caption; + chord5drop.Value := chord1drop.Value; + chord5drop.Visible := True; + bchord5.Visible := True; + chord5.Visible := True; + piano5.Visible := True; + guitar5.Visible := True; + bass5.Visible := True; - application.ProcessMessages; + application.ProcessMessages; - chordmem5 := chordmem1 ; + chordmem5 := chordmem1; - pianochord(5, 1, 1, 0); - guitarchord(5, 1, 1, 0); - basschord(5, 1, 1, 0); + pianochord(5, 1, 1, 0); + guitarchord(5, 1, 1, 0); + basschord(5, 1, 1, 0); - application.ProcessMessages; - end; + application.ProcessMessages; + end; - tbutton5.Visible := False; + tbutton5.Visible := False; - bnbchords.left := 130; - bnbchords.top := tbutton2.top; - bnbchords.width := 202; - bnbchords.height := tbutton2.height; + bnbchords.left := 130; + bnbchords.top := tbutton2.top; + bnbchords.Width := 202; + bnbchords.Height := tbutton2.Height; - btnfixed.left := 338; - btnfixed.width := 144; - btnfixed.height := tbutton2.height;; - btnfixed.top := bnbchords.top; + btnfixed.left := 338; + btnfixed.Width := 144; + btnfixed.Height := tbutton2.Height; + ; + btnfixed.top := bnbchords.top; - bnbchords.font.height := 30; - btnfixed.font.height := 30; + bnbchords.font.Height := 30; + btnfixed.font.Height := 30; - end; + end; tbutton2.Visible := True; if nodrums.Value = True then + begin + tbutton3.Visible := True; + drum_beats[0] := 'x000x000x000x000'; + // closed hat + drum_beats[1] := '0000000000000000'; + // opened hat + drum_beats[2] := '0000000000000000'; + // snare + drum_beats[3] := 'x000000000000000'; + // kick + drumsfo.novoice.Value := True; + for ax := 0 to 15 do begin - tbutton3.Visible := True; - drum_beats[0] := 'x000x000x000x000'; - // closed hat - drum_beats[1] := '0000000000000000'; - // opened hat - drum_beats[2] := '0000000000000000'; - // snare - drum_beats[3] := 'x000000000000000'; - // kick - drumsfo.novoice.Value := True; - for ax := 0 to 15 do - begin - if (Copy(drum_beats[0], ax + 1, 1) = 'x') then - ach[ax].Value := True - else - ach[ax].Value := False; - - if (Copy(drum_beats[1], ax + 1, 1) = 'x') then - aoh[ax].Value := True - else - aoh[ax].Value := False; - - if (Copy(drum_beats[2], ax + 1, 1) = 'x') then - asd[ax].Value := True - else - asd[ax].Value := False; - - if (Copy(drum_beats[3], ax + 1, 1) = 'x') then - abd[ax].Value := True - else - abd[ax].Value := False; - end; + if (Copy(drum_beats[0], ax + 1, 1) = 'x') then + ach[ax].Value := True + else + ach[ax].Value := False; - drumsfo.dragdock.float(); - drumsfo.Visible := True; + if (Copy(drum_beats[1], ax + 1, 1) = 'x') then + aoh[ax].Value := True + else + aoh[ax].Value := False; - bpm.Visible := True; - bpm.Value := 100; - drumsfo.edittempo.Value := bpm.Value * 2; - //bnbchords.visible := true; + if (Copy(drum_beats[2], ax + 1, 1) = 'x') then + asd[ax].Value := True + else + asd[ax].Value := False; + if (Copy(drum_beats[3], ax + 1, 1) = 'x') then + abd[ax].Value := True + else + abd[ax].Value := False; end; - tbutton3.Visible := True; - tbutton5.Visible := True; - bnbchords.Visible := true; - btnfixed.Visible := true; + + drumsfo.dragdock.float(); + drumsfo.Visible := True; + + bpm.Visible := True; + bpm.Value := 100; + drumsfo.edittempo.Value := bpm.Value * 2; + //bnbchords.visible := true; + + end; + tbutton3.Visible := True; + tbutton5.Visible := True; + bnbchords.Visible := True; + btnfixed.Visible := True; refreshform(Sender); blocked := 0; end; -procedure trandomnotefo.doinit(Const sender: TObject); +procedure trandomnotefo.doinit(const Sender: TObject); begin doclear(Sender); - bnbchords.left := 20; - bnbchords.top := 272; - bnbchords.width := 462; - bnbchords.height := 102; + bnbchords.left := 20; + bnbchords.top := 272; + bnbchords.Width := 462; + bnbchords.Height := 102; - btnfixed.left := 20; - btnfixed.width := 462; - btnfixed.height := 102; - btnfixed.top := 382; + btnfixed.left := 20; + btnfixed.Width := 462; + btnfixed.Height := 102; + btnfixed.top := 382; - bnbchords.font.height := 60; - btnfixed.font.height := 60; + bnbchords.font.Height := 60; + btnfixed.font.Height := 60; bnbchords.Visible := True; btnfixed.Visible := True; tstringdisp1.Visible := True; end; -procedure trandomnotefo.doconfig(Const sender: TObject); +procedure trandomnotefo.doconfig(const Sender: TObject); begin - pconfigtext.visible := true; + pconfigtext.Visible := True; end; -procedure trandomnotefo.onconfigtext(Const sender: TObject); +procedure trandomnotefo.onconfigtext(const Sender: TObject); begin - tstringdisp1.text := tmemoedit1.value; - pconfigtext.visible := false; - application.processmessages; + tstringdisp1.Text := tmemoedit1.Value; + pconfigtext.Visible := False; + application.ProcessMessages; end; -procedure trandomnotefo.onhide(const sender: TObject); +procedure trandomnotefo.onhide(const Sender: TObject); begin -mainfo.tmainmenu1.menu[4].submenu[15].Caption := ' Show Chords Randomizer '; - + mainfo.tmainmenu1.menu[4].submenu[15].Caption := ' Show Chords Randomizer '; + end; -procedure trandomnotefo.onshowrand(const sender: TObject); +procedure trandomnotefo.onshowrand(const Sender: TObject); begin -mainfo.tmainmenu1.menu[4].submenu[15].Caption := ' Hide Chords Randomizer '; + mainfo.tmainmenu1.menu[4].submenu[15].Caption := ' Hide Chords Randomizer '; end; -procedure trandomnotefo.crea(const sender: TObject); +procedure trandomnotefo.crea(const Sender: TObject); begin -windowopacity := 0; + windowopacity := 0; end; end. + diff --git a/src/recorder.pas b/src/recorder.pas index fd9d8d1..67011e9 100644 --- a/src/recorder.pas +++ b/src/recorder.pas @@ -4,13 +4,50 @@ interface uses - ctypes,uos_flat,infos,msetimer,msetypes,mseglob,mseguiglob,mseguiintf, - mseapplication,msestat,msemenus,msegui,msegraphics,msegraphutils,Math,mseevent, - mseclasses,mseforms,msedock,msesimplewidgets,msewidgets,msedataedits, - msefiledialogx,msegrids,mselistbrowser,msesys,SysUtils,msegraphedits, - mseificomp,mseificompglob,mseifiglob,msescrollbar,msedragglob,mseact,mseedit, - msestatfile,msestream,msestrings,msebitmap,msedatanodes,msedispwidgets, - mserichstring,msedropdownlist,msegridsglob; + ctypes, + uos_flat, + infos, + msetimer, + msetypes, + mseglob, + mseguiglob, + mseguiintf, + mseapplication, + msestat, + msemenus, + msegui, + msegraphics, + msegraphutils, + Math, + mseevent, + mseclasses, + mseforms, + msedock, + msesimplewidgets, + msewidgets, + msedataedits, + msefiledialogx, + msegrids, + mselistbrowser, + msesys, + SysUtils, + msegraphedits, + mseificomp, + mseificompglob, + mseifiglob, + msescrollbar, + msedragglob, + mseact, + mseedit, + msestatfile, + msestream, + msestrings, + msebitmap, + msedatanodes, + msedispwidgets, + mserichstring, + msedropdownlist, + msegridsglob; type trecorderfo = class(tdockform) @@ -50,10 +87,10 @@ trecorderfo = class(tdockform) tbutton6: TButton; edvolr: trealspinedit; tfiledialog1: tfiledialogx; - tgroupbox2: tgroupbox; - bwav: tbooleaneditradio; - bogg: tbooleaneditradio; - bsavetofile: tbooleanedit; + tgroupbox2: tgroupbox; + bwav: tbooleaneditradio; + bogg: tbooleaneditradio; + bsavetofile: tbooleanedit; procedure doplayerstart(const Sender: TObject); procedure doplayeresume(const Sender: TObject); procedure doplayerpause(const Sender: TObject); @@ -88,10 +125,10 @@ trecorderfo = class(tdockform) procedure ontextedit(const Sender: tcustomedit; var atext: msestring); procedure oncreated(const Sender: TObject); procedure onex(const Sender: TObject); - procedure onchangesave(const sender: TObject); + procedure onchangesave(const Sender: TObject); end; - equalizer_band_type = record + equalizer_band_type = record theindex: integer; lo_freq, hi_freq: cfloat; Text: string[10]; @@ -133,7 +170,7 @@ implementation procedure trecorderfo.InitDrawLive(); const transpcolor = $FFF0F0; - begin +begin if (as_checked in waveforec.tmainmenu1.menu[0].state) then begin @@ -250,10 +287,10 @@ procedure trecorderfo.ClosePlayer1; tbutton2.Enabled := False; tbutton3.Enabled := True; - vuright.value := 0; - vuleft.value := 0; - vuright.Height := 0; - vuleft.Height := 0; + vuright.Value := 0; + vuleft.Value := 0; + vuright.Height := 0; + vuleft.Height := 0; //vuLeft.Visible := False; //vuRight.Visible := False; btnStart.Enabled := True; @@ -289,20 +326,21 @@ procedure trecorderfo.ClosePlayer1; procedure trecorderfo.ShowLevel; var leftlev, rightlev: double; - begin +begin vuLeft.Visible := True; vuRight.Visible := True; leftlev := uos_InputGetLevelLeft(therecplayer, Inputindex3); rightlev := uos_InputGetLevelRight(therecplayer, Inputindex3); - - multiplier := ((leftlev + rightlev) / 2); - if multiplier > 1 then multiplier := 1; - - if (imagedancerfo.Visible = True) and (isbuzy = False) and + + multiplier := ((leftlev + rightlev) / 2); + if multiplier > 1 then + multiplier := 1; + + if (imagedancerfo.Visible = True) and (isbuzy = False) and (imagedancerfo.openglwidget.Visible = False) then begin - if dancernum = 4 then + if dancernum = 4 then begin Inc(TimerTicinterval); if TimerTicinterval = 3 then @@ -410,10 +448,10 @@ procedure trecorderfo.doplayerstart(const Sender: TObject); //// PlayerIndex : from 0 to what your computer can do ! //// If PlayerIndex exists already, it will be overwriten... tbutton3.Enabled := False; - - application.processmessages; - InputIndex3 := uos_AddFromFile(therecplayer, PChar(ansistring(historyfn.Value)), -1, samformat, 1024*4); + application.ProcessMessages; + + InputIndex3 := uos_AddFromFile(therecplayer, PChar(ansistring(historyfn.Value)), -1, samformat, 1024 * 4); //// add input from audio file with custom parameters ////////// FileName : filename of audio file @@ -429,8 +467,8 @@ procedure trecorderfo.doplayerstart(const Sender: TObject); // OutputIndex3 := uos_AddIntoDevOut(PlayerIndex3) ; //// add a Output into device with default parameters - OutputIndex3 := uos_AddIntoDevOut(therecplayer,configfo.devoutcfg.value, configfo.latplay.Value, uos_InputGetSampleRate(therecplayer, InputIndex3), - uos_InputGetChannels(therecplayer, InputIndex3), samformat, 1024*4, -1); + OutputIndex3 := uos_AddIntoDevOut(therecplayer, configfo.devoutcfg.Value, configfo.latplay.Value, uos_InputGetSampleRate(therecplayer, InputIndex3), + uos_InputGetChannels(therecplayer, InputIndex3), samformat, 1024 * 4, -1); //// add a Output into device with custom parameters //////////// PlayerIndex : Index of a existing Player @@ -478,21 +516,21 @@ procedure trecorderfo.doplayerstart(const Sender: TObject); ////////// VolRight : Right volume ////////// Enable : Enabled - for i := 1 to 10 do // equalizer - Equalizer_Bands[i].theindex := - uos_InputAddFilter(therecplayer, InputIndex3, - 1, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, - 1, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, True, nil); + for i := 1 to 10 do // equalizer + Equalizer_Bands[i].theindex := + uos_InputAddFilter(therecplayer, InputIndex3, + 1, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, + 1, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, True, nil); - equalizerforec.onchangeall(); + equalizerforec.onchangeall(); - if commanderfo.speccalc.Value = True then // spectrum + if commanderfo.speccalc.Value = True then // spectrum for i := 1 to 10 do - uos_InputAddFilter(therecplayer, InputIndex3, - 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, - 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, False, nil); + uos_InputAddFilter(therecplayer, InputIndex3, + 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, + 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, False, nil); - /// add SoundTouch plugin with samplerate of input1 / default channels (2 = stereo) + /// add SoundTouch plugin with samplerate of input1 / default channels (2 = stereo) /// SoundTouch plugin should be the last added. if plugsoundtouch = True then @@ -525,7 +563,7 @@ procedure trecorderfo.doplayerstart(const Sender: TObject); btnStop.Enabled := True; btnresume.Enabled := False; InitDrawLive(); - application.processmessages; + application.ProcessMessages; if cbloop.Value = True then begin uos_Play(therecplayer, -1); @@ -567,8 +605,8 @@ procedure trecorderfo.doplayerpause(const Sender: TObject); begin //vuLeft.Visible := False; //vuRight.Visible := False; - vuright.Value := 0; - vuleft.Value := 0; + vuright.Value := 0; + vuleft.Value := 0; btnStop.Enabled := True; btnPause.Enabled := False; btnresume.Enabled := True; @@ -579,7 +617,7 @@ procedure trecorderfo.doplayerstop(const Sender: TObject); begin cbloop.Enabled := True; uos_Stop(therecplayer); - application.processmessages; + application.ProcessMessages; end; procedure trecorderfo.changevolume(const Sender: TObject); @@ -665,8 +703,7 @@ procedure trecorderfo.visiblechangeev(const Sender: TObject); begin if (Assigned(mainfo)) and (Assigned(dockpanel1fo)) and - (Assigned(dockpanel2fo)) and (Assigned(dockpanel3fo)) - and (Assigned(dockpanel4fo)) and (Assigned(dockpanel5fo)) then + (Assigned(dockpanel2fo)) and (Assigned(dockpanel3fo)) and (Assigned(dockpanel4fo)) and (Assigned(dockpanel5fo)) then begin if Visible then mainfo.tmainmenu1.menu[4].submenu[7].Caption := ' Hide Recorder ' @@ -737,11 +774,11 @@ procedure trecorderfo.ShowSpectrum(const Sender: TObject); procedure trecorderfo.onplayercreate(const Sender: TObject); begin windowopacity := 0; - + SetExceptionMask(GetExceptionMask + [exZeroDivide] + [exInvalidOp] + [exDenormalized] + [exOverflow] + [exUnderflow] + [exPrecision]); - + setlength(arrecl, 10); setlength(arrecr, 10); @@ -775,16 +812,16 @@ procedure trecorderfo.onplayercreate(const Sender: TObject); procedure trecorderfo.onmousewindow(const Sender: twidget; var ainfo: mouseeventinfoty); begin -if mainfo.ttimer2.Enabled then - mainfo.ttimer2.restart // to reset - else - mainfo.ttimer2.Enabled := True; + if mainfo.ttimer2.Enabled then + mainfo.ttimer2.restart // to reset + else + mainfo.ttimer2.Enabled := True; end; procedure trecorderfo.dorecorderstart(const Sender: TObject); var i, outformat: integer; - outformatst : msestring; + outformatst: msestring; begin // if (bsavetofile.value = True) or (blistenin.value = True) then begin @@ -792,7 +829,7 @@ procedure trecorderfo.dorecorderstart(const Sender: TObject); if uos_CreatePlayer(therecplayer) then begin - application.processmessages; + application.ProcessMessages; cbloop.Enabled := False; isrecording := True; tbutton2.Enabled := True; @@ -810,34 +847,34 @@ procedure trecorderfo.dorecorderstart(const Sender: TObject); if bsavetofile.Value then begin - - if bwav.value then - begin - outformatst := 'wav'; - outformat := 0; - end else - begin - outformatst := 'ogg'; - outformat := 3; - end; - historyfn.Value := msestring(IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)))) + - 'sound' + directoryseparator + 'record' + directoryseparator + 'rec_' + - msestring(formatdatetime('YY_MM_DD_HH_mm_ss', now)) + '.' + outformatst ; + if bwav.Value then + begin + outformatst := 'wav'; + outformat := 0; + end + else + begin + outformatst := 'ogg'; + outformat := 3; + end; + historyfn.Value := msestring(IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)))) + + 'sound' + directoryseparator + 'record' + directoryseparator + 'rec_' + + msestring(formatdatetime('YY_MM_DD_HH_mm_ss', now)) + '.' + outformatst; - uos_AddIntoFile(therecplayer, PChar(ansistring(historyfn.Value)), - -1, -1, -1, 4096, outformat); + + uos_AddIntoFile(therecplayer, PChar(ansistring(historyfn.Value)), -1, -1, -1, 4096, outformat); if sentcue1.Value = True then songplayerfo.historyfn.Value := historyfn.Value; end; - OutputIndex3 := uos_AddIntoDevOut(therecplayer, configfo.devoutcfg.value, configfo.latrec.Value, -1, -1, -1, -1, -1); + OutputIndex3 := uos_AddIntoDevOut(therecplayer, configfo.devoutcfg.Value, configfo.latrec.Value, -1, -1, -1, -1, -1); uos_outputsetenable(therecplayer, OutputIndex3, blistenin.Value); - InputIndex3 := uos_AddFromDevIn(therecplayer, configfo.devincfg.value, -1, -1, -1, -1, -1, -1); + InputIndex3 := uos_AddFromDevIn(therecplayer, configfo.devincfg.Value, -1, -1, -1, -1, -1, -1); /// add Input from mic/aux into IN device with default parameters // In1Index := uos_AddFromDevIn(therecplayer, configfo.devincfg.value, -1, -1, -1, 1, -1); @@ -870,10 +907,10 @@ procedure trecorderfo.dorecorderstart(const Sender: TObject); uos_InputSetDSPVolume(therecplayer, InputIndex3, edvol.Value / 100, edvolr.Value / 100, True); if commanderfo.speccalc.Value = True then - for i := 1 to 10 do - uos_InputAddFilter(therecplayer, InputIndex3, - 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, - 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, False, nil); + for i := 1 to 10 do + uos_InputAddFilter(therecplayer, InputIndex3, + 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, + 3, Equalizer_Bands[i].lo_freq, Equalizer_Bands[i].hi_freq, 1, False, nil); if plugsoundtouch = True then @@ -891,8 +928,8 @@ procedure trecorderfo.dorecorderstart(const Sender: TObject); llength.Value := '00:00:00.000'; InitDrawLive(); - - application.processmessages; + + application.ProcessMessages; uos_Play(therecplayer); /////// everything is ready to play... @@ -1027,8 +1064,8 @@ procedure trecorderfo.oncreated(const Sender: TObject); btnStart.Enabled := False; btinfos.Enabled := False; end; - - Equalizer_Bands[1].lo_freq := 18; + + Equalizer_Bands[1].lo_freq := 18; Equalizer_Bands[1].hi_freq := 46; Equalizer_Bands[1].Text := '31'; Equalizer_Bands[2].lo_freq := 47; @@ -1087,16 +1124,16 @@ procedure trecorderfo.changefrequency(asender, aindex: integer; gainl, gainr: do aplayer: integer; isenable: Boolean = False; begin - isenable := equalizerforec.EQEN.Value; - //if isenable then isenable := false else isenable := true; - - aplayer := therecplayer; - - // if (btnStart.Enabled = true) then - uos_InputSetFilter(aplayer, InputIndex3, Equalizer_Bands[aindex].theindex, -1, -1, -1, Gainl, -1, -1, -1, Gainr, - True, nil, isenable); - end; - + isenable := equalizerforec.EQEN.Value; + //if isenable then isenable := false else isenable := true; + + aplayer := therecplayer; + + // if (btnStart.Enabled = true) then + uos_InputSetFilter(aplayer, InputIndex3, Equalizer_Bands[aindex].theindex, -1, -1, -1, Gainl, -1, -1, -1, Gainr, + True, nil, isenable); +end; + procedure trecorderfo.setequalizerenable(asender: integer; avalue: Boolean); var @@ -1104,8 +1141,8 @@ procedure trecorderfo.setequalizerenable(asender: integer; avalue: Boolean); x: integer; avalset: Boolean; begin - - aplayer := therecplayer; + + aplayer := therecplayer; if avalue then avalset := False @@ -1116,20 +1153,20 @@ procedure trecorderfo.setequalizerenable(asender: integer; avalue: Boolean); uos_InputSetFilter(aplayer, InputIndex3, Equalizer_Bands[x].theindex, -1, -1, -1, -1, -1, -1, -1, -1, True, nil, avalset); end; -procedure trecorderfo.onchangesave(const sender: TObject); +procedure trecorderfo.onchangesave(const Sender: TObject); begin -if bsavetofile.value then - begin - bwav.enabled := true; - bogg.enabled := true; - end else - begin - bwav.enabled := false; - bogg.enabled := false; - end; + if bsavetofile.Value then + begin + bwav.Enabled := True; + bogg.Enabled := True; + end + else + begin + bwav.Enabled := False; + bogg.Enabled := False; + end; end; - end. diff --git a/src/songplayer.pas b/src/songplayer.pas index 0605a52..b7bcb31 100644 --- a/src/songplayer.pas +++ b/src/songplayer.pas @@ -294,9 +294,9 @@ procedure tsongplayerfo.Changestereo2mono(const Sender: TObject); procedure tsongplayerfo.changereverse(const Sender: TObject); begin -if tag = 0 then + if tag = 0 then uos_InputSetDSP(theplayer, InputIndex1, DSPIndex1, playreverse.Value); -if tag = 1 then + if tag = 1 then uos_InputSetDSP(theplayer2, InputIndex2, DSPIndex2, playreverse.Value); end; @@ -362,7 +362,7 @@ procedure tsongplayerfo.ontimersent(const Sender: TObject); procedure tsongplayerfo.ontimerwait(const Sender: TObject); begin - if tag = 0 then + if tag = 0 then begin // timerwait.Enabled := False; btnStart.Enabled := True; @@ -940,9 +940,9 @@ procedure tsongplayerfo.doplayerstart(const Sender: TObject); if fileexists(historyfn.Value) then begin - - // if configfo.bit16.value then samformat := -1 else - samformat := 0; + + // if configfo.bit16.value then samformat := -1 else + samformat := 0; // oninfowav(Sender); @@ -1206,8 +1206,8 @@ procedure tsongplayerfo.doplayerstart(const Sender: TObject); hascue := True; oninfowav(Sender); - - infosfo.infolength.Caption := copy(llength.Value,1,8); + + infosfo.infolength.Caption := copy(llength.Value, 1, 8); if as_checked in wavefo.tmainmenu1.menu[0].state then begin @@ -1241,11 +1241,11 @@ procedure tsongplayerfo.doplayerstart(const Sender: TObject); (lowercase(fileex) = 'flac') or (lowercase(fileex) = 'mp3') then begin - // writeln('avant tout'); + // writeln('avant tout'); if fileexists(historyfn.Value) then begin - // if configfo.bit16.value then samformat := -1 else - samformat := 0; + // if configfo.bit16.value then samformat := -1 else + samformat := 0; // oninfowav(Sender); @@ -1512,8 +1512,8 @@ procedure tsongplayerfo.doplayerstart(const Sender: TObject); // application.processmessages; oninfowav(Sender); - - infosfo2.infolength.Caption := copy(llength.Value,1,8); + + infosfo2.infolength.Caption := copy(llength.Value, 1, 8); if as_checked in wavefo2.tmainmenu1.menu[0].state then begin @@ -1639,7 +1639,7 @@ procedure tsongplayerfo.doplayerpause(const Sender: TObject); end; uos_Pause(theplayer); - + tstringdisp1.Value := msestring('Paused ' + theplaying1); end; @@ -1664,7 +1664,7 @@ procedure tsongplayerfo.doplayerpause(const Sender: TObject); uos_Pause(theplayer2); tstringdisp1.Value := msestring('Paused ' + theplaying2); end; - multiplier := 0; + multiplier := 0; resetspectrum(); end; @@ -2055,7 +2055,7 @@ procedure tsongplayerfo.DrawWaveForm(); rect1: rectty; begin - if ((tag = 0 ) and (DrawWaveFormbusy1 = False)) or + if ((tag = 0) and (DrawWaveFormbusy1 = False)) or ((tag = 1) and (DrawWaveFormbusy2 = False)) then begin @@ -2145,7 +2145,7 @@ procedure tsongplayerfo.onwavform(const Sender: TObject); framewanted: integer; begin - if (tag = 0 ) and (as_checked in wavefo.tmainmenu1.menu[0].state) and (buzywaveform1 = False) then + if (tag = 0) and (as_checked in wavefo.tmainmenu1.menu[0].state) and (buzywaveform1 = False) then if fileexists(PChar(ansistring(historyfn.Value))) then begin @@ -2175,8 +2175,8 @@ procedure tsongplayerfo.onwavform(const Sender: TObject); wavefo.trackbar1.Width := wavefo.Width - 10; wavefo.tmainmenu1.menu[2].Caption := ' Now=X1 '; end; - wavefo.doechelle(nil); - + wavefo.doechelle(nil); + framewanted := Inputlength1 div (wavefo.trackbar1.Width - 7); uos_InputSetFrameCount(theplayerinfoform, 0, framewanted); @@ -2223,7 +2223,7 @@ procedure tsongplayerfo.onwavform(const Sender: TObject); wavefo2.trackbar1.Width := wavefo.Width - 10; wavefo2.tmainmenu1.menu[2].Caption := ' Now=X1 '; end; - wavefo2.doechelle(nil); + wavefo2.doechelle(nil); framewanted := Inputlength2 div (wavefo2.trackbar1.Width - 7); uos_InputSetFrameCount(theplayerinfoform2, 0, framewanted); @@ -2285,29 +2285,30 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject); CommonTags := TagReader.GetCommonTags; - infosfo.infofile.Caption := copy(trim(extractfilename(historyfn.Value)),1,60); - infosfo.infoname.Caption := copy(trim(CommonTags.Title),1,60)+ ' '; - - infosfo.infoartist.Caption := copy(trim(CommonTags.Artist),1,60)+ ' '; - infosfo.infoalbum.Caption := copy(trim(CommonTags.Album),1,60)+ ' '; - - infosfo.infofile.hint := ' ' + trim(extractfilename(historyfn.Value)) + ' '; - infosfo.infoname.hint := ' ' + trim(CommonTags.Title) + ' '; + infosfo.infofile.Caption := copy(trim(extractfilename(historyfn.Value)), 1, 60); + infosfo.infoname.Caption := copy(trim(CommonTags.Title), 1, 60) + ' '; + + infosfo.infoartist.Caption := copy(trim(CommonTags.Artist), 1, 60) + ' '; + infosfo.infoalbum.Caption := copy(trim(CommonTags.Album), 1, 60) + ' '; + + infosfo.infofile.hint := ' ' + trim(extractfilename(historyfn.Value)) + ' '; + infosfo.infoname.hint := ' ' + trim(CommonTags.Title) + ' '; infosfo.infoartist.hint := ' ' + trim(CommonTags.Artist) + ' '; infosfo.infoalbum.hint := ' ' + trim(CommonTags.Album) + ' '; infosfo.infocom.hint := ' ' + trim(CommonTags.Comment) + ' '; - - infosfo.infoyear.Caption := trim(CommonTags.Year)+ ' '; - infosfo.infocom.Caption := copy(trim(CommonTags.Comment),1,60)+ ' '; - infosfo.infotag.Caption := trim(CommonTags.Genre)+ ' '; + + infosfo.infoyear.Caption := trim(CommonTags.Year) + ' '; + infosfo.infocom.Caption := copy(trim(CommonTags.Comment), 1, 60) + ' '; + infosfo.infotag.Caption := trim(CommonTags.Genre) + ' '; infosfo.infolength.Caption := trim(utf8decode(FormatDateTime('hh:nn:ss', - (CommonTags.Duration / MSecsPerDay))))+ ' '; - infosfo.inforate.Caption := trim(IntToStr(TagReader.MediaProperty.Sampling))+ ' '; + (CommonTags.Duration / MSecsPerDay)))) + ' '; + infosfo.inforate.Caption := trim(IntToStr(TagReader.MediaProperty.Sampling)) + ' '; // format('%d Hz', [TagReader.MediaProperty.Sampling]); - - if trim(lowercase(TagReader.MediaProperty.ChannelMode)) = 'joint stereo' then - infosfo.infochan.Caption := 'Stereo ' else - infosfo.infochan.Caption := trim(TagReader.MediaProperty.ChannelMode)+ ' '; + + if trim(lowercase(TagReader.MediaProperty.ChannelMode)) = 'joint stereo' then + infosfo.infochan.Caption := 'Stereo ' + else + infosfo.infochan.Caption := trim(TagReader.MediaProperty.ChannelMode) + ' '; // BPM @@ -2322,7 +2323,7 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject); IntToStr(round(uos_GetBPM(thebuffer, thebufferinfos.channels, thebufferinfos.samplerate))))) + ' '; end; - + // infosfo.Width := 442; // infosfo.height := 238 ; @@ -2385,27 +2386,28 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject); CommonTags := TagReader.GetCommonTags; - infosfo2.infofile.Caption := copy(trim(extractfilename(historyfn.Value)),1,60); - infosfo2.infoname.Caption := copy(trim(CommonTags.Title),1,60)+ ' '; - infosfo2.infoartist.Caption := copy(trim(CommonTags.Artist),1,60)+ ' '; - infosfo2.infoalbum.Caption := copy(trim(CommonTags.Album),1,60)+ ' '; - infosfo2.infoyear.Caption := trim(CommonTags.Year)+ ' '; - infosfo2.infocom.Caption := copy(trim(CommonTags.Comment),1,60)+ ' '; - - infosfo2.infofile.hint := ' ' + trim(extractfilename(historyfn.Value)) + ' '; - infosfo2.infoname.hint := ' ' + trim(CommonTags.Title) + ' '; + infosfo2.infofile.Caption := copy(trim(extractfilename(historyfn.Value)), 1, 60); + infosfo2.infoname.Caption := copy(trim(CommonTags.Title), 1, 60) + ' '; + infosfo2.infoartist.Caption := copy(trim(CommonTags.Artist), 1, 60) + ' '; + infosfo2.infoalbum.Caption := copy(trim(CommonTags.Album), 1, 60) + ' '; + infosfo2.infoyear.Caption := trim(CommonTags.Year) + ' '; + infosfo2.infocom.Caption := copy(trim(CommonTags.Comment), 1, 60) + ' '; + + infosfo2.infofile.hint := ' ' + trim(extractfilename(historyfn.Value)) + ' '; + infosfo2.infoname.hint := ' ' + trim(CommonTags.Title) + ' '; infosfo2.infoartist.hint := ' ' + trim(CommonTags.Artist) + ' '; infosfo2.infoalbum.hint := ' ' + trim(CommonTags.Album) + ' '; infosfo2.infocom.hint := ' ' + trim(CommonTags.Comment) + ' '; - - infosfo2.infotag.Caption := trim(CommonTags.Genre)+ ' '; + + infosfo2.infotag.Caption := trim(CommonTags.Genre) + ' '; infosfo2.infolength.Caption := trim(utf8decode(FormatDateTime('hh:nn:ss', - (CommonTags.Duration / MSecsPerDay))))+ ' '; - infosfo2.inforate.Caption := trim(IntToStr(TagReader.MediaProperty.Sampling))+ ' '; + (CommonTags.Duration / MSecsPerDay)))) + ' '; + infosfo2.inforate.Caption := trim(IntToStr(TagReader.MediaProperty.Sampling)) + ' '; // format('%d Hz', [TagReader.MediaProperty.Sampling]); if trim(lowercase(TagReader.MediaProperty.ChannelMode)) = 'joint stereo' then - infosfo2.infochan.Caption := 'Stereo ' else - infosfo2.infochan.Caption := trim(TagReader.MediaProperty.ChannelMode)+ ' '; + infosfo2.infochan.Caption := 'Stereo ' + else + infosfo2.infochan.Caption := trim(TagReader.MediaProperty.ChannelMode) + ' '; // BPM @@ -2417,10 +2419,10 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject); thebuffer := uos_File2Buffer(PChar(ansistring(historyfn.Value)), 0, thebufferinfos, -1, 1024 * 2); infosfo2.infobpm.Caption := trim(utf8decode(IntToStr(round(uos_GetBPM(thebuffer, thebufferinfos.channels, - thebufferinfos.samplerate))))) + ' '; + thebufferinfos.samplerate))))) + ' '; end; - + if (hassent = 1) then begin infosfo2.Visible := True; @@ -2573,10 +2575,10 @@ procedure tsongplayerfo.onplayercreate(const Sender: TObject); procedure tsongplayerfo.onmousewindow(const Sender: twidget; var ainfo: mouseeventinfoty); begin -if mainfo.ttimer2.Enabled then - mainfo.ttimer2.restart // to reset - else - mainfo.ttimer2.Enabled := True; + if mainfo.ttimer2.Enabled then + mainfo.ttimer2.restart // to reset + else + mainfo.ttimer2.Enabled := True; end; procedure tsongplayerfo.whosent(const Sender: tfiledialogxcontroller; var dialogkind: filedialogkindty; var aresult: modalresultty); diff --git a/src/spectrum1.pas b/src/spectrum1.pas index 15f97b9..e8b655f 100644 --- a/src/spectrum1.pas +++ b/src/spectrum1.pas @@ -1,111 +1,146 @@ unit spectrum1; + {$ifdef FPC}{$mode objfpc}{$h+}{$endif} interface + uses - msetypes,mseglob,mseguiglob,mseguiintf,mseapplication,msestat,msemenus,msegui, - msegraphics,msegraphutils,mseevent,mseclasses,mseforms,msedock,msegraphedits, - SysUtils,mseificomp,mseificompglob,mseifiglob,msescrollbar,msesimplewidgets, - msewidgets,msechart,msedispwidgets,mserichstring; + msetypes, + mseglob, + mseguiglob, + mseguiintf, + mseapplication, + msestat, + msemenus, + msegui, + msegraphics, + msegraphutils, + mseevent, + mseclasses, + mseforms, + msedock, + msegraphedits, + SysUtils, + mseificomp, + mseificompglob, + mseifiglob, + msescrollbar, + msesimplewidgets, + msewidgets, + msechart, + msedispwidgets, + mserichstring; type - tspectrum1fo = class(tdockform) - fond: tgroupbox; - groupbox1: tgroupbox; - tchartleft: tchart; - groupbox2: tgroupbox; - - labelright: tlabel; - labelleft: tlabel; - tchartright: tchart; - tstringdisp2: tstringdisp; - Spect1: tbooleanedit; - procedure onvisiblechange(const sender: TObject); - procedure onformcreated(const sender: TObject); - procedure onshowspec(const sender: TObject; var avalue: Boolean; - var accept: Boolean); - procedure crea(const sender: TObject); - procedure changecolors(const sender: TObject); - procedure changesilver(const sender: TObject); + tspectrum1fo = class(tdockform) + fond: tgroupbox; + groupbox1: tgroupbox; + tchartleft: tchart; + groupbox2: tgroupbox; + + labelright: tlabel; + labelleft: tlabel; + tchartright: tchart; + tstringdisp2: tstringdisp; + Spect1: tbooleanedit; + procedure onvisiblechange(const Sender: TObject); + procedure onformcreated(const Sender: TObject); + procedure onshowspec(const Sender: TObject; var avalue: Boolean; var accept: Boolean); + procedure crea(const Sender: TObject); + procedure changecolors(const Sender: TObject); + procedure changesilver(const Sender: TObject); end; - - + + var - spectrum1fo: tspectrum1fo; - spectrum2fo: tspectrum1fo; - spectrumrecfo: tspectrum1fo; - + spectrum1fo: tspectrum1fo; + spectrum2fo: tspectrum1fo; + spectrumrecfo: tspectrum1fo; + implementation + uses - main, dockpanel1, songplayer, recorder, spectrum1_mfm; - -procedure tspectrum1fo.onvisiblechange(const sender: TObject); + main, + dockpanel1, + songplayer, + recorder, + spectrum1_mfm; + +procedure tspectrum1fo.onvisiblechange(const Sender: TObject); begin if Visible then begin - if assigned(mainfo) then - if caption = 'Spectrum Player 1' then - mainfo.tmainmenu1.menu[4].submenu[9].Caption := ' Hide Spectrum 1 ' - else - if caption = 'Spectrum Player 2' then - mainfo.tmainmenu1.menu[4].submenu[10].Caption := ' Hide Spectrum 2 ' - else - if caption = 'Spectrum Recorder' then - mainfo.tmainmenu1.menu[4].submenu[11].Caption := ' Hide Spectrum Rec ' + if Assigned(mainfo) then + if Caption = 'Spectrum Player 1' then + mainfo.tmainmenu1.menu[4].submenu[9].Caption := ' Hide Spectrum 1 ' + else if Caption = 'Spectrum Player 2' then + mainfo.tmainmenu1.menu[4].submenu[10].Caption := ' Hide Spectrum 2 ' + else if Caption = 'Spectrum Recorder' then + mainfo.tmainmenu1.menu[4].submenu[11].Caption := ' Hide Spectrum Rec '; end - else + else if Assigned(mainfo) then + if Caption = 'Spectrum Player 1' then + mainfo.tmainmenu1.menu[4].submenu[9].Caption := ' Show Spectrum 1 ' + else if Caption = 'Spectrum Player 2' then + mainfo.tmainmenu1.menu[4].submenu[10].Caption := ' Show Spectrum 2 ' + else if Caption = 'Spectrum Recorder' then + mainfo.tmainmenu1.menu[4].submenu[11].Caption := ' Show Spectrum Rec '// dostop(Sender); + ; + if norefresh = False then begin - // dostop(Sender); - if assigned(mainfo) then - if caption = 'Spectrum Player 1' then - mainfo.tmainmenu1.menu[4].submenu[9].Caption := ' Show Spectrum 1 ' - else if caption = 'Spectrum Player 2' then - mainfo.tmainmenu1.menu[4].submenu[10].Caption := ' Show Spectrum 2 ' - else if caption = 'Spectrum Recorder' then - mainfo.tmainmenu1.menu[4].submenu[11].Caption := ' Show Spectrum Rec '; + if Assigned(mainfo) then + mainfo.updatelayoutstrum(); + if Assigned(dockpanel1fo) then + if dockpanel1fo.Visible then + dockpanel1fo.updatelayoutpan(); + if Assigned(dockpanel2fo) then + if dockpanel2fo.Visible then + dockpanel2fo.updatelayoutpan(); + if Assigned(dockpanel3fo) then + if dockpanel3fo.Visible then + dockpanel3fo.updatelayoutpan(); + if Assigned(dockpanel4fo) then + if dockpanel4fo.Visible then + dockpanel4fo.updatelayoutpan(); + if Assigned(dockpanel5fo) then + if dockpanel5fo.Visible then + dockpanel5fo.updatelayoutpan(); + end; -if norefresh = false then -begin - if assigned(mainfo) then mainfo.updatelayoutstrum(); - if assigned(dockpanel1fo) then if dockpanel1fo.visible then dockpanel1fo.updatelayoutpan(); - if assigned(dockpanel2fo) then if dockpanel2fo.visible then dockpanel2fo.updatelayoutpan(); - if assigned(dockpanel3fo) then if dockpanel3fo.visible then dockpanel3fo.updatelayoutpan(); - if assigned(dockpanel4fo) then if dockpanel4fo.visible then dockpanel4fo.updatelayoutpan(); - if assigned(dockpanel5fo) then if dockpanel5fo.visible then dockpanel5fo.updatelayoutpan(); - -end; end; -procedure tspectrum1fo.onformcreated(const sender: TObject); +procedure tspectrum1fo.onformcreated(const Sender: TObject); begin -// tchartleft.traces.count := 10; -// tchartright.traces.count := 10; + // tchartleft.traces.count := 10; + // tchartright.traces.count := 10; - tchartleft.traces[0].chartkind := tck_bar ; + tchartleft.traces[0].chartkind := tck_bar; - tchartright.traces[0].chartkind := tck_bar ; - end; + tchartright.traces[0].chartkind := tck_bar; +end; -procedure tspectrum1fo.onshowspec(const sender: TObject; var avalue: Boolean; - var accept: Boolean); - +procedure tspectrum1fo.onshowspec(const Sender: TObject; var avalue: Boolean; var accept: Boolean); begin -if avalue = false then - if caption = 'Spectrum Player 1' then songplayerfo.resetspectrum() else - if caption = 'Spectrum Player 2' then songplayer2fo.resetspectrum() else -if caption = 'Spectrum Recorder' then recorderfo.resetspectrum() ; - end; + if avalue = False then + if Caption = 'Spectrum Player 1' then + songplayerfo.resetspectrum() + else if Caption = 'Spectrum Player 2' then + songplayer2fo.resetspectrum() + else if Caption = 'Spectrum Recorder' then + recorderfo.resetspectrum(); +end; -procedure tspectrum1fo.crea(const sender: TObject); +procedure tspectrum1fo.crea(const Sender: TObject); begin -windowopacity := 0; + windowopacity := 0; end; -procedure tspectrum1fo.changecolors(const sender: TObject); +procedure tspectrum1fo.changecolors(const Sender: TObject); begin end; -procedure tspectrum1fo.changesilver(const sender: TObject); +procedure tspectrum1fo.changesilver(const Sender: TObject); begin end; end. + diff --git a/src/status.pas b/src/status.pas index 06f481c..da3ac54 100644 --- a/src/status.pas +++ b/src/status.pas @@ -1,176 +1,207 @@ unit status; + {$ifdef FPC}{$mode objfpc}{$h+}{$endif} interface + uses - classes,msegridsglob,msetypes,mseglob,mseguiglob,mseguiintf,mseapplication,msestat, - msemenus,msegui,msegraphics,msegraphutils,mseevent,mseclasses,msewidgets, - mseforms,mseact,msefileutils,msedataedits,msedropdownlist,mseedit,mseificomp, - mseificompglob,mseifiglob,msestatfile,msestream,sysutils,msesimplewidgets, - msebitmap,msedatanodes,msefiledialogx,msegrids,mselistbrowser,msesys, - msedispwidgets, mserichstring; + Classes, + msegridsglob, + msetypes, + mseglob, + mseguiglob, + mseguiintf, + mseapplication, + msestat, + msemenus, + msegui, + msegraphics, + msegraphutils, + mseevent, + mseclasses, + msewidgets, + mseforms, + mseact, + msefileutils, + msedataedits, + msedropdownlist, + mseedit, + mseificomp, + mseificompglob, + mseifiglob, + msestatfile, + msestream, + SysUtils, + msesimplewidgets, + msebitmap, + msedatanodes, + msefiledialogx, + msegrids, + mselistbrowser, + msesys, + msedispwidgets, + mserichstring; + type - tstatusfo = class(tmseform) - layoutname: tstringedit; - ok: tbutton; - cancel: tbutton; - procedure onok(const sender: TObject); - procedure oncancel(const sender: TObject); - - end; + tstatusfo = class(tmseform) + layoutname: tstringedit; + ok: TButton; + cancel: TButton; + procedure onok(const Sender: TObject); + procedure oncancel(const Sender: TObject); + + end; + var - statusfo: tstatusfo; - typstat : shortint = 0; + statusfo: tstatusfo; + typstat: shortint = 0; + implementation + uses - status_mfm, main, filelistform, equalizer; - + status_mfm, + main, + filelistform, + equalizer; -procedure tstatusfo.oncancel(const sender: TObject); +procedure tstatusfo.oncancel(const Sender: TObject); begin -close; + Close; end; -procedure tstatusfo.onok(const sender: TObject); +procedure tstatusfo.onok(const Sender: TObject); var -ordir, dataeq : string; -x : integer; -asliders: tasliders; -ds : char; + ordir, dataeq: string; + x: integer; + asliders: tasliders; + ds: char; begin -if typstat = 0 then -begin -ordir := msestring(ExtractFilePath((ParamStr(0))) - + 'layout' + directoryseparator); -if layoutname.value <> '' then begin - ordir := ordir + utf8decode(RawByteString(statusfo.layoutname.value) + '.lay'); -mainfo.tstatfile1.writestat(utf8decode(RawByteString(ordir))); -end; -end; - -if typstat = 2 then -begin -ordir := msestring(ExtractFilePath(ParamStr(0)) - + 'list' + directoryseparator); -if layoutname.value <> '' then begin - ordir := msestring(ordir + statusfo.layoutname.value + '.lis'); -filelistfo.tstatfile1.writestat((ordir)); -filelistfo.caption := statusfo.layoutname.value; -end; -end; + if typstat = 0 then + begin + ordir := msestring(ExtractFilePath((ParamStr(0))) + 'layout' + directoryseparator); + if layoutname.Value <> '' then + begin + ordir := ordir + utf8decode(RawByteString(statusfo.layoutname.Value) + '.lay'); + mainfo.tstatfile1.writestat(utf8decode(RawByteString(ordir))); + end; + end; -if (typstat = 3) then -begin -with equalizerfo1 do -begin - asliders[1] := tslider1; - asliders[2] := tslider2; - asliders[3] := tslider3; - asliders[4] := tslider4; - asliders[5] := tslider5; - asliders[6] := tslider6; - asliders[7] := tslider7; - asliders[8] := tslider8; - asliders[9] := tslider9; - asliders[10] := tslider10; - asliders[11] := tslider11; - asliders[12] := tslider12; - asliders[13] := tslider13; - asliders[14] := tslider14; - asliders[15] := tslider15; - asliders[16] := tslider16; - asliders[17] := tslider17; - asliders[18] := tslider18; - asliders[19] := tslider19; - asliders[20] := tslider20; - end; -end; - -if (typstat = 4) then -begin -with equalizerfo2 do -begin - asliders[1] := tslider1; - asliders[2] := tslider2; - asliders[3] := tslider3; - asliders[4] := tslider4; - asliders[5] := tslider5; - asliders[6] := tslider6; - asliders[7] := tslider7; - asliders[8] := tslider8; - asliders[9] := tslider9; - asliders[10] := tslider10; - asliders[11] := tslider11; - asliders[12] := tslider12; - asliders[13] := tslider13; - asliders[14] := tslider14; - asliders[15] := tslider15; - asliders[16] := tslider16; - asliders[17] := tslider17; - asliders[18] := tslider18; - asliders[19] := tslider19; - asliders[20] := tslider20; - end; -end; - -if (typstat = 5) then -begin -with equalizerforec do -begin - asliders[1] := tslider1; - asliders[2] := tslider2; - asliders[3] := tslider3; - asliders[4] := tslider4; - asliders[5] := tslider5; - asliders[6] := tslider6; - asliders[7] := tslider7; - asliders[8] := tslider8; - asliders[9] := tslider9; - asliders[10] := tslider10; - asliders[11] := tslider11; - asliders[12] := tslider12; - asliders[13] := tslider13; - asliders[14] := tslider14; - asliders[15] := tslider15; - asliders[16] := tslider16; - asliders[17] := tslider17; - asliders[18] := tslider18; - asliders[19] := tslider19; - asliders[20] := tslider20; - end; -end; - -if (typstat = 3) or (typstat = 4) or (typstat = 5) then -begin - - dataeq := ''; - - ds := decimalseparator; - - decimalseparator := '.'; - - for x := 1 to 20 do + if typstat = 2 then begin - dataeq := dataeq + floattostrf(asliders[x].value, ffFixed, 8, 4) + '|' ; + ordir := msestring(ExtractFilePath(ParamStr(0)) + 'list' + directoryseparator); + if layoutname.Value <> '' then + begin + ordir := msestring(ordir + statusfo.layoutname.Value + '.lis'); + filelistfo.tstatfile1.writestat((ordir)); + filelistfo.Caption := statusfo.layoutname.Value; + end; end; - decimalseparator := ds; - - ordir := msestring(ExtractFilePath(ParamStr(0)) - + 'equ' + directoryseparator); -if statusfo.layoutname.value <> '' then begin - ordir := msestring(ordir + statusfo.layoutname.value + '.equ'); - - with TStringList.Create do - try - Add(dataeq); - SaveToFile(ordir); - finally - Free; + + if (typstat = 3) then + with equalizerfo1 do + begin + asliders[1] := tslider1; + asliders[2] := tslider2; + asliders[3] := tslider3; + asliders[4] := tslider4; + asliders[5] := tslider5; + asliders[6] := tslider6; + asliders[7] := tslider7; + asliders[8] := tslider8; + asliders[9] := tslider9; + asliders[10] := tslider10; + asliders[11] := tslider11; + asliders[12] := tslider12; + asliders[13] := tslider13; + asliders[14] := tslider14; + asliders[15] := tslider15; + asliders[16] := tslider16; + asliders[17] := tslider17; + asliders[18] := tslider18; + asliders[19] := tslider19; + asliders[20] := tslider20; + end; + + if (typstat = 4) then + with equalizerfo2 do + begin + asliders[1] := tslider1; + asliders[2] := tslider2; + asliders[3] := tslider3; + asliders[4] := tslider4; + asliders[5] := tslider5; + asliders[6] := tslider6; + asliders[7] := tslider7; + asliders[8] := tslider8; + asliders[9] := tslider9; + asliders[10] := tslider10; + asliders[11] := tslider11; + asliders[12] := tslider12; + asliders[13] := tslider13; + asliders[14] := tslider14; + asliders[15] := tslider15; + asliders[16] := tslider16; + asliders[17] := tslider17; + asliders[18] := tslider18; + asliders[19] := tslider19; + asliders[20] := tslider20; + end; + + if (typstat = 5) then + with equalizerforec do + begin + asliders[1] := tslider1; + asliders[2] := tslider2; + asliders[3] := tslider3; + asliders[4] := tslider4; + asliders[5] := tslider5; + asliders[6] := tslider6; + asliders[7] := tslider7; + asliders[8] := tslider8; + asliders[9] := tslider9; + asliders[10] := tslider10; + asliders[11] := tslider11; + asliders[12] := tslider12; + asliders[13] := tslider13; + asliders[14] := tslider14; + asliders[15] := tslider15; + asliders[16] := tslider16; + asliders[17] := tslider17; + asliders[18] := tslider18; + asliders[19] := tslider19; + asliders[20] := tslider20; + end; + + if (typstat = 3) or (typstat = 4) or (typstat = 5) then + begin + + dataeq := ''; + + ds := decimalseparator; + + decimalseparator := '.'; + + for x := 1 to 20 do + dataeq := dataeq + floattostrf(asliders[x].Value, ffFixed, 8, 4) + '|'; + decimalseparator := ds; + + ordir := msestring(ExtractFilePath(ParamStr(0)) + 'equ' + directoryseparator); + if statusfo.layoutname.Value <> '' then + begin + ordir := msestring(ordir + statusfo.layoutname.Value + '.equ'); + + with TStringList.Create do + try + Add(dataeq); + SaveToFile(ordir); + finally + Free; + end; end; end; -end; -close; + Close; end; end. + diff --git a/src/strumpract.pas b/src/strumpract.pas index fc7073e..f2e029f 100644 --- a/src/strumpract.pas +++ b/src/strumpract.pas @@ -7,16 +7,16 @@ {$ifdef mswindows} {$R dp.res} {$endif} - - {$PACKRECORDS C} + + {$PACKRECORDS C} uses cmem, - {$ifdef FPC} {$ifdef unix} cthreads, BaseUnix, {$endif} {$endif} - + {$ifdef FPC} {$ifdef unix} cthreads, BaseUnix, {$endif} {$endif} + Classes, Math, - sysutils, + SysUtils, filelistform, msegui, main, @@ -38,12 +38,12 @@ findmessage, dialogfiles, dockpanel1; - + {$ifdef unix} var fs: TFileStream; ordir: string; -{$endif} +{$endif} begin {$ifdef unix} @@ -56,129 +56,130 @@ fs := TFileStream.Create(ordir, fmOpenReadWrite or fmCreate); FpDup2(fs.Handle, StdErrorHandle); -{$endif} - - SetExceptionMask(GetExceptionMask + [exZeroDivide] + [exInvalidOp] + - [exDenormalized] + [exOverflow] + [exUnderflow] + [exPrecision]); - +{$endif} + + SetExceptionMask(GetExceptionMask + [exZeroDivide] + [exInvalidOp] + + [exDenormalized] + [exOverflow] + [exUnderflow] + [exPrecision]); + application.createform(tconfigfo, configfo); - - application.createform(tdrumsfo, drumsfo); + + application.createform(tdrumsfo, drumsfo); drumsfo.dragdock.Caption := 'Dru'; - + drumsfo.lesson1.hint := 'First lesson.' + #10 + - 'Count slowly 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, ...,' + #10 + - 'With the stick, hit the closed hat on each count.' + #10 + - 'Count loud with your voice too.' + #10 + - 'Dont stop this for 1 minut.' ; - + 'Count slowly 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, ...,' + #10 + + 'With the stick, hit the closed hat on each count.' + #10 + + 'Count loud with your voice too.' + #10 + + 'Dont stop this for 1 minut.'; + drumsfo.lesson2.hint := 'Second lesson.' + #10 + - 'Do the same as first lesson and on count "1"' + #10 + - 'add a "boom" with your right foot on the Bass Drum.' + #10 + - 'Still count loud with your voice.' + #10 + - 'Dont stop this for 1 minut.' ; - - drumsfo.lesson3.hint := '3th lesson.' + #10 + - 'Do the same as second lesson and on count "3"' + #10 + - 'add a "clack" on the Snare Drum with the other stick.' + #10 + - 'This is the most difficult.' + #10 + - 'Still count loud with your voice.' + #10 + - 'Dont stop this for 1 minut.' ; - + 'Do the same as first lesson and on count "1"' + #10 + + 'add a "boom" with your right foot on the Bass Drum.' + #10 + + 'Still count loud with your voice.' + #10 + + 'Dont stop this for 1 minut.'; + + drumsfo.lesson3.hint := '3th lesson.' + #10 + + 'Do the same as second lesson and on count "3"' + #10 + + 'add a "clack" on the Snare Drum with the other stick.' + #10 + + 'This is the most difficult.' + #10 + + 'Still count loud with your voice.' + #10 + + 'Dont stop this for 1 minut.'; + drumsfo.lesson4.hint := 'Last lesson.' + #10 + - 'Do the same as 3th lesson but increasing the tempo.' + #10 + - 'On count "2" you may add a "boom" on the Bass Drum.' + #10 + - 'Congratulation, you are a drummer now. ;-)' ; - - application.createform(tsongplayerfo, songplayerfo); + 'Do the same as 3th lesson but increasing the tempo.' + #10 + + 'On count "2" you may add a "boom" on the Bass Drum.' + #10 + + 'Congratulation, you are a drummer now. ;-)'; + + application.createform(tsongplayerfo, songplayerfo); application.createform(tsongplayerfo, songplayer2fo); - songplayerfo.Caption := 'Player 1'; + songplayerfo.Caption := 'Player 1'; songplayer2fo.Caption := 'Player 2'; - - songplayerfo.tag := 0; + + songplayerfo.tag := 0; songplayer2fo.tag := 1; - songplayerfo.tstringdisp2.Value := 'Player 1'; + songplayerfo.tstringdisp2.Value := 'Player 1'; songplayer2fo.tstringdisp2.Value := 'Player 2'; - songplayerfo.dragdock.Caption := 'Pl1'; + songplayerfo.dragdock.Caption := 'Pl1'; songplayer2fo.dragdock.Caption := 'Pl2'; - songplayerfo.tgroupbox1.hint := ' Player 1 '; + songplayerfo.tgroupbox1.hint := ' Player 1 '; songplayer2fo.tgroupbox1.hint := ' Player 2 '; application.createform(tspectrum1fo, spectrum1fo); application.createform(tspectrum1fo, spectrum2fo); application.createform(tspectrum1fo, spectrumrecfo); - + spectrum1fo.Caption := 'Spectrum Player 1'; spectrum2fo.Caption := 'Spectrum Player 2'; - - spectrum1fo.Spect1.frame.caption := 'Spectrum Player 1 '; - spectrum2fo.Spect1.frame.caption := 'Spectrum Player 2 '; - spectrumrecfo.Spect1.frame.caption := 'Spectrum Recorder '; - + + spectrum1fo.Spect1.frame.Caption := 'Spectrum Player 1 '; + spectrum2fo.Spect1.frame.Caption := 'Spectrum Player 2 '; + spectrumrecfo.Spect1.frame.Caption := 'Spectrum Recorder '; + spectrum1fo.dragdock.Caption := 'Sp1'; spectrum2fo.dragdock.Caption := 'Sp2'; - - spectrumrecfo.Caption := 'Spectrum Recorder'; - spectrumrecfo.dragdock.Caption := 'SpR'; - + + spectrumrecfo.Caption := 'Spectrum Recorder'; + spectrumrecfo.dragdock.Caption := 'SpR'; + application.createform(tequalizerfo, equalizerfo1); application.createform(tequalizerfo, equalizerfo2); application.createform(tequalizerfo, equalizerforec); - - equalizerfo1.dragdock.Caption := 'Eq1'; - equalizerfo2.dragdock.Caption := 'Eq2'; + + equalizerfo1.dragdock.Caption := 'Eq1'; + equalizerfo2.dragdock.Caption := 'Eq2'; equalizerforec.dragdock.Caption := 'EqR'; - - equalizerfo1.Caption := 'Equalizer Player 1'; - equalizerfo2.Caption := 'Equalizer Player 2'; + + equalizerfo1.Caption := 'Equalizer Player 1'; + equalizerfo2.Caption := 'Equalizer Player 2'; equalizerforec.Caption := 'Equalizer Recorder'; - - equalizerfo1.eqen.frame.caption := 'Equalizer Player 1 '; - equalizerfo2.eqen.frame.caption := 'Equalizer Player 2 '; - equalizerforec.eqen.frame.caption := 'Equalizer Recorder '; - - equalizerfo1.tag := 0; - equalizerfo2.tag := 1; + + equalizerfo1.eqen.frame.Caption := 'Equalizer Player 1 '; + equalizerfo2.eqen.frame.Caption := 'Equalizer Player 2 '; + equalizerforec.eqen.frame.Caption := 'Equalizer Recorder '; + + equalizerfo1.tag := 0; + equalizerfo2.tag := 1; equalizerforec.tag := 2; - + application.createform(tfilelistfo, filelistfo); filelistfo.dragdock.Caption := 'Fil'; application.createform(twavefo, wavefo); wavefo.Caption := 'Wave Player 1'; - wavefo.tag := 1; + wavefo.tag := 1; wavefo.dragdock.Caption := 'Wa1'; //wavefo.waveon.frame.Caption := 'Enable Wave 1'; application.createform(twavefo, wavefo2); wavefo2.Caption := 'Wave Player 2'; - wavefo2.tag := 2; + wavefo2.tag := 2; wavefo2.dragdock.Caption := 'Wa2'; //wavefo2.waveon.frame.Caption := 'Enable Wave 2'; - - application.createform(twavefo, waveforec); - waveforec.Caption := 'Wave Recorder'; + + application.createform(twavefo, waveforec); + waveforec.Caption := 'Wave Recorder'; waveforec.dragdock.Caption := 'WaR'; - - with waveforec do begin - tmainmenu1.menu[1].state := [as_invisible,as_localinvisible]; -tmainmenu1.menu[2].state := [as_invisible,as_localinvisible]; -tmainmenu1.menu[3].state := [as_invisible,as_localinvisible]; -tmainmenu1.menu[4].state := [as_invisible,as_localinvisible]; -tmainmenu1.menu[5].state := [as_invisible,as_localinvisible]; -tmainmenu1.menu[6].state := [as_invisible,as_localinvisible]; -tmainmenu1.menu[7].state := [as_invisible,as_localinvisible]; -tmainmenu1.menu[8].state := [as_invisible,as_localinvisible]; -end; - - application.createform(tcommanderfo, commanderfo); + + with waveforec do + begin + tmainmenu1.menu[1].state := [as_invisible, as_localinvisible]; + tmainmenu1.menu[2].state := [as_invisible, as_localinvisible]; + tmainmenu1.menu[3].state := [as_invisible, as_localinvisible]; + tmainmenu1.menu[4].state := [as_invisible, as_localinvisible]; + tmainmenu1.menu[5].state := [as_invisible, as_localinvisible]; + tmainmenu1.menu[6].state := [as_invisible, as_localinvisible]; + tmainmenu1.menu[7].state := [as_invisible, as_localinvisible]; + tmainmenu1.menu[8].state := [as_invisible, as_localinvisible]; + end; + + application.createform(tcommanderfo, commanderfo); commanderfo.dragdock.Caption := 'Com'; application.createform(trecorderfo, recorderfo); @@ -193,11 +194,11 @@ application.createform(tinfosfo, infosfo); application.createform(tinfosfo, infosfo2); //application.createform(tinfosfo, infosforec); - - infosfo.Caption := 'Infos Player 1'; + + infosfo.Caption := 'Infos Player 1'; infosfo2.Caption := 'Infos Player 2'; //infosforec.Caption := 'Infos Recorder'; - + application.createform(tstatusfo, statusfo); application.createform(tdockpanel1fo, dockpanel1fo); @@ -205,19 +206,19 @@ application.createform(tdockpanel1fo, dockpanel3fo); application.createform(tdockpanel1fo, dockpanel4fo); application.createform(tdockpanel1fo, dockpanel5fo); - + dockpanel1fo.Caption := 'Dock Panel 1'; dockpanel2fo.Caption := 'Dock Panel 2'; dockpanel3fo.Caption := 'Dock Panel 3'; dockpanel4fo.Caption := 'Dock Panel 4'; dockpanel5fo.Caption := 'Dock Panel 5'; - + application.createform(trandomnotefo, randomnotefo); application.createform(timagedancerfo, imagedancerfo); - application.createform(tfindmessagefo, findmessagefo); + application.createform(tfindmessagefo, findmessagefo); application.createform(tdialogfilesfo, dialogfilesfo); dialogfilesfo.icon := equalizerfo1.icon; - + application.createform(tmainfo, mainfo); application.run; @@ -225,6 +226,7 @@ {$ifdef unix} fs.Free; // if fileexists(ordir) then deletefile(ordir); -{$endif} - +{$endif} + end. + diff --git a/src/strumpract.prj b/src/strumpract.prj index 4af5de0..f93c14e 100644 --- a/src/strumpract.prj +++ b/src/strumpract.prj @@ -322,7 +322,7 @@ options=114 index=1 [projectoptionsfo.setting_tab] firsttab=0 - index=2 + index=1 [projectoptionsfo] stackedunder= x=486 @@ -848,30 +848,9 @@ settingsstorage=0 settingsprojecttree=0 settingsautoload=0 settingsautosave=0 -modulenames=7 - COMMANDERFO - DOCKPANEL1FO - DRUMSFO - INFOSFO - MAINFO - SONGPLAYERFO - SPECTRUM1FO -moduletypes=7 - TCOMMANDERFO - TDOCKPANEL1FO - TDRUMSFO - TINFOSFO - TMAINFO - TSONGPLAYERFO - TSPECTRUM1FO -modulefiles=7 - /home/fred/strumpract/src/commander.mfm - /home/fred/strumpract/src/dockpanel1.mfm - /home/fred/strumpract/src/drums.mfm - /home/fred/strumpract/src/infos.mfm - /home/fred/strumpract/src/main.mfm - /home/fred/strumpract/src/songplayer.mfm - /home/fred/strumpract/src/spectrum1.mfm +modulenames=0 +moduletypes=0 +modulefiles=0 befcommandon=0 makeoptionson=16 4095 @@ -879,7 +858,7 @@ makeoptionson=16 0 192 0 - 1019 + 1023 511 0 0 @@ -1661,8 +1640,9 @@ envvarons=0 [edit] hintwidth=314 hintheight=200 -finddtext=onchangevalcolor +finddtext=playrandomchords findhistory=20 + playrandomchords onchangevalcolor tchartright.traces[0].chartkind bar_face.fade_color @@ -1682,124 +1662,45 @@ findhistory=20 ontimeract timer si1.cx := basedock.Width - tchartright.traces[0].chartkind := tck_bar findoptions=1 -editpos=11 - 0,-1073741823 - 0,-1073741823 - 0,7 - 0,5 - 0,-1073741823 - 0,-1073741823 - 0,-1073741823 - 0,-1073741823 - 0,-1073741823 - 0,5 - 0,3 +editpos=1 + 0,0 bookmarks0=0 -bookmarks1=0 -bookmarks2=0 -bookmarks3=0 -bookmarks4=0 -bookmarks5=0 -bookmarks6=0 -bookmarks7=0 -bookmarks8=0 -bookmarks9=0 -bookmarks10=0 -sourcefiles=11 +sourcefiles=1 ${PROJECTDIR}/strumpract.pas - ${PROJECTDIR}/spectrum1.pas - ${PROJECTDIR}/main.pas - ${PROJECTDIR}/commander.pas - ${PROJECTDIR}/commander.pas - /home/fred/mseide-msegui/lib/common/kernel/msegui.pas - /home/fred/mseide-msegui/lib/common/graphics/msegraphics.pas - ${PROJECTDIR}/dockpanel1.pas - ${PROJECTDIR}/infos.pas - ${PROJECTDIR}/songplayer.pas - ${PROJECTDIR}/drums.pas -relpaths=11 +relpaths=1 strumpract.pas - spectrum1.pas - main.pas - commander.pas - commander.pas - mseide-msegui/lib/common/kernel/msegui.pas - mseide-msegui/lib/common/graphics/msegraphics.pas - dockpanel1.pas - infos.pas - songplayer.pas - drums.pas -ismoduletexts=11 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 +ismoduletexts=1 0 - 0 -modules=9 +modules=5 /home/fred/strumpract/src/main.mfm /home/fred/strumpract/src/commander.mfm /home/fred/strumpract/src/drums.mfm /home/fred/strumpract/src/recorder.mfm /home/fred/strumpract/src/guitars.mfm - /home/fred/strumpract/src/spectrum1.mfm - /home/fred/strumpract/src/dockpanel1.mfm - /home/fred/strumpract/src/infos.mfm - /home/fred/strumpract/src/songplayer.mfm -moduleoptions=9 - 0 +moduleoptions=5 0 0 0 0 0 +visiblemodules=5 0 0 0 -visiblemodules=9 - -1 - -1 - -1 0 0 +nomenumodules=5 -1 -1 -1 -1 -nomenumodules=9 - 0 - 0 - 0 -1 - -1 - 0 - 0 - 0 - 0 [sourcefo.files_tab] -order=11 - 0 - 1 - 2 - 9 - 10 - 8 - 3 - 5 - 6 - 7 - 4 firsttab=0 -index=6 +index=0 [layout] -windowlayout=725 +windowlayout=618 [mainfo.basedock] splitdir=2 useroptions=268450944 @@ -1841,15 +1742,15 @@ windowlayout=725 ny=0 ncx=0 ncy=0 - x=493 - y=171 - cx=497 + x=478 + y=303 + cx=495 cy=314 rcx=0 rcy=0 wsize=0 active=0 - visible=1 + visible=0 [threadsfo] splitdir=0 useroptions=268451945 @@ -1943,7 +1844,7 @@ windowlayout=725 x=0 y=0 cx=205 - cy=450 + cy=451 rcx=0 rcy=0 [projecttreefo.grid] @@ -1954,7 +1855,7 @@ windowlayout=725 sortdescend1=0 sorted=0 col=0 - row=1 + row=15 rowheight=16 [stackfo] splitdir=0 @@ -1993,14 +1894,14 @@ windowlayout=725 active=0 visible=0 [watchpointsfo.grid] - propcolwidthref=352 + propcolwidthref=332 sortdescend0=0 values1=0 values1_ci=-1 width1=33 sortdescend1=0 values2=0 - width2=158 + width2=149 sortdescend2=0 width4=34 sortdescend4=0 @@ -2009,7 +1910,7 @@ windowlayout=725 width5=38 sortdescend5=0 values6=0 - width6=184 + width6=172 sortdescend6=0 [breakpointsfo] splitdir=0 @@ -2033,10 +1934,10 @@ windowlayout=725 [breakpointsfo.bkptson] value=0 [objectinspectorfo.grid] - propcolwidthref=442 - width0=196 + propcolwidthref=242 + width0=107 sortdescend0=0 - width1=240 + width1=129 sortdescend1=0 [symbolfo] splitdir=0 @@ -2100,7 +2001,7 @@ windowlayout=725 rcx=1262 rcy=583 [watchfo.grid] - propcolwidthref=111 + propcolwidthref=121 values0=0 values0_ci=-1 sortdescend0=0 @@ -2231,7 +2132,7 @@ windowlayout=725 x=0 y=0 cx=1212 - cy=51 + cy=50 rcx=0 rcy=0 [debuggerfo.basedock] @@ -2243,11 +2144,11 @@ windowlayout=725 nx=0 ny=0 ncx=1197 - ncy=58 + ncy=47 x=0 y=0 cx=1212 - cy=57 + cy=45 rcx=0 rcy=0 [debuggerfo.edit_options] @@ -2257,28 +2158,9 @@ windowlayout=725 [debuggerfo.edit_compiler] value=Pascal [debuggerfo.file_history] - value=/home/fred/strumpract/src/commander.pas - history=20 - /home/fred/strumpract/src/commander.pas - /home/fred/atest/test.prj - /home/fred/ideu/src/ideU.prj - /home/fred/mseide-msegui/apps/ide/mseide.prj - /home/fred/uos/examples/simpleplayer.prj - /home/fred/ideu_ok/src/ideU.prj - /home/fred/eschecs_mse/eschecs.prj - /home/fred/mselang-master/src/mselang.prj - /home/fred/mseide-msegui/apps/ide/mseide_zeos.prj - /home/fred/strumpract/src/strumpract.prj - /home/fred/ideu_badplug/src/demos/voiceassist/helloworld/helloworld.prj - /home/fred/xtop/src/ptop.prj - /home/fred/xtop/src/jtop.prj - /home/fred/idegraeme/mseide.prj - /home/fred/fptop/src/jtop.prj - /home/fred/fptop/src/ptop.prj - /home/fred/ptop_fred/ptop.prj - /home/fred/eschecs_mse_argh/eschecs.prj - /home/fred/Downloads/jcf-cli-master/CommandLine/Lazarus/jcf.prj - /home/fred/mseuniverse/samples/widgets/grids/chessboard/chessboard.prj + value=/home/fred/strumpract/src/strumpract.pas + history=1 + /home/fred/strumpract/src/strumpract.pas [debuggerfo.project_options] value=1 [debuggerfo.hints] @@ -2296,24 +2178,12 @@ windowlayout=725 x=208 y=0 cx=1004 - cy=450 + cy=451 rcx=0 rcy=0 [sourcefo.files_tab] - order=11 - 0 - 1 - 2 - 9 - 10 - 8 - 3 - 5 - 6 - 7 - 4 firsttab=0 - index=6 + index=0 [confideufo.fontname] value=stf_default [confideufo.usedefaulteditoroptions] @@ -2322,7 +2192,7 @@ windowlayout=725 irqoff=0 splitdir=0 useroptions=268451947 - stackedunder=_mse_recorderfo_mse_ + stackedunder=_mse_mainfo_mse_ parent= mdistate=0 nx=0 @@ -2349,15 +2219,15 @@ windowlayout=725 ncx=0 ncy=0 x=0 - y=54 + y=53 cx=1212 - cy=450 + cy=451 rcx=0 rcy=0 [_mse_mainfo_mse_] splitdir=0 useroptions=268451963 - stackedunder=_mse_songplayerfo_mse_ + stackedunder=_mse_drumsfo_mse_ parent= mdistate=3 nx=0 @@ -2372,11 +2242,11 @@ windowlayout=725 rcy=0 wsize=0 active=0 - visible=1 + visible=0 [_mse_commanderfo_mse_] splitdir=0 useroptions=268451963 - stackedunder=targetconsolefo + stackedunder=_mse_guitarsfo_mse_ parent= mdistate=3 nx=0 @@ -2391,11 +2261,11 @@ windowlayout=725 rcy=0 wsize=0 active=0 - visible=1 + visible=0 [_mse_recorderfo_mse_] splitdir=0 useroptions=268451963 - stackedunder=_mse_guitarsfo_mse_ + stackedunder=_mse_commanderfo_mse_ parent= mdistate=3 nx=0 @@ -2414,7 +2284,7 @@ windowlayout=725 [_mse_drumsfo_mse_] splitdir=0 useroptions=268451963 - stackedunder=objectinspectorfo + stackedunder=_mse_recorderfo_mse_ parent= mdistate=3 nx=0 @@ -2429,7 +2299,7 @@ windowlayout=725 rcy=0 wsize=0 active=0 - visible=1 + visible=0 [_mse_guitarsfo_mse_] splitdir=0 useroptions=268451963 @@ -2449,82 +2319,6 @@ windowlayout=725 wsize=0 active=0 visible=0 - [_mse_spectrum1fo_mse_] - splitdir=0 - useroptions=268451963 - stackedunder=_mse_dockpanel1fo_mse_ - parent= - mdistate=3 - nx=0 - ny=0 - ncx=0 - ncy=0 - x=351 - y=240 - cx=452 - cy=128 - rcx=0 - rcy=0 - wsize=0 - active=0 - visible=1 - [_mse_dockpanel1fo_mse_] - splitdir=0 - useroptions=268451963 - stackedunder=_mse_infosfo_mse_ - parent= - mdistate=3 - nx=0 - ny=0 - ncx=0 - ncy=0 - x=462 - y=211 - cx=464 - cy=96 - rcx=0 - rcy=0 - wsize=0 - active=0 - visible=1 - [_mse_infosfo_mse_] - splitdir=0 - useroptions=268451963 - stackedunder=_mse_mainfo_mse_ - parent= - mdistate=3 - nx=0 - ny=0 - ncx=0 - ncy=0 - x=43 - y=145 - cx=452 - cy=238 - rcx=0 - rcy=0 - wsize=0 - active=0 - visible=1 - [_mse_songplayerfo_mse_] - splitdir=0 - useroptions=268451963 - stackedunder=_mse_drumsfo_mse_ - parent= - mdistate=3 - nx=0 - ny=0 - ncx=0 - ncy=0 - x=506 - y=253 - cx=452 - cy=128 - rcx=0 - rcy=0 - wsize=0 - active=0 - visible=1 [targetconsole] finddtext= findhistory=0 diff --git a/src/waveform.pas b/src/waveform.pas index 74e8fda..d3cc117 100644 --- a/src/waveform.pas +++ b/src/waveform.pas @@ -104,7 +104,8 @@ procedure twavefo.onresiz(const Sender: TObject); procedure twavefo.onresiztimer(const Sender: TObject); begin -if Caption <> 'Wave Recorder' then trackbar1.Width := Width - 15; + if Caption <> 'Wave Recorder' then + trackbar1.Width := Width - 15; if ((tag = 1) and (Assigned(songplayerfo))) or ((tag = 2) and (Assigned(songplayer2fo))) or ((Caption = 'Wave Recorder') and (Assigned(recorderfo)) and (islive = False)) then begin @@ -118,7 +119,7 @@ procedure twavefo.onresiztimer(const Sender: TObject); trackbar1.Height := waveforec.Height - 18; echelle.Visible := False; end; - + onzoom(Sender); end; @@ -163,7 +164,7 @@ procedure twavefo.doechelle(const Sender: TObject); echelle[i][0] := utf8decode(IntToStr(trunc(echsec * (i + 1) / 60)) + '.' + milisec); - // echelle.datacols[i].color := cl_gray; + // echelle.datacols[i].color := cl_gray; Inc(i); end;