Leaderboard
Popular Content
Showing content with the highest reputation on 06/09/2012 in all areas
-
SciTE v 3.20 Beta available
jaberwacky reacted to Jos for a topic
I have merged Neils SciTE v 3.20 Source with our own repository and have made it available in a separate directory in the Beta site. SciTE v 3.20 SciLexer.dll v3.20 History of changes My Changes: Support for "(" in filenames on error lines to fix the issue that double clicking these error lines wouldn't work.Jump to Line and Column now when double clicking the error from au3Check.Fold in Commentblocks fixes for the AU3 lexer.Word Highlighting modifications: highlight.current.word=1 highlight.current.word.by.style=1 highlight.current.word.colour=#00D040 #~ highlight.current.word.autoselectword=1 #~ highlight.current.word.wholeword=1 #~ highlight.current.word.matchcase=1 #~ highlight.current.word.minlength=2 Appreciate when people can test and let me know if they see issues or if all is working fine. Cheers, Jos Updated to 3.20 6/9/2012.1 point -
SciTE v 3.20 Beta available
jaberwacky reacted to Jos for a topic
Updated SciTE beta to v3.20 released recently. See first post.1 point -
You've worked it out, but I guess the easiest way to think about it, is to see ID3 tags as just one long (header type) string, that only really become fields during the read/write process. So in a sense, you are replacing a string of fields with a string of fields, not just a field with a field. I guess joeyb1275 could have made read an imperative before each write, which would be fine for single tag elements, but a lot of unnecessary repetition etc for multiple tags. Far better to read the whole string in once from file, modify the field/s within (in memory) then write/update the whole modified string once to file.1 point
-
Hirajoshi Wind Chime
jaberwacky reacted to czardas for a topic
Finally I decided to add a GUI to this script, albeit rather a simple one. You will need MidiOutLite.au3 in the first post above. Three more chimes have also been added. Use the arrow keys to select one from the combo. It also includes a musically brain dead artificial intelligence with ideas above its station. It is unlikely to write a number one hit in the foreseeable future. Latest Version is in #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ComboConstants.au3> #include <GUIComboBox.au3> #include <EditConstants.au3> #include 'MidiOutLite.au3' Global $open = _MidiOutOpen(), $bInterrupt ; $iChime - values range from 0 to 17 ; 0 .... Gong (CN) ..................... C D E G A C ; 1 .... Okinawa (JP) .................. C E F G B C ; 2 .... Insen (JP) .................... C Db F G Bb C ; 3 .... Nando-kyemyonjo (KR) .......... C D Eb F G C ; 4 .... Kata-kumoi (JP) ............... C D Eb F Ab C ; 5 .... Hirajoshi (JP) ................ C D Eb G Ab C ; 6 .... Chaio (CN) .................... C D F Ab Bb C ; 7 .... Ritsu (JP) .................... C Db Eb F Ab Bb C ; 8 .... Niagari (JP) .................. C Db F G Ab Bb C ; 9 .... Takemitsu Tree Line Mode 1 (JP) C D Eb Gb Ab B C ; 10 ... Takemitsu Tree Line Mode 2 (JP) C D Eb Gb Ab Bb C ; 11 ... P'yongio (KR) ................. C D F G A Bb C ; 12 ... Eskimo (1) .................... C D Eb F G Bb C ; 13 ... Eskimo (2) .................... C D E Gb Ab B C ; 14 ... Whole Tone .................... C D E F# G# A# C ; 15 ... Tritone ....................... C Db E F# G Bb C ; 16 ... Messiaen Mode 5 ............... C Db E# F# G B C ; 17 ... Stravinsky .................... C Db Eb E F# G A Bb C _Main() Func _Main() Local $hGui = GUICreate("Wind Chime", 220, 60) Local $hCombo = GUICtrlCreateCombo("Gong", 4,5, 120, 20, $CBS_DROPDOWNLIST) _GUICtrlComboBox_SetMinVisible(-1, 1) GUICtrlSetData(-1, "Okinawa|Insen|Nando-kyemyonjo|Kata-kumoi|Hirajoshi|Chaio|Ritsu|Niagari|Takemitsu (1)|" _ & "Takemitsu (2)|P'yongio|Eskimo (1)|Eskimo (2)|Whole Tone|Tritone|Messiaen Mode 5|Stravinsky","Insen") $hCheckBox = GUICtrlCreateCheckbox(" Randomise", 137, 5) $input = GUICtrlCreateInput("30", 42, 34, 45, 20, $ES_NUMBER) $updown = GUICtrlCreateUpdown($input) GUICtrlSetLimit ($updown, 999, 1) GUICtrlCreateLabel("Delay", 7, 37, 29, 20) $hBtnStart = GUICtrlCreateButton("Start", 100, 34, 50, 20) $hBtnStop = GUICtrlCreateButton("Stop", 163, 34, 50, 20) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $hBtnStart Then GUICtrlSetState($hBtnStart, $GUI_DISABLE) $iChime = _GUICtrlComboBox_GetTopIndex($hCombo) $iFlag = 0 If GUICtrlRead($hCheckBox) = $GUI_CHECKED Then $iFlag = 1 _AddLightBreeze($iChime, $iFlag, GUICtrlRead($input)*1000) GUICtrlSetState($hBtnStart, $GUI_ENABLE) EndIf WEnd EndFunc Func _AddLightBreeze($iChime, $iRandomise = 0, $iMaxCalm = 30000) Local $aChime = _LoadChime($iChime) Local $iRandomCalm, $iRandomNote, $iVolume = 65535, $iTranspose _Transpose($iChime, $iTranspose) _MidiOutShortMsg($open,256 * 14 + 192) _MidiOutSetVolume() While 1 $bInterrupt = False $iRandomNote = Random(0,7,1) _MidiOutshortmsg($open,$MIDINOTE[ $aChime[ $iRandomNote ] + $iTranspose ][0]) _MidiOutshortmsg($open,$MIDINOTE[ $aChime[ $iRandomNote ] + $iTranspose + 12 ][0]) ; Octave added. $iRandomCalm = Random(20,1000,1) If $iRandomCalm > 950 Then $iDelay = Random(0,$iMaxCalm,1) If $iDelay > 500 Then $iDelay /= 500 For $i = 1 To Round($iDelay) Sleep (500) If $bInterrupt Then $bInterrupt = False Return EndIf Next Else Sleep ($iDelay) EndIf $iVolume = 65535 _MidiOutSetVolume() ElseIf $iRandomCalm > 750 Then Sleep(Int($iRandomCalm*Random(0.5,5))) $iVolume = Int($iVolume*1.2) If ($iVolume < 32768) Or ($iVolume > 65535) Then $iVolume = 65535 _MidiOutSetVolume($iVolume) Else Sleep(Random(50,500,1)) $iVolume = Int($iVolume*.9) If $iVolume < 6554 Then $iVolume = 32768 _MidiOutSetVolume($iVolume) EndIf If $iRandomise And Not Random(0, 10, 1) Then $iChime = Random(0, 17, 1) $aChime = _LoadChime($iChime) _Transpose($iChime, $iTranspose) EndIf If $bInterrupt Then $bInterrupt = False Return EndIf WEnd EndFunc ;==> _AddLightBreeze Func _LoadChime($iChime = 2) Local $aScale[18][8] = _ [[39,41,43,46,48,51,53,55], _ ; Gong [39,43,44,46,50,51,55,56], _ ; Okinawa [37,39,40,44,46,49,51,53], _ ; Insen [39,41,42,44,46,51,53,54], _ ; Nando-kyemyonjo [39,41,42,44,47,51,53,54], _ ; Kata-kumoi [39,41,42,46,47,51,53,54], _ ; Hirajoshi [37,39,41,44,46,49,51,53], _ ; Chaio [37,39,40,42,44,47,49,51], _ ; Ritsu [37,39,40,43,44,46,49,51], _ ; Niagari [39,41,42,45,47,50,51,53], _ ; Takemitsu Tree Line Mode 1 [37,39,41,42,45,47,49,51], _ ; Takemitsu Tree Line Mode 2 [39,41,44,46,48,49,51,53], _ ; P'yongio [37,39,41,42,44,46,49,51], _ ; Eskimo (1) [39,41,43,45,47,50,51,53], _ ; Eskimo (2) [39,41,43,45,47,49,51,53], _ ; Whole Tone [39,40,43,45,46,49,51,52], _ ; Tritone [39,40,44,45,46,50,51,52], _ ; Messiaen Mode 5 [40,41,43,44,46,47,49,50]] ; Stravinsky Local $aTemp[8] For $i = 0 To 7 $aTemp[$i] = $aScale[$iChime][$i] Next Return $aTemp EndFunc ;==> _LoadChime Func _Transpose($iChime, ByRef $iTranspose) Switch $iChime Case 2, 6, 7, 8, 10, 15 $iTranspose = 10 Case 14, 17 $iTranspose = 14 Case Else $iTranspose = 15 EndSwitch EndFunc ;==> _Transpose Func _Quit() Sleep(1000) ; Allow the volume to fade a little before closing. _MidiOutSetVolume() _MidiOutclose($open) Exit EndFunc ;==> _Quit Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) If BitAND($wParam, 0x0000FFFF) = 9 Then $bInterrupt = True EndFunc ;==> _WM_COMMAND Edit Oops, I just realised I forgot to change one value during an edit. Updated code. Probably doesn't make much difference to the outcome. LOL1 point -
Hi, maybe you could use _TicksToTime() and StringFormat() to get the time to display as you need. #include <Date.au3> ; used for _TicksToTime() HotKeySet("{ESC}", "Quit") ; to exit HotKeySet("{NUMPADADD}", "start_timer") ; Start or Reset timer ;Set and unset Pause and Resume hotkeys, eliminates multi pressing of pause or resume. Global $Init0, $PausedTimer, $iHours, $iMins, $iSecs While 1 Sleep(10) ; Small sleep to lower cpu usage WEnd ; The function that starts or resets the stopwatch Func start_timer() HotKeySet("{NUMPADMULT}") ;disable resume timer HotKeySet("{NUMPADSUB}", "pause_timer") ;enable pause timer $PausedTimer = 0 $Init0 = TimerInit() AdlibRegister("show_timer", 60) EndFunc ;==>start_timer ; The function that pauses the stopwatch Func pause_timer() HotKeySet("{NUMPADSUB}") ;disable pause timer HotKeySet("{NUMPADMULT}", "resume_timer") ;enable resume timer $PausedTimer += Int(TimerDiff($Init0)) AdlibUnRegister() EndFunc ;==>pause_timer ; The function that resumes the stopwatch Func resume_timer() HotKeySet("{NUMPADMULT}") ;disable resume timer HotKeySet("{NUMPADSUB}", "pause_timer") ;enable pause timer $Init0 = TimerInit() AdlibRegister("show_timer", 60) EndFunc ;==>resume_timer Func show_timer() ; _TicksToTime to get hours, mins, seconds _TicksToTime(Int(TimerDiff($Init0) + $PausedTimer), $iHours, $iMins, $iSecs) ;StringFormat to display the time as HH:MM:SS ToolTip("HH:MM:SS = " & StringFormat("%02i:%02i:%02i", $iHours, $iMins, $iSecs), 0, 0, "Timer") EndFunc ;==>show_timer ; Exit Func Quit() Exit EndFunc ;==>Quit Cheers1 point