Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/21/2015 in all areas

  1. Pool provides multiple AutoIt processes with an infrastructure for exchanging messages, data, and remote-control instructions, on a single machine or on a local area network. It is modelled partly on HTCondor, but also incorporates user-defined messages (UDM), LANchat, mails, data Container shipping management, and remote power control and remote execution. That last feature means one process can send lines of AutoIt script to another process, and run it there (including batch control and synchronisation). Consider it my take on inter-process communication (IPC). Pool incorporates many contributions (a few are included in the bundle, other tiny snippets are part of the main script), from other forum members without whom this project simply would never even have been conceivable. In particular, I hereby want to acknowledge the excellent work of Zatorg, wraithdu, W0uter, Ward, ValeryVal, spudw2k, trancexx, This-is-Me, Nomad, Nine, Manadar, LazyCat, Lakes, Kip, Kealper, Jos, Greencan, FredAI, evilertoaster, dragan, Chimp, and AdamUL. Some codes merely helped to clarify my novice understanding of various IPC issues, others have been gratefully integrated. Three contributors need special mention: Kip & Zatorg for event-driven TCP, and trancexx for MailSlot; together these form the backbone of everything else. The only reason I still dare to publish this under my own name is because I did add over ten thousand lines of code myself. Nevertheless, Pool may serve as a showcase for how various members' example scripts can be combined into a comprehensive environment. Many, many thanks to everyone involved! Pool is designed to be simple to use. Only a few functions are public, and of those, you really only need to study these four control UDFs: _Pool_Send_Command(): Pool's Command & Control Centre (see list of commands below) _Pool_Send_UserDefinedMsg(): define your own outgoing msgs _Pool_Receive_UserDefinedMsg(): process your own incoming msgs _Pool_Send_ExeQcall(): send one or more AutoIt instructions to target's Exe-Queue (ExeQ) and these ones for data transfers: _Pool_Container_Create(): associate shipping Container with data _Pool_Container_Destroy(): release Container memory and all associated Sharing relations _Pool_Container_CreateShare(): associate destination with Container _Pool_Container_DestroyShare(): dissolve sharing association for destination To get an idea of what _Pool_Send_Command() can do, here's the list of commands: Pool is big. It has got many dozens of fixed and dynamic user-defined settings to create specific applications with (see #Region Globals). Please take the time to read the extensive Remarks section at the top of the main script (Pool.au3), including the warnings and limitations. Furthermore, I've provided two example environments in the subdir Examples in the bundle: CLNtest (messages and remote execution) and CLNmaster + CLNslave (data Container shipping). If you run these on a single machine, you'll need to start PostOffice_Solo; on multiple machines, one should start first with PostOffice_Server, the rest with PostOffice_Client, once the Server is initialised. See the readme.txt in the Examples subdir for additional help. Another example (multi-processing a la Condor) is shipped with release 2.4+ of Eigen4AutoIt. Since this is an Example script, you can find a number of interesting design ideas in Pool: Pool.v0.7.7z Pool bundle, second beta release, version 0.7 IMPORTANT CAVEAT This is an experimental beta release. Some parts of Pool have never been tested, others only in the simplest possible setting (the largest network I ever tested comprised one desktop and three laptops (one with busted radio) on a crappy Wifi router; I've never tested it on a cabled network). The (W)LAN part still has many issues and may not be able to handle more than a few machines. There's no callstack error handler. Event-driven TCP remains glitchy, and some of my MailSlots keep malfunctioning. I also lack access to Windows 8.* test environments. In addition, many issues you may encounter will be due to specific timings/event sequencing (which makes it hard to debug) and/or your specific infrastructure. That means that, most likely, I cannot recreate your Pool bugs (even with your scripts), so I cannot fix them either. Therefore, I will not be offering bug support for users at this point; there's still far too much I need to fix in my own environment to worry about yours, I'm sorry (also, I've been working on this for four months flat, and need a break from it). However, I am of course open to suggestions, remarks, criticism, and kind words (preferably the latter ). Finally, I will be exceptionally busy with work for the foreseeable future, so it may take me more time than in the past to respond to your posts. Have fun playing in the Pool.
    1 point
  2. wakillon

    Chiptunes Players

    I love chiptune music, but BASS only support XM, IT, S3M, MOD, MTM, UMX and MO3 file format for MOD music. 1 | Nintendo NES and SNES Sound File Players May be you already have some files with extension nsf, nsfe, spc or rsn (unzip rsn files for get spc collection files inside) but you can't play them in a AutoIt script ? So I searched around a bit, and found 2 DLL ( nsf_player.dll and spc_player.dll ) for play Nintendo NES and SNES Sound Files. Interest of those DLL is that they can play from file path or binary data, avoiding temp files. Dll and audio files are embedded in scripts for permit you to test them right away. Some info/download links are in front of each script. 2 | ModPlug Player Another dll found : npmod32.dll who support mod, s3m, xm, med, it, s3z, mdz, itz, xmz and wav files. Interest : it can play some rares chiptune formats, you can also pause, set volume and set position. Inconvenient : do not load from binary datas. Dll and audio files are embedded in script and i have added a gui for permit you to try right away ! Warning : Do not work on Win8. 3 | ZXTune Player 2 (basszxtune.dll v2.4.5) UPDATE of 23 DEC 2016 Using BASSZXTUNE chiptune support for BASS ( Support as0, asc, ay, ftc, gtr, psc, psg, psm, pt1, pt2, pt3, sqt, st1, s, st3, stc, stp, ts, txt, vtx, ym, chi, dmm, dst, m, sqd, str, sid, cop, tf0, tfc, tfd, tfe, $b, $m, ahx, ayc, bin, cc3, d, dsq, esv, fdi, gam, gamplus, gbs, gym, hes, hrm, hrp, lzs, msp, mtc, nsf, nsfe, p, pcd, sap, scl, spc, szx, td0, tlz, tlzp, trd, trs, vgm ) Interest : it can play lot of rares chiptune formats, while benefiting from all bass functions. Inconvenient : dll size.(5860ko) Dll and audio files are embedded in script. 4 | TitchySID Player Files and dll are loaded in memory. Interest : dll size (8ko), you can Play/Stop/Pause/Resume and choose which subsong to play. Inconvenient : only SID audio files supported ( PSID & RSID) Dll and audio files are embedded in script. Tested under Win7 and Win8. Edit : added a Sid header viewer : SidHeaderViewer.au3 5 | MiniFmod Player Interest : dll size (20ko) Inconvenient : only xm audio files supported. 6 | Npnez Player Using npnez.dll (88ko) for play Gameboy Sound System audio files and some others ( kss, hes, nsf, ay, gbr, gbs, gb, nsd, sgc ) Interest : Can be loaded in memory, subsong can be set and volume can be adjusted ( perfect for create a fade when exiting ) Inconvenient : for an unknow reason, only 20% of my hes collection is playable... 7 | µFMOD Player Interest : dll size (10ko), can be loaded in memory, support Play/Stop/Pause/Resume actions and volume can be adjusted ( perfect for create a fade when exiting ) Inconvenient : only xm audio files supported. 8 | MagicV2m Player Interest : dll size (20ko), Play/Stop/IsPlay/SetAutoRepeat/Progress Inconvenient : only v2m audio files supported, V2mPlayStream is not reliable, so prefer V2mPlayFile instead. 9 | OSMEngine Player OSMEngine.dll (80 ko)(Oldskool Musics Engine) permit to play snd, sndh, fc, fc4, fc14 and some rare jam audio files from Amiga/Atari ST(E) Interest : audio can be loaded in memory, and Pause/Resume/SetVolume/GetInfos are available Inconvenient : none at the moment. 10 | Ayfly Player Ayfly.dll (268 ko) is a AY-891x emulator and player who support the following tracker formats : aqt, asc, ay, fxm, gtr, psc, psg, pt1, pt2, pt3, sqt, stc, stp, vtx, ym and zxs (ZX Spectrum Emulator Snapshot) files. Interest : SetVolume/GetInfos are available Inconvenient : a function named "ay_initsongindirect" for load module in memory exists, but due to the poor documentation provided i do not succeed to get it to work... 11 | GMGME Player GMGME.dll is a emulated music DLL that allows you to play ay, gbs, gym, hes, kss, nsf/nsfe, sap, spc and vgm files. Interest : Can play ATARI SAP files (only type B and C) , Set Volume and Set Tempo are available Inconvenient : Dll Size (and his imports) , and audio files can not be loaded in memory. 12 | SC68 Player sc68replay.dll (166 ko) is a Freebasic DLL compiled from "sc68replay" src that allows you to play SC68 (Atari ST and Amiga audio formats) files. Interest : Can play from file and memory Inconvenient : Unfortunatelly for an unknown reason not all sc68 files are supported. 13 | Extended Module Player LibXmp.dll (272 ko) can "read" xm, mod, it, s3m, med, 669 but also some rares formats abk, amd, amf, dbm, digi, dtm, emod, far, flx, fnk, gdm, hsc, imf, j2b, liq, m15, mdl, mfp, mgt, mtm, mtn, okt, psm, ptm, rad, rtm, sfx, smp, stim, stm, stx, ult, umx, wow, ym3812 Despite its name, it's not a "player" but a library that renders module files to RAW PCM data. So the interest in this script was to find a way to convert those raw datas into a "playable" sound. With Waveform Audio Interface i create a pseudo Wav header who permit to play datas as a Wav file. Interest : Can play from file and memory Inconvenient : Time to render datas (depends of file size) 14 | LibModPlug Player LibModPlug.dll (102 ko) can "read" xm, it, mod, s3m, med, 669 and also amf, ams, dbm, dmf, dsm, far, j2b, mdl, mt2, mtm, okt, psm, ptm, stm, ult, umx. As LibXmp.dll, it's a library that renders module files to RAW PCM data. For this one, i create a real binary wave header for be able to play it easily from memory with winmm.dll PlaySoundW function. Interests : Can play from file and memory, and have some nice sound effects : Surround, MegaBass and Reverb (used in script example) It can also replace modplug player(2) for Win 8+ users Inconvenient : Time to render datas (depends of file size) 15 | AdPlug Player AdPlug.dll ( 69ko ) is an AdLib sound player library who is able to play the following files type : A2M, ADL, AMD, BAM, CFF, CMF, D00, DFM, DMO, DRO, DTM, HSC, HSP, IMF, KSM, LAA, LDS, M, MAD, MID, MKJ, MSC, MTK, RAD, RAW, RIX, ROL, S3M, SA2, SAT, SCI, SNG, XAD, XMS, XSM For this one, time to render datas is to long, so i needed to find an other way for play modules. Using Bass.dll and particulary the "BASS_StreamPutData" function i succeeded to play module in loop while rendering it. Both DLL are loaded in memory, and 16 different module types are available in the script. No includes/files needed. Just run it. Warning : for a unique file extension (example .sng), it's sometimes possible to have several filetypes from different trackers ! AdPlug.dll Imports : msvcp71.dll, msvcr71.dll in C:\Windows\SysWOW64 ( VC Redist Installer ) Interests : Can read some obscure rare formats. Inconvenient : Can not read from memory 16 | LibMikmod Player LibMikmod.dll (85ko) will currently play the following common and not so common formats : 669, AMF, DSM, FAR, GDM, IMF, IT, MED, MOD, MTM, S3M, STM, STX, ULT, UNI, XM Interests : Can load from memory Inconvenient : only for full-screen applications, because if the application has not the focus sound is muted Downloads are available in the download section Dedicated to chiptune Lovers ! Music Links : asma.atari.org woolyss.com chipmusic.org demozoo.org modarchive.org modules.pl keygenmusic.net zxtunes.com mazemod.org amigaremix.com pouet.net plopbox.eu Modland
    1 point
  3. Now replaced by a new version of the UDF in this link. <hr> [NEW VERSION] - 7 Mar 16 Added: A new option for $iAdded (+ 512) allows you to select just one cell of the ListView rather than the whole row. A new function _GUIListViewEx_SetDefColours allows the user to set the default colours when using either or both the "colour" and "single cell selection" options. Another new function _GUIListViewEx_BlockReDraw which prevents ListView redrawing during looped Insert/Delete/Change calls - this greatly speeds up execution by avoiding lengthy redrawing when using either or both the "colour" and "single cell selection" options, use of which forces the redraw to use a WM_NOTIFY handler within the script. Changed: A number of minor internal changes to speed up the loading of the ListView when using either or both of the "colour" and "single cell selection" options. A slightly modified Example_6 script shows the new functions in use. The LH native ListView can have rows and columns added/removed using both the old and new functions and has a context menu to allow for colour selection. The contents of this ListView can be mirrored to the RH UDF-created ListView which has "single cell selection" enabled and allows the colours of any item (including the selected cell) to be changed programmatically. New UDF in the zip below. Previous changes: ChangeLog.txt Hi, It seemed that I wanted to add, delete, edit or move items in a ListView quite often in my scripts and I got fed up with having to rewrite the code to do it each time. I also wanted to be able to drag items within and between ListViews with the mouse, plus edit the items. So I decided to write a UDF to make life easier and here is the result - GUIListViewEx. If you are interested in how it works, then read this bit - if not, then skip over it: The UDF is pretty easy to use: - You start by creating a ListView (either native or UDF) and passing the returned ControlID/handle and the array you used to fill it to the _Init function of the UDF. You also indicate whether the array has a count in the [0] (or [0][0]) element and if you create an empty ListView, the UDF will still cope and will shadow any items that you insert later. If you have a ListView filled with data but no matching array, there is a function to read that data into an array for you. You can select a colour for the insert mark when dragging items if you are going to use this feature - the default is black - and decide whether to have a shadow of the dragged item follow the mouse. Finally you can set the ListView to be sortable, editable - with various options to determine how the editing process works, determine external drag/drop behaviour and whether user colours are used. - You need to register a few Windows messages, but this is a single call to the _MsgRegister function. If you already have handlers for the relevant messages, there are functions to call within these handlers instead. If you do not want to drag, then you only need the WM_NOTIFY handler loaded. - Then you just need to call the main _Insert($vData), _Delete, _Up, and _Down functions when the appropriate button is pressed, select and drag items, or use one of the edit functions and your ListView responds automatically. - The UDF shadows the contents of the ListView (as explained in the spoiler section above) so you can get its current state at any time with the _ReturnArray function . Many of the functions actually return this data after each call just to help you keep track and there are dedicated Save/Load functions. - If enabled, the user can colour individual items within the ListView - and can set certain elements to be coloured on loading if required. - There are a couple of functions that you need to run in your idle loop if you need the functionality - they detect when items are dragged and edited. - When you have finished with the ListView, you should use the _Close function to clear the memory used by the UDF to shadow its contents. It is not vital, but if you use a lot of ListViews and do not do this, you could end up running out of memory. - You can have as many ListViews as you wish on display at any one time and the same "Insert", "Delete", "Up" and "Down" buttons can be used for them all - you just have to click on the one you want to be active. The UDF also allows you to set the active ListView programatically (_SetActive) - and to determine which is currently active (_GetActive). There are also additional Insert/DeleteSpec functions which allow you to action non-active ListViews. There are 6 example scripts to show the UDF working on native and UDF created ListViews, with single or multiple columns and either filled or empty, along with the UDF itself in this zip file: Credit to martin (for the basic drag code which I found on the forum), the Array UDF authors (for the basis of the array functions) and LarsJ (for the basic colour handler code). Happy for any feedback - hopefully positive! M23
    1 point
  4. BrewManNH

    Vmware + autoit

    What exactly do you mean by this? You have too many virtual machines to do this? That doesn't make a lot of sense. Using a string of Run commands that actually do what you want to do is a lot better than trying to get some ControlSends to hopefully work isn't it? After all, you can be assured that the VMWare's CLI is going to do what you're attempting where the Send/ControlSend might not, and will be easier.
    1 point
  5. To have the control IDs capsulated, you can use AutoItObject UDF, or a Map variable. AutoItObject: Declare a class for each form (dialog) and store control IDs as class member variables. Map variable: Declare a single global map variable for each form (dialog) and store control IDs as map members. Something like this: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> AutoItSetOption('GUIOnEventMode', 1) Global $mMainForm[] MainForm() Func MainForm() $mMainForm['hWnd'] = GUICreate('Login', 290, 187) GUISetOnEvent($GUI_EVENT_CLOSE, Main_btnClose_Click) GUICtrlCreateLabel('Username:', 20, 20, -1, 15) $mMainForm['txtUsername'] = GUICtrlCreateInput('', 20, 38, 250, 23) GUICtrlSetLimit(-1, 16) GUICtrlSetOnEvent(-1, Main_txtUsername_TextChanged) GUICtrlSendMsg(-1, $EM_SETCUEBANNER, True, 'Username') GUICtrlCreateLabel('Password:', 20, 71, -1, 15) $mMainForm['txtPassword'] = GUICtrlCreateInput('', 20, 89, 250, 23, BitOR($GUI_SS_DEFAULT_INPUT, $ES_PASSWORD)) GUICtrlSendMsg(-1, $EM_SETCUEBANNER, True, 'Password') $mMainForm['chkRememberMe'] = GUICtrlCreateCheckbox('Remember me', 20, 122, -1, 15) GUICtrlSetOnEvent(-1, Main_chkRememberMe_Click) GUICtrlCreateButton('Login', 195, 147, 75, 25, $BS_DEFPUSHBUTTON) GUICtrlSetOnEvent(-1, Main_btnLogin_Click) GUISetState(@SW_SHOW, $mMainForm['hWnd']) EndFunc Func Main_btnClose_Click() GUIDelete($mMainForm['hWnd']) Exit EndFunc Func Main_txtUsername_TextChanged() GUICtrlSetData($mMainForm['txtPassword'], '') EndFunc Func Main_btnLogin_Click() Local $sUsername = GUICtrlRead($mMainForm['txtUsername']) Local $sPassword = GUICtrlRead($mMainForm['txtPassword']) $sUsername = StringStripWS($sUsername, BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)) $sPassword = StringStripWS($sPassword, BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)) If $sUsername And $sPassword Then ; --- Nothing to do Else MsgBox(BitOR($MB_OK, $MB_ICONWARNING), 'Login', 'Please enter both username and password.', 0, $mMainForm['hWnd']) GUICtrlSetState($sUsername ? $mMainForm['txtPassword'] : $mMainForm['txtUsername'], $GUI_FOCUS) Return EndIf MsgBox(BitOR($MB_OK, $MB_ICONINFORMATION), 'Login', StringFormat('Welcome %s!\n\nYour password is: %s', $sUsername, $sPassword), 0, $mMainForm['hWnd']) EndFunc Func Main_chkRememberMe_Click() If GUICtrlRead($mMainForm['chkRememberMe']) = $GUI_CHECKED Then MsgBox(BitOR($MB_OK, $MB_ICONINFORMATION), 'Login', 'I will never forget you.', 0, $mMainForm['hWnd']) Else MsgBox(BitOR($MB_OK, $MB_ICONINFORMATION), 'Login', "I won't even remember you were here.", 0, $mMainForm['hWnd']) EndIf EndFunc While True Sleep(1000) WEnd
    1 point
  6. Thimotty

    What am i doing wrong?

    No, guinness, probably i won't. I did thank Zedna properly, i think. When i share s simple thought that something is strange for me to be send to "go RTFM" or "google it" is considered kinda rude. When i try to explain what and why did confused me to be told that i am "exhibiting the attitude" and I "won't last very long around here" is absolutely rude. Yes i know they are called hashes in perl and php has it's problems but they still are (or can be used as) arrays of arrays. Please, old dog, do not assume that someone has not read the manual, especialy when same one explains what confused him in the manual I am sorry if you or anyone else feel that my posts are offensive, when they are not! Your attitude (and very likely what follows) will drive me away. Best regards and take it easy!
    1 point
  7. jchd

    AES

    Why not simply use standard _Crypt* functions?
    1 point
  8. Kinshima

    Modify HTML element

    #include <ie.au3> Local $browser = _IECreate('') _IENavigate($browser,'http://www.autoitscript.com/forum/') _IELoadWait($browser) Local $html = _IEDocReadHTML($browser) Local $new_html = StringReplace($html,"Forums","New Text") _IEDocWriteHTML($browser,$new_html) Hope this will give you the directions you need. You can put the whole html line into the stringreplace.
    1 point
  9. I absolutely agree with that! There are some nice parallelas for that: for example cars - when we buy (expensive) car which we can use for travelling from point A to point B without any problem and after some very short time we should throw it away (and buy new one even more expensive) just because some idiot say it's obsolete although it still can get me nicely from point A to point B without any problems. I hate that stupid politic.
    1 point
  10. hey Guys! GUI update Much functionality added: Better Commented Results (Include Pitch and Key Number)Modify and Insert have been refined and now works on restsAbility to insert comments (Measure Lines, Key Changes, etc.)Ability to load a previously created song! Ability to mass copy/delete sections of notes.Preview of song now selects the active note!Fixed nearly all bugsBugs not yet fixed Don't Try to drag/drop items in the list view, For some unknown reason, this causes the script to crashThings Still To-do HotkeysRepeatsGive Feedback/Suggestions Please!!!! Ok, the code: #include <GUIConstants.au3> #include <Array.au3> #Include <GuiListView.au3> #include <File.au3> #include <String.au3> Opt('GuiOnEventMode',1) Dim $KeySigSharps[8][2] = _ [["C","A"],["G","E"],["D","B"],["A","F#"],["E","C#"],["B","G#"],["F#","D#"],["C#","A#"]] Dim $KeySigFlats[8][2] = _ [["C","A"],["F","D"],["B","G"],["Eb","C"],["Ab","F"],["Db","Bb"],["Gb","Eb"],["Cb","Ab"]] Dim $Pitches = StringSplit( _ "4186.01|3951.07|"& _ "3729.31|3520.00|3322.44|"& _ "3135.96|2959.96|2793.83|"& _ "2637.02|2489.02|2349.32|"& _ "2217.46|2093.00|1975.53|"& _ "1864.66|1760.00|1661.22|"& _ "1567.98|1479.98|1396.91|"& _ "1318.51|1244.51|1174.66|"& _ "1108.73|1046.50|987.767|"& _ "932.328|880.000|830.609|"& _ "783.991|739.989|698.456|"& _ "659.255|622.254|587.330|"& _ "554.365|523.251|493.883|"& _ "466.164|440.000|415.305|"& _ "391.995|369.994|349.228|"& _ "329.628|311.127|293.665|"& _ "277.183|261.626|246.942|"& _ "233.082|220.000|207.652|"& _ "195.998|184.997|174.614|"& _ "164.814|155.563|146.832|"& _ "138.591|130.813|123.471|"& _ "116.541|110.000|103.826|"& _ "97.9989|92.4986|87.3071|"& _ "82.4069|77.7817|73.4162|"& _ "69.2957|65.4064|61.7354|"& _ "58.2705|55.0000|51.9130|"& _ "48.9995|46.2493|43.6536|"& _ "41.2035|38.8909|36.7081|"& _ "34.6479|32.7032|30.8677|"& _ "29.1353|27.5000|", "|") Dim $NoteOctavePitch[89][3] For $i = 1 to 88 For $x = 0 to 2 Switch $x Case 0;Note Name For $y = 0 to 8 If $i = 1+(12*$y) then $NoteOctavePitch[$i][$x] = "A" If $i = 2+(12*$y) then $NoteOctavePitch[$i][$x] = "A#" If $i = 3+(12*$y) then $NoteOctavePitch[$i][$x] = "B" If $i = 4+(12*$y) then $NoteOctavePitch[$i][$x] = "C" If $i = 5+(12*$y) then $NoteOctavePitch[$i][$x] = "C#" If $i = 6+(12*$y) then $NoteOctavePitch[$i][$x] = "D" If $i = 7+(12*$y) then $NoteOctavePitch[$i][$x] = "D#" If $i = 8+(12*$y) then $NoteOctavePitch[$i][$x] = "E" If $i = 9+(12*$y) then $NoteOctavePitch[$i][$x] = "F" If $i = 10+(12*$y) then $NoteOctavePitch[$i][$x] = "F#" If $i = 11+(12*$y) then $NoteOctavePitch[$i][$x] = "G" If $i = 12+(12*$y) then $NoteOctavePitch[$i][$x] = "G#" Next Case 1;Octave If $i <=12 then $NoteOctavePitch[$i][$x]= 1 If $i >12 And $i<=24 then $NoteOctavePitch[$i][$x]= 2 If $i >24 And $i<=36 then $NoteOctavePitch[$i][$x]= 3 If $i >36 And $i<=48 then $NoteOctavePitch[$i][$x]= 4 If $i >48 And $i<=60 then $NoteOctavePitch[$i][$x]= 5 If $i >60 And $i<=72 then $NoteOctavePitch[$i][$x]= 6 If $i >72 And $i<=84 then $NoteOctavePitch[$i][$x]= 7 If $i >84 And $i<=88 then $NoteOctavePitch[$i][$x]= 8 Case 2;Frequency $NoteOctavePitch[$i][$x] = $Pitches[89-$i] EndSwitch Next Next $GUI = GUICreate("Beep Song Creator", 608, 447, 218, 115) GUISetOnEvent($GUI_EVENT_CLOSE,"Quit",$GUI) $Group1 = GUICtrlCreateGroup("General Information", 192, 8, 217, 81) $Title = GUICtrlCreateInput("", 256, 24, 113, 21) GUICtrlCreateLabel("Title:", 200, 24, 27, 17) GUICtrlCreateLabel("Composer:", 200, 56, 54, 17) $Composer = GUICtrlCreateInput("", 256, 56, 113, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Pitch Properties", 192, 104, 217, 125) $Pitch = GUICtrlCreateCombo("", 232, 124, 89, 25) GUICtrlSetData(-1, "A|A#|B|C|C#|D|D#|E|F|F#|G|G#", "A") GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetOnEvent(-1, "UpdatePitch") $Octave = GUICtrlCreateInput("1", 368, 123, 35, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY,$ES_NUMBER)) GUICtrlSetBkColor(-1, 0xFFFFFF) $UpDwn=GUICtrlCreateUpdown($Octave) GUICtrlSetOnEvent(-1, "UpdatePitch") GUICtrlSetLimit(-1,8,1) $KeyNum = GUICtrlCreateInput("1", 272, 184, 89, 21,$ES_NUMBER) GUICtrlSetOnEvent(-1, "UpdatePitch") GUICtrlSetBkColor(-1, 0xFFFFFF) $UpDwn2=GUICtrlCreateUpdown($KeyNum) GUICtrlSetOnEvent(-1, "UpdatePitch") GUICtrlSetLimit(-1,88,1) GUICtrlCreateLabel("Octave:", 324, 126, 42, 17) GUICtrlCreateLabel("Pitch:", 200, 126, 31, 17) GUICtrlCreateLabel("Key Number:", 201, 186, 65, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group5 = GUICtrlCreateGroup("Duration Properties", 192, 235, 217, 200) $CNoteRadio = GUICtrlCreateRadio("Custom Duration", 200, 254, 121, 25) GUICtrlSetOnEvent(-1, "DurationDepends") GUICtrlSetState(-1,$GUI_CHECKED) $CNoteDur = GUICtrlCreateInput("250", 248, 280, 73, 21, $ES_NUMBER) $BNoteRadio = GUICtrlCreateRadio("Base Duration", 200, 304, 121, 25) GUICtrlSetOnEvent(-1, "DurationDepends") $BNoteDur = GUICtrlCreateInput("250", 248, 334, 81, 21, $ES_NUMBER) $NoteType = GUICtrlCreateCombo("Quarter", 248, 366, 129, 25) GUICtrlSetData(-1, "Sixteenth|Dotted Sixteenth|Eighth|Dotted Eighth|Dotted Quarter|Half|Dotted Half|Whole") $AddNote = GUICtrlCreateButton("Add Note", 208, 396, 65, 25, 0) GUICtrlSetOnEvent(-1, "AddNote") $PrevNote = GUICtrlCreateButton("Preview", 288, 396, 65, 25, 0) GUICtrlSetOnEvent(-1, "PreviewNote") GUICtrlCreateLabel("ms", 328, 282, 17, 17) GUICtrlCreateLabel("ms", 338, 335, 17, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("Key Signature", 16, 8, 161, 121) $KeySigNum = GUICtrlCreateInput("0", 32, 280-248, 49, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlSetBkColor(-1, 0xFFFFFF) $UpDwn3=GUICtrlCreateUpdown($KeySigNum) GUICtrlSetOnEvent(-1, "UpdateKeySig") GUICtrlSetLimit(-1,7,0) $KeySigType = GUICtrlCreateCombo("Sharps", 88, 280-248, 65, 25) GUICtrlSetData(-1, "Flats") GUICtrlSetOnEvent(-1, "UpdateKeySig") $MajorDisp = GUICtrlCreateInput("", 48, 312-248, 97, 21,$ES_READONLY) $MinorDisp = GUICtrlCreateInput("", 48, 344-248, 97, 21,$ES_READONLY) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group4 = GUICtrlCreateGroup("Rest Properties", 16, 240-100, 161, 193) $AddRest = GUICtrlCreateButton("Add Rest", 472-408, 400-100, 57, 25, 0) GUICtrlSetOnEvent(-1, "AddRest") $CRestRadio = GUICtrlCreateRadio("Custom Duration", 434-408, 261-100, 121, 25) GUICtrlSetOnEvent(-1, "RestDepends") GUICtrlSetState(-1,$GUI_CHECKED) $CRestDur = GUICtrlCreateInput("250", 447-408, 287-100, 73, 21, $ES_NUMBER) $BRestRadio = GUICtrlCreateRadio("Base Duration", 435-408, 316-100, 121, 17) GUICtrlSetOnEvent(-1, "RestDepends") $BRestDur = GUICtrlCreateInput("250", 442-408, 340-100, 81, 21, $ES_NUMBER) $RestType = GUICtrlCreateCombo("Quarter", 442-408, 374-100, 129, 25) GUICtrlSetData(-1, "Sixteenth|Eighth|Half|Whole") GUICtrlCreateLabel("ms", 528-408, 288-100, 17, 17) GUICtrlCreateLabel("ms", 528-408, 343-100, 17, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $SongView = _GUICtrlListView_Create($GUI, "Key|Note|Duration", 424, 16, 170, 300,BitOR($LVS_SHOWSELALWAYS,$LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($Songview, BitOR($LVS_EX_FULLROWSELECT,$LVS_EX_FLATSB)) _GUICtrlListView_AddItem($Songview,"TestT") _GUICtrlListView_AddSubItem($Songview,0,"TestTest",1) _GUICtrlListView_AddSubItem($Songview,0,"TestTestT",2) _GUICtrlListView_SetColumnWidth ($SongView, 0,$LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth ($SongView, 1,$LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth ($SongView, 2,$LVSCW_AUTOSIZE) _GUICtrlListView_DeleteItem($Songview, 0) $Copy = GUICtrlCreateButton("Copy selected", 432, 330, 145, 25, 0) GUICtrlSetOnEvent(-1, "CopyNote") $Insert = GUICtrlCreateButton("Insert", 432, 365, 65, 25, 0) GUICtrlSetOnEvent(-1, "InsertNote") $Modify = GUICtrlCreateButton("Modify", 512, 365, 65, 25, 0) GUICtrlSetOnEvent(-1, "ModifyNote") $Clear = GUICtrlCreateButton("Clear", 432, 400, 65, 25, 0) GUICtrlSetOnEvent(-1, "ClearList") $Delete = GUICtrlCreateButton("Delete", 512, 400, 65, 25, 0) GUICtrlSetOnEvent(-1, "Delete") $Open = GUICtrlCreateButton("Open", 20, 365, 145, 25, 0) GUICtrlSetOnEvent(-1, "OpenSong") $Preview = GUICtrlCreateButton("Preview", 20, 400, 65, 25, 0) GUICtrlSetOnEvent(-1, "PreviewSong") $Create = GUICtrlCreateButton("Create", 100, 400, 65, 25, 0) GUICtrlSetOnEvent(-1, "CreateSong") GUISetState(@SW_SHOW) RestDepends() DurationDepends() UpdateKeySig() While 1 Sleep(100) WEnd Func CopyNote() $index= _GUICtrlListView_GetSelectedIndices($SongView,True) Dim $Items[$index[0]+1] $Items[0] = $index[0] For $i = 1 to $index[0] $Items[$i] = ProcessItem($index[$i]) Next For $i = 1 to $Items[0] $info = StringSplit($Items[$i],"|") $idx = _GUICtrlListView_InsertItem($SongView, $info[1]) _GUICtrlListView_SetItemText ($SongView, $idx, $info[2], 1) _GUICtrlListView_SetItemText ($SongView, $idx, $info[3], 2) Next _GUICtrlListView_Scroll($SongView,0,_GUICtrlListView_GetItemCount($SongView)*16) EndFunc func ProcessItem($index) $String = "" $array = _GUICtrlListView_GetItemTextArray ($SongView, $index) For $i = 1 to $array[0] $String &= $Array[$i]&"|" Next Return StringTrimRight($String,1) EndFunc Func ModifyNote() $index= _GUICtrlListView_GetSelectedIndices($SongView) If StringInStr($index, "|") Then $Temp = StringSplit($index,"|") $index = $Temp[1] EndIf $Array= _GUICtrlListView_GetItemTextArray($SongView, $index) If $index = "" then MsgBox(0,"Error", "Please select a note to modify.") Return ElseIf $Array[1]="R" then Do $Duration = InputBox("Modify","Input duration of the note.", $Array[3]) $Duration = Number($Duration) Until IsNumber($Duration) _GUICtrlListView_SetItemText($SongView, $index, $Duration,2) ElseIf StringLeft($Array[1], 1) = ";" Then $Comment = InputBox("Modify", "Enter New Commment Text", $Array[1], " M5") If @error then Return _GUICtrlListView_SetItemText($SongView, $index, $Comment) Else $NewNote = InputBox("Modify", "Input Key Number or Note(with octive)"&@CRLF&'ex. "40" or "C4" or "C#4"', $Array[1]) If @error then Return $NewNote=StringUpper($NewNote) If StringRegExp($NewNote, "[ABCDEFG](#)?(\d){1}") Then $Name = $NewNote For $a = 1 to 88 If $Name=$NoteOctavePitch[$a][0]&$NoteOctavePitch[$a][1] Then $Num=$a Next ElseIf StringRegExp($NewNote, "(\d){1,2}") And $NewNote<88 Then $Num = $NewNote $Name = $NoteOctavePitch[$num][0]&$NoteOctavePitch[$num][1] Else MsgBox(0,"Error", "Unrecognized note. Try again.") ModifyNote() Return EndIf Do $Duration = InputBox("Modify","Input duration of the note.", $Array[3]) $Duration = Number($Duration) Until IsNumber($Duration) _GUICtrlListView_SetItemText($SongView, $index, $Num) _GUICtrlListView_SetItemText($SongView, $index, $Name,1) _GUICtrlListView_SetItemText($SongView, $index, $Duration,2) EndIf EndFunc Func InsertNote() $index= _GUICtrlListView_GetSelectedIndices($SongView) If StringInStr($index, "|") Then $Temp = StringSplit($index,"|") $index = $Temp[1]+1 Else $index+=1 EndIf If $index = "" then MsgBox(0,"Error", "Please select a location, or use ""Add Note"".") Return Else $NewNote = InputBox("Insert", "Input Key Number or Note(with octive)"&@CRLF&'ex. "40" or "C4" or "C#4"',"", " M5") If @error then Return If Not StringLeft($NewNote,1) = ";" then $NewNote = StringUpper($NewNote) If StringRegExp($NewNote, "[ABCDEFG](#)?(\d){1}") Then $Name = $NewNote For $a = 1 to 88 If $Name=$NoteOctavePitch[$a][0]&$NoteOctavePitch[$a][1] Then $Num=$a Next ElseIf StringRegExp($NewNote, "(\d){1,2}") And $NewNote<88 Then $Num = $NewNote $Name = $NoteOctavePitch[$num][0]&$NoteOctavePitch[$Num][1] ElseIf $NewNote = "R" or $Newnote = "Rest" Then $Num = "R" $Name = "Rest" ElseIf StringLeft($NewNote,1) = ";" then _GUICtrlListView_InsertItem($SongView, $NewNote,$index) Return Elseif Not $NewNote = "" then MsgBox(0,"Error", "Unrecognized note. Try again.") InsertNote() Return Else Return EndIf Do $Duration = InputBox("Insert","Input duration of the note.") $Duration = Number($Duration) Until IsNumber($Duration) _GUICtrlListView_InsertItem($SongView, $Num,$index) _GUICtrlListView_SetItemText($SongView, $index, $Name,1) _GUICtrlListView_SetItemText($SongView, $index, $Duration,2) _GUICtrlListView_Scroll($SongView,0,$index-1*16) EndIf EndFunc Func Quit() Exit EndFunc Func RestDepends() If GUICtrlRead($CRestRadio) = $GUI_UNCHECKED Then GUICtrlSetState($CRestDur, $GUI_DISABLE) GUICtrlSetState($BRestDur, $GUI_ENABLE) GUICtrlSetState($RestType, $GUI_ENABLE) Else GUICtrlSetState($CRestDur, $GUI_ENABLE) GUICtrlSetState($BRestDur, $GUI_DISABLE) GUICtrlSetState($RestType, $GUI_DISABLE) EndIf EndFunc Func DurationDepends() If GUICtrlRead($CNoteRadio) = $GUI_UNCHECKED Then GUICtrlSetState($CNoteDur, $GUI_DISABLE) GUICtrlSetState($BNoteDur, $GUI_ENABLE) GUICtrlSetState($NoteType, $GUI_ENABLE) Else GUICtrlSetState($CNoteDur, $GUI_ENABLE) GUICtrlSetState($BNoteDur, $GUI_DISABLE) GUICtrlSetState($NoteType, $GUI_DISABLE) EndIf EndFunc Func UpdateKeySig() If GUICtrlRead($KeySigType) = "Sharps" Then $Num = GUICtrlRead($KeySigNum) $KeyMaj = $KeySigSharps[$Num][0] $KeyMin = $KeySigSharps[$Num][1] GUICtrlSetData($MajorDisp, "Major: "&$KeyMaj) GUICtrlSetData($MinorDisp, "Minor: "&$KeyMin) ElseIf GUICtrlRead($KeySigType) = "Flats" Then $Num = GUICtrlRead($KeySigNum) $KeyMaj = $KeySigFlats[$Num][0] $KeyMin = $KeySigFlats[$Num][1] GUICtrlSetData($MajorDisp, "Major: "&$KeyMaj) GUICtrlSetData($MinorDisp, "Minor: "&$KeyMin) Else GUICtrlSetData($MajorDisp, "Major: Error") GUICtrlSetData($MinorDisp, "Minor: Error") EndIf EndFunc Func UpdatePitch() Switch @GUI_CtrlID Case $UpDwn2,$KeyNum ControlCommand($GUI, "","ComboBox1","SelectString",$NoteOctavePitch[GUICtrlRead($KeyNum)][0]) GUICtrlSetData($Octave, $NoteOctavePitch[GUICtrlRead($KeyNum)][1]) If GuiCtrlRead($Octave) = 8 Then GUICtrlSetData($Pitch, "|A|A#|B|C",$NoteOctavePitch[GUICtrlRead($KeyNum)][0]) Else GUICtrlSetData($Pitch, "|A|A#|B|C|C#|D|D#|E|F|F#|G|G#",$NoteOctavePitch[GUICtrlRead($KeyNum)][0]) EndIf Case $Pitch For $x = 1 to 88 If $NoteOctavePitch[$x][0] = GUICtrlRead($Pitch) AND $NoteOctavePitch[$x][1] = GUICtrlRead($Octave) Then GUICtrlSetData($KeyNum, $x) EndIf Next If GuiCtrlRead($Octave) = 8 And (Not GuiCtrlRead($Pitch) = "A" Or Not GuiCtrlRead($Pitch) = "B" Or Not GuiCtrlRead($Pitch) = "B#" Or Not GuiCtrlRead($Pitch) = "C") Then GUICtrlSetData($Pitch, "|A|A#|B|C","C") Case $UpDwn For $x = 1 to 88 If $NoteOctavePitch[$x][0] = GUICtrlRead($Pitch) AND $NoteOctavePitch[$x][1] = GUICtrlRead($Octave) Then GUICtrlSetData($KeyNum, $x) EndIf Next If GuiCtrlRead($Octave) = 8 Then GUICtrlSetData($Pitch, "|A|A#|B|C",$NoteOctavePitch[GUICtrlRead($KeyNum)][0]) Else GUICtrlSetData($Pitch, "|A|A#|B|C|C#|D|D#|E|F|F#|G|G#",$NoteOctavePitch[GUICtrlRead($KeyNum)][0]) EndIf EndSwitch If GuiCtrlRead($Pitch) = "" then GUICtrlSetData($KeyNum,0) EndFunc Func AddNote() If GuiCtrlRead($KeyNum)= 0 Then MsgBox(0,"Error", "Pitch Settings Invalid.") Return EndIf $Key = GUICtrlRead($KeyNum) $Note = GUICtrlRead($Pitch) $Octave1 = GUICtrlRead($Octave) If GuiCtrlRead($CNoteRadio)= $GUI_CHECKED Then $Duration = GuiCtrlRead($CNoteDur) ElseIf GuiCtrlRead($BNoteRadio)= $GUI_CHECKED Then Switch GUICtrlRead($NoteType) Case "Quarter" $Duration = GuiCtrlRead($BNoteDur) Case "Sixteenth" $Duration = GuiCtrlRead($BNoteDur)/4 Case "Eighth" $Duration = GuiCtrlRead($BNoteDur)/2 Case "Half" $Duration = GuiCtrlRead($BNoteDur)*2 Case "Whole" $Duration = GuiCtrlRead($BNoteDur)*4 Case "Dotted Quarter" $Duration = GuiCtrlRead($BNoteDur)*1.5 Case "Dotted Sixteenth" $Duration = (GuiCtrlRead($BNoteDur)/4)*1.5 Case "Dotted Eighth" $Duration = (GuiCtrlRead($BNoteDur)/2)*1.5 Case "Dotted Half" $Duration = (GuiCtrlRead($BNoteDur)*2)*1.5 Case "Dotted Whole" $Duration = (GuiCtrlRead($BNoteDur)*4)*1.5 EndSwitch EndIf $idx = _GUICtrlListView_InsertItem($SongView, $Key) _GUICtrlListView_SetItemText ($SongView, $idx, $Note&$Octave1, 1) _GUICtrlListView_SetItemText ($SongView, $idx, $Duration, 2) _GUICtrlListView_Scroll($SongView,0,_GUICtrlListView_GetItemCount($SongView)*16) EndFunc Func PreviewNote() $Key = GUICtrlRead($KeyNum) If GuiCtrlRead($CNoteRadio)= $GUI_CHECKED Then $Duration = GuiCtrlRead($CNoteDur) ElseIf GuiCtrlRead($BNoteRadio)= $GUI_CHECKED Then Switch GUICtrlRead($NoteType) Case "Quarter" $Duration = GuiCtrlRead($BNoteDur) Case "Sixteenth" $Duration = GuiCtrlRead($BNoteDur)/4 Case "Eighth" $Duration = GuiCtrlRead($BNoteDur)/2 Case "Half" $Duration = GuiCtrlRead($BNoteDur)*2 Case "Whole" $Duration = GuiCtrlRead($BNoteDur)*4 Case "Dotted Quarter" $Duration = GuiCtrlRead($BNoteDur)*1.5 Case "Dotted Sixteenth" $Duration = (GuiCtrlRead($BNoteDur)/4)*1.5 Case "Dotted Eighth" $Duration = (GuiCtrlRead($BNoteDur)/2)*1.5 Case "Dotted Half" $Duration = (GuiCtrlRead($BNoteDur)*2)*1.5 EndSwitch EndIf Beep($NoteOctavePitch[$Key][2],$Duration) EndFunc Func Delete() _GUICtrlListView_DeleteItemsSelected($SongView) EndFunc Func ClearList() $ans = MsgBox(4, "Clear", "Are your sure you want to delete all notes?") If $ans=6 Then _GUICtrlListView_DeleteAllItems($SongView) EndIf EndFunc Func PreviewSong() $Count = _GUICtrlListView_GetItemCount($SongView) $index = _GUICtrlListView_GetSelectedIndices($SongView) If Not $index = "" Then If StringInStr($index, "|") Then $Temp = StringSplit($index,"|") $Selected = $Temp[1] Else $Selected = $index EndIf Else $Selected = 0 EndIf For $z = $Selected to $Count-1 If $z>18 then _GUICtrlListView_Scroll($SongView,0,16) _GUICtrlListView_SetItemSelected($Songview, $z) If $z>0 then _GUICtrlListView_SetItemSelected($Songview, $z-1,0) $Item = _GUICtrlListView_GetItemTextArray($SongView, $z) If $Item[1] = "R" then Sleep($Item[3]) Else Beep($NoteOctavePitch[$Item[1]][2], $Item[3]) EndIf Next EndFunc Func AddRest() If GuiCtrlRead($CRestRadio)= $GUI_CHECKED Then $Duration = GuiCtrlRead($CRestDur) ElseIf GuiCtrlRead($BRestRadio)= $GUI_CHECKED Then Switch GUICtrlRead($RestType) Case "Quarter" $Duration = GuiCtrlRead($BRestDur) Case "Sixteenth" $Duration = GuiCtrlRead($BRestDur)/4 Case "Eighth" $Duration = GuiCtrlRead($BRestDur)/2 Case "Half" $Duration = GuiCtrlRead($BRestDur)*2 Case "Whole" $Duration = GuiCtrlRead($BRestDur)*4 EndSwitch EndIf $idx = _GUICtrlListView_InsertItem($SongView, "R") _GUICtrlListView_SetItemText ($SongView, $idx, "Rest", 1) _GUICtrlListView_SetItemText ($SongView, $idx, $Duration, 2) _GUICtrlListView_Scroll($SongView,0,_GUICtrlListView_GetItemCount($SongView)*16) EndFunc Func CreateSong() If GUICtrlRead($KeySigType) = "Sharps" Then $Num = GUICtrlRead($KeySigNum) $KeyMaj = $KeySigSharps[$Num][0] ElseIf GUICtrlRead($KeySigType) = "Flats" Then $Num = GUICtrlRead($KeySigNum) $KeyMaj = $KeySigFlats[$Num][0] EndIf $Path = FileSaveDialog("Path", @DesktopDir, "Autoit Script(*.au3)",16, GuiCtrlRead($Title)&"-"&GuiCtrlRead($Composer)&".au3") $Count = _GUICtrlListView_GetItemCount($SongView) $File = FileOpen($Path, 2) FileWrite($File,"#cs"&@CRLF&"Title: "&GuiCtrlRead($Title)&@CRLF&"Composer: "&GuiCtrlRead($Composer)&@CRLF&"Key Signature: "&$KeyMaj&@CRLF&"#ce"&@CRLF) For $z = 0 to $Count-1 $array = _GUICtrlListView_GetItemTextArray($SongView, $z) If $array[1] = "R" then $Line = "Sleep("&$array[3]&");Rest" ElseIf StringLeft($Array[1],1) =";" Then $Line = $Array[1] Else $Line = "Beep("&$NoteOctavePitch[$array[1]][2]&", "&$array[3]&");"&$array[2]&" - "&$array[1] EndIf FileWriteLine($File, $Line) Next FileClose($File) EndFunc Func OpenSong() If _GUICtrlListView_GetItemCount($SongView) >0 then $ans = MsgBox(4, "Open", "This will delete your current compilation. Continue?") If $ans=6 Then _GUICtrlListView_DeleteAllItems($SongView) Else Return EndIf EndIf Dim $Lines $Path = FileOpenDialog("Path", @DesktopDir, "Autoit Script(*.au3)",3) If not _FileReadToArray($Path, $Lines) then MsgBox(0,"", "Error Opening File.") Return EndIf $NewTitle = StringTrimLeft($Lines[2], Stringlen("Title: ")) $NewComp = StringTrimLeft($Lines[3], Stringlen("Composer: ")) $NewMajKey = StringTrimLeft($Lines[4], Stringlen("Key Signature: ")) For $i = 6 to $Lines[0] $Lines[$i] = StringStripWS($Lines[$i],8) Switch StringLeft($Lines[$i],1) Case "S" $Temp = _StringBetween($Lines[$i],"(",")") $Dur = $Temp[0] $idx = _GUICtrlListView_AddItem($SongView, "R") _GUICtrlListView_SetItemText ($SongView, $idx, "Rest", 1) _GUICtrlListView_SetItemText ($SongView, $idx, $Dur, 2) Case "B" $Temp = _StringBetween($Lines[$i],",",")") $iPitch = Number(StringRight($Lines[$i],2)) ;MsgBox(0,"",$Pitch) IF not $iPitch Then Msgbox(0,"Error","Error"&@CRLF&"Note line is not properly formatted."&@CRLF&"Line: "&$i&@CRLF&@CRLF&$Lines[$i]) Return EndIf If IsArray($Temp) then $Dur = $Temp[0] Else MsgBox(0,"",$Temp) EndIf $idx = _GUICtrlListView_AddItem($SongView, $iPitch) _GUICtrlListView_SetItemText ($SongView, $idx, $NoteOctavePitch[$iPitch][0]&$NoteOctavePitch[$iPitch][1], 1) _GUICtrlListView_SetItemText ($SongView, $idx, $Dur, 2) Case ";" _GUICtrlListView_AddItem($SongView, $lines[$i]) Case "" Case Else MsgBox(0,"Error", "Error"&@CRLF&"Line is not recognized as a note, rest or comment."&@CRLF&"Line: "&$i&@CRLF&@CRLF&$Lines[$i]) Return EndSwitch Next GUICtrlSetData($Title, $NewTitle) GUICtrlSetData($Composer, $NewComp) For $x = 0 to 7 if $KeySigSharps[$x][0] = $NewMajKey then $Number = $x Next GuiCtrlSetData($KeySigNum,"2") GuiCtrlSetData($KeySigType,"Sharps") UpdateKeySig() GUICtrlSetOnEvent($UpDwn, "UpdatePitch") GUICtrlSetOnEvent($UpDwn2, "UpdatePitch") GUICtrlSetOnEvent($Pitch, "UpdatePitch") GUICtrlSetOnEvent($KeyNum, "UpdatePitch") _ArrayDisplay($NoteOctavePitch) EndFunc And this here is just a teaser example (I'll finish the song eventually) #cs Title: Still Alive Composer: Paulie Key Signature: D #ce Beep(391.995, 250);G4 - 47 Beep(369.994, 250);F#4 - 46 Beep(329.628, 250);E4 - 44 Beep(329.628, 250);E4 - 44 Beep(369.994, 250);F#4 - 46 Sleep(1000);Rest Sleep(500);Rest Sleep(250);Rest Beep(220.000, 250);A4 - 37 Beep(391.995, 250);G4 - 47 Beep(369.994, 250);F#4 - 46 Beep(329.628, 250);E4 - 44 Beep(329.628, 500);E4 - 44 Beep(369.994, 750);F#4 - 46 Beep(293.665, 500);D4 - 42 Beep(329.628, 250);E4 - 44 Beep(220.000, 250);A4 - 37 Beep(220.000, 1500);A4 - 37 Sleep(250);Rest Beep(220.000, 250);A4 - 37 Beep(329.628, 500);E4 - 44 Beep(369.994, 250);F#4 - 46 Beep(391.995, 500);G4 - 47 Beep(329.628, 250);E4 - 44 Beep(277.183, 500);C#4 - 41 Beep(293.665, 750);D4 - 42 Beep(329.628, 500);E4 - 44 Beep(220.000, 250);A4 - 37 Beep(220.000, 500);A4 - 37 Beep(369.994, 2000);F#4 - 46 Sleep(1000);Rest Beep(391.995, 250);G4 - 47 Beep(369.994, 250);F#4 - 46 Beep(329.628, 250);E4 - 44 Beep(329.628, 250);E4 - 44 Beep(369.994, 250);F#4 - 46 Sleep(1000);Rest Sleep(500);Rest Sleep(250);Rest Beep(220.000, 250);A4 - 37 Beep(391.995, 250);G4 - 47 Beep(369.994, 250);F#4 - 46 Beep(329.628, 250);E4 - 44 Beep(329.628, 500);E4 - 44 Beep(369.994, 750);F#4 - 46 Beep(293.665, 500);D4 - 42 Beep(329.628, 250);E4 - 44 Beep(220.000, 750);A4 - 37 Sleep(500);Rest Sleep(1000);Rest Beep(329.628, 500);E4 - 44 Beep(369.994, 250);F#4 - 46 Beep(391.995, 750);G4 - 47 Beep(329.628, 250);E4 - 44 Beep(277.183, 750);C#4 - 41 Beep(293.665, 250);D4 - 42 Beep(329.628, 500);E4 - 44 Beep(220.000, 250);A4 - 37 Beep(293.665, 250);D4 - 42 ;F Beep(329.628, 250);E4 - 44 Beep(349.228, 250);F4 - 45 Beep(329.628, 250);E4 - 44 Beep(293.665, 250);D4 - 42 Beep(261.626, 250);C4 - 40 Sleep(500);Rest Beep(220.000, 250);A4 - 37 Beep(233.082, 250);A#4 - 38 Beep(261.626, 500);C4 - 40 Beep(349.228, 500);F4 - 45 Beep(329.628, 250);E4 - 44 Beep(293.665, 250);D4 - 42 Beep(293.665, 250);D4 - 42 Beep(261.626, 250);C4 - 40 Beep(293.665, 250);D4 - 42 Beep(261.626, 250);C4 - 40 Beep(261.626, 500);C4 - 40 Beep(261.626, 500);C4 - 40 Beep(220.000, 250);A4 - 37 Beep(233.082, 250);A#4 - 38 Beep(261.626, 500);C4 - 40 Beep(349.228, 500);F4 - 45 Beep(391.995, 250);G4 - 47 Beep(349.228, 250);F4 - 45 Beep(329.628, 250);E4 - 44 Beep(293.665, 250);D4 - 42 Beep(293.665, 250);D4 - 42 Beep(329.628, 250);E4 - 44 Beep(349.228, 500);F4 - 45 Beep(349.228, 500);F4 - 45 Beep(391.995, 250);G4 - 47 Beep(440.000, 250);A5 - 49 Beep(466.164, 250);A#5 - 50 Beep(466.164, 250);A#5 - 50 Beep(440.000, 500);A5 - 49 Beep(391.995, 500);G4 - 47 Beep(349.228, 250);F4 - 45 Beep(391.995, 250);G4 - 47 Beep(440.000, 250);A5 - 49 Beep(440.000, 250);A5 - 49 Beep(391.995, 500);G4 - 47 Beep(349.228, 500);F4 - 45 Beep(293.665, 250);D4 - 42 Beep(261.626, 250);C4 - 40 Beep(293.665, 250);D4 - 42 Beep(349.228, 250);F4 - 45 Beep(349.228, 250);F4 - 45 Beep(329.628, 500);E4 - 44 Beep(329.628, 250);E4 - 44 Beep(369.994, 250);F#4 - 46 Beep(369.994, 1000);F#4 - 46 Enjoy!!
    1 point
×
×
  • Create New...