Leaderboard
Popular Content
Showing content with the highest reputation on 11/09/2012 in all areas
-
Having had hardly any time to work any of my ongoing major projects in the last several months, this is the first code I've written in ages. It's really for my own personal use, but thought it might interest some guitarists (there is nothing fancy in the code). Please be careful. Instructions For Use If you are a beginner then this program may not be for you. Only focus on the three and four note linear patterns and get a teacher. Do not attempt to practise any of these exercises if you experience any discomfort or pain. This is an advanced (weekly) exercise program and not a guitar lesson. I am not responsible for any injuries caused by bad technique. The linear patterns and alternating shapes are relevant to all guitarists. The arpeggios are relevant to classical flamenco and finger-style guitarists. Only the first eight notes are given to each sequence. It is necessary that the sequences be repeated on every string and at every fret position. It is best to shift one fret or string at a time. The three note linear patterns are useful in that they present a challenge to the right hand. You must alternate index and middle finger rest strokes (or use alternating up and down pick strokes). First practice this without the left hand (it's tricky). The three note patterns will always neglect one left hand finger. This neglect is counter-balanced in the five note linear patterns. The same equal overall distribution is also applied to the right hand arpeggio fingerings. Before attempting any of the arpeggios in the program, first study four note arpeggios. Spend a few months practising the six standard patterns Pima, Pami, Pmia, Piam Pmai, Paim The arpeggios are to be repeated with a variety of bass note sequences (you can invent your own). It is best to keep the left hand as simple as possible when practising arpeggios. I use a diminished chord shape and slide up or down one fret after each full rendition. Run this program once every 7 to 10 days and spend 10 to 20 minutes per day repeating the generated exercises. #include <Array.au3> #include <String.au3> Dim $sGuitarProgram = _GuitarProgram() ConsoleWrite(@CRLF & $sGuitarProgram) Func _GuitarProgram() ; Three notes per string - linear patterns Local $aThreeSeq[2][4] = [ _ ["231","241","341","342"], _ ["312","412","413","423"]] ; Four notes per string - linear patterns Local $aFourSeq[9] = [ _ "1243","1324","1342", _ "1423","2413","2134", _ "2143","2314","3124"] ; Five notes per string - linear patterns Local $aFiveSeq[8][4] = [[7,4,4,7], _ ["14342","13243","12423","12413"], _ ["14243","13423","21324","13412"], _ ["24314","23143","21423","14312"], _ ["24134","23134","23124","14213"], _ ["24143", "", "","21314"], _ ["34124", "", "","21413"], _ ["34214", "", "","31214"]] ; Alternating Shapes - effective combinations Local $aAltShape[48] = [ _ "12342143","13423214","21341243","24314213", _ "12342413","13423124","21341423","24314123", _ "12343142","13424213","21431234","24131234", _ "12343412","13424123","21431324","24131324", _ "12432134","14323214","23141243","32412134", _ "12432314","14323124","23141423","32412314", _ "12434312","14324213","23413214","31421234", _ "12434132","14324123","23413124","31421324", _ "13242143","14232134","23414213","34121234", _ "13242413","14232314","23414123","34121324", _ "13243142","14234312","24313214","34212134", _ "13243412","14234132","24313124","34212314"] ; Five stroke arpeggios Local $aFiveArp[5][3] = [[4,2,4], _ ["Pimia","Pmiam","Piama"], _ ["Piaim","Pmaim","Pmaia"], _ ["Pmiai", "","Pamai"], _ ["Paimi", "","Paiam"]] ; Six stroke arpeggios Local $aSixArp[4][3] = [[3,2,3], _ ["Pmiama","Piamai","Pimiam"], _ ["Pmaiam","Paimia","Pmiaim"], _ ["Pamaim", "","Pmaimi"]] ; Seven stroke arpeggios Local $aSevenArp[6] = ["Pimiama","Piamaim","Pmiamai","Pmaimia","Pamaimi","Paimiam"] ; With each exercise program, no finger will be neglected. Local $aExercise[7] ; Random selection of exercises $iTemp = Random(0,3,1) $aExercise[0] = $aThreeSeq[Random(0, 1, 1)][$iTemp] $aExercise[1] = $aFourSeq[Random(0, 8, 1)] $aExercise[2] = $aFiveSeq[Random(1, $aFiveSeq[0][$iTemp], 1)][$iTemp] $aExercise[3] = $aAltShape[Random(0, 47, 1)] $iTemp = Random(0,2,1) $aExercise[4] = $aFiveArp[Random(1, $aFiveArp[0][$iTemp], 1)][$iTemp] $aExercise[5] = $aSixArp[Random(1, $aSixArp[0][$iTemp], 1)][$iTemp] $aExercise[6] = $aSevenArp[Random(0, 5, 1)] ; The selection of finger patterns are based on the most effective combinations For $i = 0 To 3 If Random(0,1,1) Then $aExercise[$i] = _StringReverse($aExercise[$i]) Next ; Tablature code Local $aFormat[7] = ["11122233","11112222","11111222","43214321","","",""] $aFormat[4] = "6" & StringRight($aExercise[4], 4) & "5" & StringMid($aExercise[4], 2, 2) $aFormat[5] = "6" & StringRight($aExercise[5], 5) & "5" & StringMid($aExercise[5], 2, 1) $aFormat[6] = "6" & StringRight($aExercise[6], 6) & "5" ; Associate RH fingering with strings For $i = 4 To 6 $aFormat[$i] = StringReplace($aFormat[$i], "i", "3") $aFormat[$i] = StringReplace($aFormat[$i], "m", "2") $aFormat[$i] = StringReplace($aFormat[$i], "a", "1") Next ; Only the first eight notes of each sequence are given For $i = 0 To 6 $aExercise[$i] = _StringModalSelect($aExercise[$i], 0, 8) Next ; Headings Local $aDescription[7] = _ [" Three Note Sequence", _ " Four Note Sequence", _ " Five Note Sequence", _ " Alternating Chord Shapes", _ " Five Stroke Arpeggio", _ " Six Stroke Arpeggio", _ " Seven Stroke Arpeggio"] Local $sRet = "" ; Return string For $i = 0 To 6 ; For each exercise $sRet &= $aDescription[$i] & @CRLF For $j = 1 To 6 ; For each string $sRet &= " " ; Add padding For $k = 1 To 8 ; For each format instruction If StringMid($aFormat[$i], $k, 1) = $j Then $sRet &= Chr(151) & Chr(151) & StringMid($aExercise[$i], $k, 1) ; Place fingering Else $sRet &= Chr(151) & Chr(151) & Chr(151) ; Leave empty EndIf Next $sRet &= Chr(151) & Chr(151) & @CRLF ; Next string Next $sRet &= @CRLF Next Return $sRet EndFunc Func _StringModalSelect($sString, $iShift = 0, $iChars = 1) ; Taken from Modal UDF If $sString = "" Or (Not IsString($sString)) Then Return SetError(1, 0, "") If Not IsInt($iShift) Then Return SetError(2, 0, "") If (Not IsInt($iChars)) Or $iChars <= 0 Then Return SetError(3, 0, "") ; Get the current position of the first character for the new string Local $iStringLen = StringLen($sString) $iShift = Mod($iShift, $iStringLen) If $iShift >= 0 Then $iStart = $iShift +1 Else $iStart = $iStringLen +$iShift +1 EndIf Local $iEnd = $iStart +$iChars -1 ; Get the projected end character position If $iEnd <= $iStringLen Then Return StringMid($sString, $iStart, $iChars) ; The return string is contained within the original string Else $sTemp = $sString For $i = 1 To Int($iEnd/$iStringLen) -1 $sTemp &= $sString ; repeat the modal string loop as required Next $sTemp = StringTrimLeft($sTemp, $iStart -1) ; remove surplus leading chars Return $sTemp & StringLeft($sString, Mod($iEnd, $iStringLen)) ; Add the final character sequence EndIf EndFunc ;==> _StringModalSelect1 point
-
ledigeine, Often parameters are made up of separate elements which set different bits within them. For example in my RecFileListToArray UDF I do this sort of thing: ; Add one or more of the following to $iReturn to omit files/folders with that attribute ; + 4 - Hidden files and folders ; + 8 - System files and folders ; + 16 - Link/junction folders If we look at $iReturn in binary form we can see that each of those separate values sets a different bit so if we use them all we get: Bit value 128 64 32 16 8 4 2 1 0 0 0 1 1 1 0 0 = 28 in decimal (4+8+16) Now it is quite difficult to look at the decimal value and say whether one of those bits is set - but with BitAND it is very easy - here is an example to see if the +8 parameter was set: Bit value 128 64 32 16 8 4 2 1 Our value 0 0 0 1 1 1 0 0 8 0 0 0 0 1 0 0 0 BitAND(value, 8) looks to see if both bits are set, so we get a return of 0 0 0 0 1 0 0 0 And we can see that in this case the 8 bit was set. BitOR will set the bit if either of the parameter bits are set - look in the Setting Styles tutorial in the Wiki to see why we do this rather than simple addition to combine styles. I hope that explains a bit what is going on with the Bit* functions - they are not the easiest to understand but they are very useful. M231 point
-
AutoIt is more advanced as far as the funcionality is concerned than VBS is. Converting AutoIt script to VBS script is therefore often impossible due to missing funcionality on VBS side. In short, sometimes that's possible mostly for very basic scripts, but usually isn't.1 point
-
;~ State Comments ;~ No Change 0 ;~ $GUI_UNCHECKED Radio, Checkbox or ListViewItem will be unchecked. ;~ $GUI_CHECKED Radio, Checkbox or ListViewItem will be checked. #include <GUIConstantsEx.au3> ConsoleWrite ( $GUI_UNCHECKED & $GUI_CHECKED ) ; just an example, to check if check is present If BitAND(GUICtrlRead($Checkbox_RefreshExams), $GUI_CHECKED) Then MsgBox(1, "Warning", "Warning: It takes roughly 25 minutes to refresh exams.", 5) Possible for controls to have multiple states (returned through guictrlgetstate or guictrlread), so you should be doing a BitAND to validate it is checked/unchecked. edit: added a sample1 point
-
The whole thing keeps changing. Anyway, here's my interpretation of what's requested. ; would be the search file name, but just going to use contents for testing Global $gs_TempFile = "10772 TW MASKGIRL" & @CRLF $gs_TempFile &= "10773 TW MIDWOMAN (4 F)" & @CRLF $gs_TempFile &= "10774 TW BOY (4 M)" & @CRLF $gs_TempFile &= "10775 TW MASKMAN (4 M)" & @CRLF $gs_TempFile &= "10776 TW MIDMAN (4 M)" & @CRLF $gs_TempFile &= "10777 TW TEAMAN (4 M)" ConsoleWrite("Exact Match; Case Insensitive -> " & _my_filesearch_getdigit($gs_TempFile, "TW BOY (4 M)") & @CRLF) ; should be boy 10774 ConsoleWrite("Exact Match; Case Sensitive -> " & _my_filesearch_getdigit($gs_TempFile, "TW bOY (4 M)", True, True) & @CRLF) ; should be @error and 0 for no match ConsoleWrite("Match Any; Case Insensitive -> " & _my_filesearch_getdigit($gs_TempFile, "TW Mask", False) & @CRLF) ; should be maskgirl 10772 ConsoleWrite("Match Any; Case Sensitive -> " & _my_filesearch_getdigit($gs_TempFile, "TW MASKM", False, True) & @CRLF) ; should be maskman 10775 Func _my_filesearch_getdigit($s_file, $s_find, $f_exact = True, $f_casesensitive = false) ; assume string (test maybe) was passed Local $s_fread = $s_file ; see if string passed is a file If FileExists($s_file) Then $s_fread = FileRead($s_file) ; see if there is length to, typically file doesn't exist If Not StringLen($s_fread) Then Return SetError(1, 0, 0) ; case insensitive pattern match Local $s_pattern = "(?mi)" If $f_casesensitive Then $s_pattern = "(?m)" If $f_exact Then ; return exact match $s_pattern &= "^(d+)tQ" & $s_find & "E(?:z|v)" Else ; return first match $s_pattern &= "^(d+)t(?:.*?Q" & $s_find & "E)" EndIf ; look for pattern Local $a_find = StringRegExp($s_fread, $s_pattern, 1) ; match found? return data If Not @error Then Return $a_find[0] ; no match Return SetError(2, 0, 0) EndFunc1 point
-
How do I wait for a child window to open when I don't know its name?
jdelaney reacted to stormbreaker for a topic
He's jdelaney, not Universalist.1 point -
Very nice. Nothing more to add.1 point
-
HeJake, Another change in the goalposts! You are rapidly using up my goodwill quota for today! If you always have a random number of digits ahead of the space and the text, you could try this: #include <File.au3> Global $aLines _FileReadToArray("List.txt", $aLines) $sSearch = "Haagrid" For $i = 1 To $aLines[0] ; Search for the exact match If StringRegExp($aLines[$i], "Ad*s" & $sSearch & "z") Then MsgBox(0, "Found", $sSearch & " found on line " & $i & @CRLF & @CRLF & "Code = " & StringRegExpReplace($aLines[$i], "(d*)s.*", "$1")) ; No point in searching further ExitLoop EndIf Next But how about posting an example of the real data you are using so we can get a better pattern and not proceeed in tiny steps? M23 P.S. Decode: SRE d* - Any number of digits s - a space $sSearch - the search term z - the end of the string SRER (d*) - Capture any number of digits followed by.. s.* - a space and any number of characters $1 - Replace it all by just the digits Al clear?1 point
-
Torrent (bencode) UDF
LoranRendel reacted to wraithdu for a topic
Look here for x64 compatible machine code functions.1 point -
If/Then condition and ExitLoop ?1 point