Skip to content
Browse files

Initial commit to GitHub

  • Loading branch information...
1 parent 6074d89 commit 16940519896c59db4561e60cc4b4bec70bd4ed3e @oatmealandcoffee committed May 31, 2012
Showing with 134 additions and 0 deletions.
  1. +1 −0 App.rbbas
  2. +1 −0 Build Automation.rbbas
  3. +1 −0 Commands/Command.rbbas
  4. +1 −0 Commands/CommandChordRecordObj.rbbas
  5. +1 −0 Commands/CommandGroupRecordObj.rbbas
  6. +1 −0 Commands/CommandMenuMakeChordObj.rbbas
  7. +1 −0 Commands/CommandMgrObj.rbbas
  8. +1 −0 Commands/CommandMouseCreateNoteObj.rbbas
  9. +1 −0 Commands/CommandMouseDeleteNoteObj.rbbas
  10. +1 −0 Commands/CommandNoteRecordObj.rbbas
  11. +1 −0 Commands/CommandObj.rbbas
  12. +1 −0 Commands/CommandRecordInterface.rbbas
  13. +1 −0 Commands/CommandRecordObj.rbbas
  14. +1 −0 Commands/Editing Commands/CommandButtonLockToggleObj.rbbas
  15. +1 −0 Commands/Editing Commands/CommandEditModifyVelocityObj.rbbas
  16. +1 −0 Commands/Editing Commands/CommandEditScaleLengthObj.rbbas
  17. +1 −0 Commands/Editing Commands/CommandEditSetLengthObj.rbbas
  18. +1 −0 Commands/Editing Commands/CommandEditSetVelocityObj.rbbas
  19. +1 −0 Commands/Editing Commands/CommandMouseMoveObj.rbbas
  20. +1 −0 Commands/Editing Commands/CommandMouseResizeMusicObj.rbbas
  21. +1 −0 Commands/Editing Commands/CommandMusicObjectStateObj.rbbas
  22. +1 −0 Commands/MakeChordRecordObj.rbbas
  23. +1 −0 Docs.rbbas
  24. +1 −0 FileTypes1.rbbas
  25. +1 −0 Interface Objects/GUI/GUIObj.rbbas
  26. +1 −0 Interface Objects/GUI/GroupOutlineObj.rbbas
  27. +1 −0 Interface Objects/Menu/EditorMenuItemObj.rbbas
  28. +1 −0 Interface Objects/Menu/MenuBar1.rbmnu
  29. +1 −0 Interface Objects/SplashCanvas.rbbas
  30. +1 −0 Interface Objects/Tracks/TrackListObj.rbbas
  31. +1 −0 Interface Objects/Tracks/TrackObj.rbbas
  32. +58 −0 LICENSE.txt
  33. BIN MIDIEditor3_v0_7_18b5.rbp
  34. BIN MIDIEditor3_v0_7_18b5.rbres
  35. +1 −0 MIDIEditor3_v0_7_18b5.rbvcp
  36. +1 −0 Managers/CopyMgr.rbbas
  37. +1 −0 Managers/DataLib.rbbas
  38. +1 −0 Managers/LogMgr.rbbas
  39. +1 −0 Managers/MIDILib.rbbas
  40. +1 −0 Managers/ManagerObj.rbbas
  41. +1 −0 Managers/ManagerObjs/EditMgrObj.rbbas
  42. +1 −0 Managers/ManagerObjs/FileMgr Helpers/FileLib.rbbas
  43. +1 −0 Managers/ManagerObjs/FileMgr Helpers/GroupImportObj.rbbas
  44. +1 −0 Managers/ManagerObjs/FileMgr Helpers/MIDIExportObj.rbbas
  45. +1 −0 Managers/ManagerObjs/FileMgr Helpers/MIDIExport_GarageBand_Obj.rbbas
  46. +1 −0 Managers/ManagerObjs/FileMgr Helpers/NativeExportObj.rbbas
  47. +1 −0 Managers/ManagerObjs/FileMgr Helpers/NativeImportObj.rbbas
  48. +1 −0 Managers/ManagerObjs/FileMgrObj.rbbas
  49. +1 −0 Managers/ManagerObjs/NoteMgrObj.rbbas
  50. +1 −0 Managers/ManagerObjs/PlayMgrObj.rbbas
  51. +1 −0 Managers/ManagerObjs/SongMgrObj.rbbas
  52. +1 −0 Managers/MusicLib.rbbas
  53. +1 −0 Managers/PlayThreadObj.rbbas
  54. +1 −0 Managers/TestSuiteObj.rbbas
  55. +1 −0 Managers/WindowMgr.rbbas
  56. +1 −0 Music Objects/ACS/ACSNoteObj.rbbas
  57. +1 −0 Music Objects/ACS/ACSObj.rbbas
  58. +1 −0 Music Objects/MusicObj.rbbas
  59. +1 −0 Music Objects/MusicObjs/ChordObj.rbbas
  60. +1 −0 Music Objects/MusicObjs/CursorObj.rbbas
  61. +1 −0 Music Objects/MusicObjs/CursorObjs/EditCursorObj.rbbas
  62. +1 −0 Music Objects/MusicObjs/CursorObjs/LoopStartCursorObj.rbbas
  63. +1 −0 Music Objects/MusicObjs/CursorObjs/LoopStopCursorObj.rbbas
  64. +1 −0 Music Objects/MusicObjs/CursorObjs/StartCursorObj.rbbas
  65. +1 −0 Music Objects/MusicObjs/CursorObjs/StopCursorObj.rbbas
  66. +1 −0 Music Objects/MusicObjs/GroupObj.rbbas
  67. +1 −0 Music Objects/MusicObjs/KeyObj.rbbas
  68. +1 −0 Music Objects/MusicObjs/NoteListInterface.rbbas
  69. +1 −0 Music Objects/MusicObjs/NoteObj.rbbas
  70. +1 −0 Music Objects/YNotePlayer/CoreAudioNotePlayer.rbbas
  71. +1 −0 Music Objects/YNotePlayer/NotePlayerInterface.rbbas
  72. +1 −0 Music Objects/YNotePlayer/YNotePlayerObj.rbbas
  73. +1 −0 Windows/ACS/WindowACSBasicSequence.rbfrm
  74. +1 −0 Windows/ACS/WindowACSProgress.rbfrm
  75. +1 −0 Windows/SplashWindow.rbfrm
  76. +1 −0 Windows/WindowChangeKey.rbfrm
  77. +1 −0 Windows/WindowEditNote.rbfrm
  78. +1 −0 Windows/WindowEditor.rbfrm
  79. +1 −0 Windows/WindowLog.rbfrm
Sorry, we could not display the entire diff because it was too big.
View
1 App.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Build Automation.rbbas
@@ -0,0 +1 @@
+#tag BuildAutomation
View
1 Commands/Command.rbbas
@@ -0,0 +1 @@
+#tag Interface
View
1 Commands/CommandChordRecordObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandGroupRecordObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandMenuMakeChordObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandMgrObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandMouseCreateNoteObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandMouseDeleteNoteObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandNoteRecordObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/CommandRecordInterface.rbbas
@@ -0,0 +1 @@
+#tag Interface
View
1 Commands/CommandRecordObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandButtonLockToggleObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandEditModifyVelocityObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandEditScaleLengthObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandEditSetLengthObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandEditSetVelocityObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandMouseMoveObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandMouseResizeMusicObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/Editing Commands/CommandMusicObjectStateObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Commands/MakeChordRecordObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Docs.rbbas
@@ -0,0 +1 @@
+#tag Module
View
1 FileTypes1.rbbas
@@ -0,0 +1 @@
+#tag FileTypeSet
View
1 Interface Objects/GUI/GUIObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Interface Objects/GUI/GroupOutlineObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Interface Objects/Menu/EditorMenuItemObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Interface Objects/Menu/MenuBar1.rbmnu
@@ -0,0 +1 @@
+#tag Menu
View
1 Interface Objects/SplashCanvas.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Interface Objects/Tracks/TrackListObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Interface Objects/Tracks/TrackObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
58 LICENSE.txt
@@ -0,0 +1,58 @@
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(g) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights described in Section 4(e).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(d), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(d), as requested.
+You may Distribute or Publicly Perform an Adaptation only under: (i) the terms of this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License"). You must include a copy of, or the URI, for Applicable License with every copy of each Adaptation You Distribute or Publicly Perform. You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License. You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in con-nection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(d) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
View
BIN MIDIEditor3_v0_7_18b5.rbp
Binary file not shown.
View
BIN MIDIEditor3_v0_7_18b5.rbres
Binary file not shown.
View
1 MIDIEditor3_v0_7_18b5.rbvcp
@@ -0,0 +1 @@
+Type=Desktop RBProjectVersion=2009.05 Class=App;App.rbbas;&h6D9DFA5E;&h0;false Module=Docs;Docs.rbbas;&h4AFA29E7;&h0;false Folder=Windows;Windows;&h70B45321;&h0;false Folder=ACS;Windows/ACS;&h684402B0;&h70B45321;false Window=WindowACSProgress;Windows/ACS/WindowACSProgress.rbfrm;&h7DD8B206;&h684402B0;false Window=WindowACSBasicSequence;Windows/ACS/WindowACSBasicSequence.rbfrm;&h3163355A;&h684402B0;false Folder=Music Objects;Music Objects;&h7F2F5B39;&h0;false Class=MusicObj;Music Objects/MusicObj.rbbas;&h677151F4;&h7F2F5B39;false Folder=MusicObjs;Music Objects/MusicObjs;&h4FBE80F;&h7F2F5B39;false Class=NoteObj;Music Objects/MusicObjs/NoteObj.rbbas;&h166B81D7;&h4FBE80F;false Class=ChordObj;Music Objects/MusicObjs/ChordObj.rbbas;&h6C199766;&h4FBE80F;false Class=GroupObj;Music Objects/MusicObjs/GroupObj.rbbas;&h6EA8F4F9;&h4FBE80F;false Class=KeyObj;Music Objects/MusicObjs/KeyObj.rbbas;&h4085E9DA;&h4FBE80F;false Folder=Interface Objects;Interface Objects;&h7E0E7E10;&h0;false Folder=GUI;Interface Objects/GUI;&h21D722C6;&h7E0E7E10;false Folder=Tracks;Interface Objects/Tracks;&h332C482B;&h7E0E7E10;false Folder=Menu;Interface Objects/Menu;&h20365AF2;&h7E0E7E10;false MenuBar=MenuBar1;Interface Objects/Menu/MenuBar1.rbmnu;&h46476F52;&h20365AF2;false Class=EditorMenuItemObj;Interface Objects/Menu/EditorMenuItemObj.rbbas;&h1FD04D23;&h20365AF2;false Class=TrackListObj;Interface Objects/Tracks/TrackListObj.rbbas;&h211928D7;&h332C482B;false Class=TrackObj;Interface Objects/Tracks/TrackObj.rbbas;&h6200DE03;&h332C482B;false Class=GUIObj;Interface Objects/GUI/GUIObj.rbbas;&h7BDDD62F;&h21D722C6;false Class=SplashCanvas;Interface Objects/SplashCanvas.rbbas;&h52056FD6;&h7E0E7E10;false Folder=Managers;Managers;&h6976CEBD;&h0;false Module=LogMgr;Managers/LogMgr.rbbas;&h617B20;&h6976CEBD;false FileTypeSet=FileTypes1;FileTypes1.rbbas;&h5B3DC656;&h0;false Module=MIDILib;Managers/MIDILib.rbbas;&h21DBF27;&h6976CEBD;false Class=ManagerObj;Managers/ManagerObj.rbbas;&h69FAF423;&h6976CEBD;false Folder=ManagerObjs;Managers/ManagerObjs;&h364074FD;&h6976CEBD;false Class=PlayThreadObj;Managers/PlayThreadObj.rbbas;&h2E494147;&h6976CEBD;false Class=TestSuiteObj;Managers/TestSuiteObj.rbbas;&h7F3B9EE8;&h6976CEBD;false Class=NoteMgrObj;Managers/ManagerObjs/NoteMgrObj.rbbas;&h719F8596;&h364074FD;false Class=SongMgrObj;Managers/ManagerObjs/SongMgrObj.rbbas;&h1FFBB6C7;&h364074FD;false Class=EditMgrObj;Managers/ManagerObjs/EditMgrObj.rbbas;&h469D14DE;&h364074FD;false Class=PlayMgrObj;Managers/ManagerObjs/PlayMgrObj.rbbas;&h72C560AF;&h364074FD;false Module=CopyMgr;Managers/CopyMgr.rbbas;&h6547A013;&h6976CEBD;false Module=MusicLib;Managers/MusicLib.rbbas;&h77B5CC82;&h6976CEBD;false Module=DataLib;Managers/DataLib.rbbas;&h1FA473E3;&h6976CEBD;false Module=WindowMgr;Managers/WindowMgr.rbbas;&h11465277;&h6976CEBD;false Window=SplashWindow;Windows/SplashWindow.rbfrm;&h5630E758;&h70B45321;false Window=WindowEditor;Windows/WindowEditor.rbfrm;&h1EA0AB31;&h70B45321;false Window=WindowMakeChord;Windows/WindowMakeChord.rbfrm;&h5F0734AA;&h70B45321;false Window=WindowChangeKey;Windows/WindowChangeKey.rbfrm;&h7AB9DEE5;&h70B45321;false Window=WindowEditNote;Windows/WindowEditNote.rbfrm;&h216B364E;&h70B45321;false Window=WindowLog;Windows/WindowLog.rbfrm;&h2D7F10B0;&h70B45321;false Window=WindowSaveConfirmation;Windows/WindowSaveConfirmation.rbfrm;&h2D0B4267;&h70B45321;false Class=GroupOutlineObj;Interface Objects/GUI/GroupOutlineObj.rbbas;&h4EBE16FB;&h21D722C6;false Class=FileMgrObj;Managers/ManagerObjs/FileMgrObj.rbbas;&h64F86DC4;&h364074FD;false Folder=FileMgr Helpers;Managers/ManagerObjs/FileMgr Helpers;&h1446C103;&h364074FD;false Class=NativeExportObj;Managers/ManagerObjs/FileMgr Helpers/NativeExportObj.rbbas;&h71EED44B;&h1446C103;false Class=NativeImportObj;Managers/ManagerObjs/FileMgr Helpers/NativeImportObj.rbbas;&h3129F801;&h1446C103;false Class=GroupImportObj;Managers/ManagerObjs/FileMgr Helpers/GroupImportObj.rbbas;&h4F0F9A1D;&h1446C103;false Class=MIDIExportObj;Managers/ManagerObjs/FileMgr Helpers/MIDIExportObj.rbbas;&h3B04EDFE;&h1446C103;false Class=MIDIExport_GarageBand_Obj;Managers/ManagerObjs/FileMgr Helpers/MIDIExport_GarageBand_Obj.rbbas;&h632F285F;&h1446C103;false Module=FileLib;Managers/ManagerObjs/FileMgr Helpers/FileLib.rbbas;&h691FC335;&h1446C103;false Interface=NoteListInterface;Music Objects/MusicObjs/NoteListInterface.rbbas;&h751A1DD0;&h4FBE80F;false Class=CursorObj;Music Objects/MusicObjs/CursorObj.rbbas;&h37D043AD;&h4FBE80F;false Folder=CursorObjs;Music Objects/MusicObjs/CursorObjs;&h35309527;&h4FBE80F;false Class=StartCursorObj;Music Objects/MusicObjs/CursorObjs/StartCursorObj.rbbas;&h4A0B7121;&h35309527;false Class=StopCursorObj;Music Objects/MusicObjs/CursorObjs/StopCursorObj.rbbas;&h890905F;&h35309527;false Class=EditCursorObj;Music Objects/MusicObjs/CursorObjs/EditCursorObj.rbbas;&h4AF69303;&h35309527;false Class=LoopStartCursorObj;Music Objects/MusicObjs/CursorObjs/LoopStartCursorObj.rbbas;&h22E120E;&h35309527;false Class=LoopStopCursorObj;Music Objects/MusicObjs/CursorObjs/LoopStopCursorObj.rbbas;&h1EA397E6;&h35309527;false Folder=YNotePlayer;Music Objects/YNotePlayer;&h12600D3F;&h7F2F5B39;false Class=YNotePlayerObj;Music Objects/YNotePlayer/YNotePlayerObj.rbbas;&h43657875;&h12600D3F;false Interface=NotePlayerInterface;Music Objects/YNotePlayer/NotePlayerInterface.rbbas;&h3AC7AD8A;&h12600D3F;false Class=CoreAudioNotePlayer;Music Objects/YNotePlayer/CoreAudioNotePlayer.rbbas;&hB529ED2;&h12600D3F;false Folder=ACS;Music Objects/ACS;&h2F2CAFE6;&h7F2F5B39;false Class=ACSObj;Music Objects/ACS/ACSObj.rbbas;&h602767A1;&h2F2CAFE6;false Class=ACSNoteObj;Music Objects/ACS/ACSNoteObj.rbbas;&h1ED07EE2;&h2F2CAFE6;false Folder=Commands;Commands;&h3A355DB9;&h0;false Class=CommandMgrObj;Commands/CommandMgrObj.rbbas;&h43691C3C;&h3A355DB9;false Interface=Command;Commands/Command.rbbas;&h29BD0B5D;&h3A355DB9;false Class=CommandObj;Commands/CommandObj.rbbas;&h59C7C30;&h3A355DB9;false Interface=CommandRecordInterface;Commands/CommandRecordInterface.rbbas;&h138A074D;&h3A355DB9;false Class=CommandRecordObj;Commands/CommandRecordObj.rbbas;&h67802275;&h3A355DB9;false Class=CommandNoteRecordObj;Commands/CommandNoteRecordObj.rbbas;&h4AE59BE6;&h3A355DB9;false Class=CommandChordRecordObj;Commands/CommandChordRecordObj.rbbas;&h285E811A;&h3A355DB9;false Class=CommandGroupRecordObj;Commands/CommandGroupRecordObj.rbbas;&h546E2850;&h3A355DB9;false Class=CommandMouseCreateNoteObj;Commands/CommandMouseCreateNoteObj.rbbas;&h1F19BF16;&h3A355DB9;false Class=CommandMouseDeleteNoteObj;Commands/CommandMouseDeleteNoteObj.rbbas;&h336E7E19;&h3A355DB9;false Folder=Editing Commands;Commands/Editing Commands;&h3F2EA66E;&h3A355DB9;false Class=CommandMenuMakeChordObj;Commands/CommandMenuMakeChordObj.rbbas;&h335107F4;&h3A355DB9;false Class=CommandMusicObjectStateObj;Commands/Editing Commands/CommandMusicObjectStateObj.rbbas;&h5FCFBBBC;&h3F2EA66E;false Class=CommandMouseMoveObj;Commands/Editing Commands/CommandMouseMoveObj.rbbas;&h47C26A93;&h3F2EA66E;false Class=CommandMouseResizeMusicObj;Commands/Editing Commands/CommandMouseResizeMusicObj.rbbas;&h615FE953;&h3F2EA66E;false Class=CommandEditSetVelocityObj;Commands/Editing Commands/CommandEditSetVelocityObj.rbbas;&hFB0E1D0;&h3F2EA66E;false Class=CommandEditModifyVelocityObj;Commands/Editing Commands/CommandEditModifyVelocityObj.rbbas;&h2F744EED;&h3F2EA66E;false Class=CommandEditSetLengthObj;Commands/Editing Commands/CommandEditSetLengthObj.rbbas;&h7CEA0397;&h3F2EA66E;false Class=CommandEditScaleLengthObj;Commands/Editing Commands/CommandEditScaleLengthObj.rbbas;&h67923038;&h3F2EA66E;false Class=CommandButtonLockToggleObj;Commands/Editing Commands/CommandButtonLockToggleObj.rbbas;&h5B510D75;&h3F2EA66E;false Class=MakeChordRecordObj;Commands/MakeChordRecordObj.rbbas;&h75FE437F;&h3A355DB9;false BuildSteps=Build Automation;Build Automation.rbbas;&h3D15F431;&h0;false DefaultWindow=WindowEditor AppMenuBar=MenuBar1 MajorVersion=0 MinorVersion=6 SubVersion=39 NonRelease=14 Release=0 InfoVersion= LongVersion=0.6.30b (0.6.30.10b) ShortVersion=0.6b WinCompanyName= WinInternalName= WinProductName= AutoIncrementVersionInformation=True BuildFlags=&h2000 BuildLanguage=&h0 DebugLanguage=&h0 Region= WindowsName=MusicSketch DEV MacCarbonMachName=MusicSketch DEV LinuxX86Name=MusicSketch DEV MacCreator= MDI=0 MDICaption= DefaultEncoding=&h0 AppIcon=MIDIEditor3_v0_7_18b5.rbres;&h0 OSXBundleID=com.OnC.MusicSketch DebuggerCommandLine= UseGDIPlus=False UseBuildsFolder=True
View
1 Managers/CopyMgr.rbbas
@@ -0,0 +1 @@
+#tag Module
View
1 Managers/DataLib.rbbas
@@ -0,0 +1 @@
+#tag Module
View
1 Managers/LogMgr.rbbas
@@ -0,0 +1 @@
+#tag Module
View
1 Managers/MIDILib.rbbas
@@ -0,0 +1 @@
+#tag Module
View
1 Managers/ManagerObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/EditMgrObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/FileMgr Helpers/FileLib.rbbas
@@ -0,0 +1 @@
+#tag Module
View
1 Managers/ManagerObjs/FileMgr Helpers/GroupImportObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/FileMgr Helpers/MIDIExportObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/FileMgr Helpers/MIDIExport_GarageBand_Obj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/FileMgr Helpers/NativeExportObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/FileMgr Helpers/NativeImportObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/FileMgrObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/NoteMgrObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/PlayMgrObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/ManagerObjs/SongMgrObj.rbbas
@@ -0,0 +1 @@
+#tag Class
View
1 Managers/MusicLib.rbbas
@@ -0,0 +1 @@
+#tag Module
View
1 Managers/PlayThreadObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class PlayThreadObj Inherits Thread #tag Event Sub Run() #if kLogEvents Log("PlayThreadObj.Run") #endif //we don't store the values locally because we want to eventually allow the user to change the cursors while the music is playing do //Loop check If ParentPlayMgr.LoopPlay then if ParentPlayMgr.Position >= ParentPlayMgr.LoopStopCursor.StartBeat then ParentPlayMgr.StopAllNotes ParentPlayMgr.Position = ParentPlayMgr.LoopStartCursor.StartBeat end if else if ParentPlayMgr.Position >= ParentPlayMgr.StopCursor.StartBeat then ParentPlayMgr.StopAllNotes ParentPlayMgr.Stop end if end if //stop check if ParentPlayMgr.StopFlag = true then ParentPlayMgr.StopAllNotes ParentPlayMgr.Stop end if StopNotes PlayNotes //increment the play position ParentPlayMgr.Position = ParentPlayMgr.Position + 1 //delay until next beat dim startTime as double = Microseconds //get the current time dim delayTime as double = (1000000 * 60) \ ParentPlayMgr.ParentWindow.SongMgr.Tempo \ ParentPlayMgr.ParentWindow.SongMgr.TimeSignatureBasicBeat dim currentTime as double do currentTime = Microseconds - startTime loop until delayTime <= currentTime loop End Sub #tag EndEvent #tag Method, Flags = &h21 Private Sub Log(theText as string) WindowLog.Log(theText) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub PlayNotes() dim thisNote as integer = 0 dim firstNote as integer = 0 dim lastNote as integer = Ubound(ParentPlayMgr.ParentWindow.NoteMgr.Notes) //this loop plays the notes for thisNote = firstNote to lastNote dim note as NoteObj = ParentPlayMgr.ParentWindow.NoteMgr.Notes(thisNote) if note.StartBeat = ParentPlayMgr.Position and note.Track.Visible = true and note.Track.Play = true then note.Track.YNotePlayer.Instrument = Note.Track.Instrument note.Track.YNotePlayer.playNote(note.Pitch, note.Velocity) end if next End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub StopNotes() dim thisNote as integer = 0 dim firstNote as integer = 0 dim lastNote as integer = Ubound(ParentPlayMgr.ParentWindow.NoteMgr.Notes) //this loop plays the notes for thisNote = firstNote to lastNote dim note as NoteObj = ParentPlayMgr.ParentWindow.NoteMgr.Notes(thisNote) if note.StartBeat + note.Length = ParentPlayMgr.Position and note.Track.Visible = true and note.Track.Play = true then note.Track.YNotePlayer.playNote(note.Pitch, 0) end if next End Sub #tag EndMethod #tag Property, Flags = &h0 ParentPlayMgr As PlayMgrObj #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InheritedFrom="Thread" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InheritedFrom="Thread" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Thread" #tag EndViewProperty #tag ViewProperty Name="Priority" Visible=true Group="Behavior" InitialValue="5" Type="Integer" InheritedFrom="Thread" #tag EndViewProperty #tag ViewProperty Name="StackSize" Visible=true Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="Thread" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Thread" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InheritedFrom="Thread" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Managers/TestSuiteObj.rbbas
1 addition, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 Managers/WindowMgr.rbbas
@@ -0,0 +1 @@
+#tag Module Protected Module WindowMgr #tag Method, Flags = &h1 Protected Function ApplicationQuit() As Boolean ApplicationQuitFlag = true dim allWindowsClosed as boolean = true //go through each window and run EditorClose dim thisEditor as integer = 0 dim firstEditor as integer = 0 dim lastEditor as integer = Ubound(Editors) for thisEditor = lastEditor DownTo firstEditor if Editors(thisEditor) <> nil then dim theEditor as WindowEditor = Editors(thisEditor) allWindowsClosed = EditorClose(theEditor) end if next return allWindowsClosed End Function #tag EndMethod #tag Method, Flags = &h21 Private Sub EditorAppend(Editor as WindowEditor) Editors.Append Editor End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Function EditorClose(Editor as WindowEditor) As Boolean if Editor.WindowNeedsSaving then //I would like to replace this with something else that allows for keyboard shortcuts. Dim MessageDialogWindow as New MessageDialog //declare the MessageDialog object Dim ButtonPressed as MessageDialogButton //for handling the result MessageDialogWindow.icon = MessageDialog.GraphicCaution //display warning icon MessageDialogWindow.ActionButton.Caption = "Save" MessageDialogWindow.CancelButton.Visible = True //show the Cancel button MessageDialogWindow.CancelButton.Cancel = true //map Esc and Cmd+. to the button. MessageDialogWindow.AlternateActionButton.Visible = True //show the "Don't Save" button MessageDialogWindow.AlternateActionButton.Caption ="Don't Save" MessageDialogWindow.Message = "Do you want to save the changes you made in the document " + Editor.Name + "?" MessageDialogWindow.Explanation = "Your changes will be lost of you don't save them." ButtonPressed = MessageDialogWindow.ShowModalWithin(Editor) //display the dialog Select Case ButtonPressed //determine which button was pressed. Case MessageDialogWindow.ActionButton //Save Editor.FileMgr.Save EditorCloseConfirmed(Editor) return true Case MessageDialogWindow.AlternateActionButton EditorCloseConfirmed(Editor) //Don't Save return true Case MessageDialogWindow.CancelButton return false End select else EditorCloseConfirmed(Editor) return true end if return false End Function #tag EndMethod #tag Method, Flags = &h1 Protected Sub EditorCloseConfirmed(Editor as WindowEditor) EditorRemove(Editor) dim i as integer dim EditorMenuItem as EditorMenuItemObj for i = (MenuBar1.Child("EditorMenu").Count - 1) DownTo 0 EditorMenuItem = EditorMenuItemObj(MenuBar1.Child("EditorMenu").Item(i)) //wrapping this command in EditorMenuItemObj avoids an IllegalCastException if EditorMenuItem.WindowFound(Editor) then MenuBar1.Child("EditorMenu").Remove( i ) exit end next Editor.Close End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Sub EditorNew() if Ubound(Editors) >= 9 then return Dim Editor As WindowEditor = new WindowEditor EditorAppend(Editor) EditorSetCurrent(Editor) Editor.Name = "Untitled " + Str(Ubound(Editors) + 1) Editor.Title = App.kAppName + " : " + Editor.Name dim EditorMenuItem as EditorMenuItemObj = new EditorMenuItemObj(Editor) EditorMenuItem.Text = Editor.Name EditorMenuItem.Tag = Editor MenuBar1.Child("EditorMenu").Append(EditorMenuItem) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub EditorRemove(Editor as WindowEditor) dim i as integer for i = Ubound(Editors) DownTo 0 if Editor = Editors(i) then Editors.Remove(i) exit end if next End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Sub EditorSetCurrent(Editor as WindowEditor) CurrentEditor = Editor End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Sub EditorShow(Editor as WindowEditor) //this is called from the Editor menu End Sub #tag EndMethod #tag Property, Flags = &h1 Protected ApplicationQuitFlag As Boolean = False #tag EndProperty #tag Property, Flags = &h1 Protected CurrentEditor As WindowEditor #tag EndProperty #tag Property, Flags = &h1 Protected Editors(-1) As WindowEditor #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag EndViewBehavior End Module #tag EndModule
View
1 Music Objects/ACS/ACSNoteObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class ACSNoteObj Inherits NoteObj #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="NoteObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="NoteObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/ACS/ACSObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class ACSObj #tag Method, Flags = &h0 Sub Constructor() if ACSRandom = nil then ACSRandom = new Random end if End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub CreateNoteLengthArray(LongestLength as NoteLength, ShortestLength as NoteLength, AllowTriplets as Boolean, AllowDotted as Boolean) Redim AllowedNoteLengths(-1) dim mLongestLength as integer = MIDILib.GetNoteLength(LongestLength) dim mShortestLength as integer = MIDILib.GetNoteLength(ShortestLength) dim NoteLengthValue_01 as integer = MIDILib.GetNoteLength(NoteLength.Value_01) dim NoteLengthValue_02 as integer = MIDILib.GetNoteLength(NoteLength.Value_02) dim NoteLengthValue_04 as integer = MIDILib.GetNoteLength(NoteLength.Value_04) dim NoteLengthValue_08 as integer = MIDILib.GetNoteLength(NoteLength.Value_08) dim NoteLengthValue_16 as integer = MIDILib.GetNoteLength(NoteLength.Value_16) dim NoteLengthValue_32 as integer = MIDILib.GetNoteLength(NoteLength.Value_32) dim NoteLengthValue_64 as integer = MIDILib.GetNoteLength(NoteLength.Value_64) dim NoteLengthvalue_01_triplet as integer = MIDILib.GetNoteLength(NoteLength.value_01_triplet) dim NoteLengthvalue_02_triplet as integer = MIDILib.GetNoteLength(NoteLength.value_02_triplet) dim NoteLengthvalue_04_triplet as integer = MIDILib.GetNoteLength(NoteLength.value_04_triplet) dim NoteLengthvalue_08_triplet as integer = MIDILib.GetNoteLength(NoteLength.value_08_triplet) dim NoteLengthvalue_16_triplet as integer = MIDILib.GetNoteLength(NoteLength.value_16_triplet) dim NoteLengthvalue_32_triplet as integer = MIDILib.GetNoteLength(NoteLength.value_32_triplet) dim NoteLengthvalue_64_triplet as integer = MIDILib.GetNoteLength(NoteLength.value_64_triplet) dim NoteLengthvalue_02_dotted as integer = MIDILib.GetNoteLength(NoteLength.value_02_dotted) dim NoteLengthvalue_04_dotted as integer = MIDILib.GetNoteLength(NoteLength.value_04_dotted) dim NoteLengthvalue_08_dotted as integer = MIDILib.GetNoteLength(NoteLength.value_08_dotted) dim NoteLengthvalue_16_dotted as integer = MIDILib.GetNoteLength(NoteLength.value_16_dotted) dim NoteLengthvalue_32_dotted as integer = MIDILib.GetNoteLength(NoteLength.value_32_dotted) dim NoteLengthvalue_64_dotted as integer = MIDILib.GetNoteLength(NoteLength.value_64_dotted) if NoteLengthValue_01 <= mLongestLength and NoteLengthValue_01 >= mShortestLength then AllowedNoteLengths.Append(NoteLengthValue_01) if AllowTriplets then AllowedNoteLengths.Append(NoteLengthvalue_01_triplet) if NoteLengthValue_02 <= mLongestLength and NoteLengthValue_02 >= mShortestLength then AllowedNoteLengths.Append(NoteLengthValue_02) if AllowTriplets then AllowedNoteLengths.Append(NoteLengthvalue_02_triplet) if AllowDotted then AllowedNoteLengths.Append(NoteLengthvalue_02_dotted) if NoteLengthValue_04 <= mLongestLength and NoteLengthValue_04 >= mShortestLength then AllowedNoteLengths.Append(NoteLengthValue_04) if AllowTriplets then AllowedNoteLengths.Append(NoteLengthValue_04_triplet) if AllowDotted then AllowedNoteLengths.Append(NoteLengthValue_04_dotted) if NoteLengthValue_08 <= mLongestLength and NoteLengthValue_08 >= mShortestLength then AllowedNoteLengths.Append(NoteLengthValue_08) if AllowTriplets then AllowedNoteLengths.Append(NoteLengthValue_08_triplet) if AllowDotted then AllowedNoteLengths.Append(NoteLengthValue_08_dotted) if NoteLengthValue_16 <= mLongestLength and NoteLengthValue_16 >= mShortestLength then AllowedNoteLengths.Append(NoteLengthValue_16) if AllowTriplets then AllowedNoteLengths.Append(NoteLengthValue_16_triplet) if AllowDotted then AllowedNoteLengths.Append(NoteLengthValue_16_dotted) if NoteLengthValue_32 <= mLongestLength and NoteLengthValue_32 >= mShortestLength then AllowedNoteLengths.Append(NoteLengthValue_32) if AllowTriplets then AllowedNoteLengths.Append(NoteLengthValue_32_triplet) if AllowDotted then AllowedNoteLengths.Append(NoteLengthValue_32_dotted) if NoteLengthValue_64 <= mLongestLength and NoteLengthValue_64 >= mShortestLength then AllowedNoteLengths.Append(NoteLengthValue_64) if AllowTriplets then AllowedNoteLengths.Append(NoteLengthValue_64_triplet) if AllowDotted then AllowedNoteLengths.Append(NoteLengthValue_64_dotted) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub CreateRandomMelody(CharacteristicsWeight as integer, LengthVarianceLongest as NoteLength, LengthVarianceShortest as NoteLength, MelodyLengthNotes as integer, LengthAllowTriplets as boolean, LengthAllowDotted as boolean, MelodyLengthMeasures as integer, MelodyLengthUseNotes as Boolean, PitchVarianceMaxHi as integer, PitchVarianceMaxLo as integer, PitchVarianceHighestOctave as Octave, PitchVarianceLowestOctave as Octave) //calculate the number of notes or measures we're going to create //To Do: //Pitches need to be coming from the ParentWindow.SongMgr.Keys(0).Pitches array //handle when the first pitch isn't in the array //- get the closest note (up or down, doesn't matter) and handle from there. //handle when the first pitch is outside of the octave limits //- change the octave controls to encompass the first pitch upon opening //Move note Length Array out of loop //initialize note count dim thisNote as integer = 1 dim firstNote as integer = 0 dim lastNote as integer = 0 dim totalBeats as integer = 0 if MelodyLengthUseNotes then lastNote = MelodyLengthNotes else dim measureUnit as integer = ParentWindow.SongMgr.TimeSignatureBeatsPerMeasure * ParentWindow.SongMgr.TimeSignatureBasicBeat totalBeats = measureUnit * MelodyLengthMeasures end if //initialize the AllowedNoteLengths CreateNoteLengthArray(LengthVarianceLongest, LengthVarianceShortest, LengthAllowTriplets, LengthAllowDotted) //initialize all counts for tracking dim totalBeatCount as integer = 0 dim stopFlag as Boolean = false dim lastNoteStartBeat as integer = 0 dim currentStartBeat as integer = lastNoteStartBeat dim lastNotePitch as integer = 0 //needs to be zero proper math on the first loop iteration //check to see if a selection has been made if Ubound(ParentWindow.NoteMgr.Selection) > -1 then end if dim statusBarMaximum as integer = 0 if MelodyLengthUseNotes then statusBarMaximum = lastNote else statusBarMaximum = totalBeats end if dim StatusWindow as WindowACSProgress = DisplayStatusBarWindow(statusBarMaximum) do dim noteStartBeat as integer = currentStartBeat + ParentWindow.PlayMgr.EditCursor.StartBeat dim notePitch as integer = 60 dim noteLength as integer = 0 dim changeAmount as integer = 0 dim UpDownWeight as integer = ACSRandom.InRange(kRandomMelody_WeightMin, kRandomMelody_WeightMax) if UpDownWeight < CharacteristicsWeight then changeAmount = ACSRandom.InRange(0, PitchVarianceMaxLo) else changeAmount = ACSRandom.InRange(0, PitchVarianceMaxHi) end if notePitch = lastNotePitch + changeAmount //parse the pitch into the octaves dim highestPitch as integer = MusicLib.GetOctaveHighNote(PitchVarianceHighestOctave) notePitch = Min(notePitch, highestPitch) dim lowestPitch as integer = MusicLib.GetOctaveLowNote(PitchVarianceLowestOctave) notePitch = Max(notePitch, lowestPitch) //create length noteLength = CreateRandomNoteLength(LengthVarianceLongest, LengthVarianceShortest, LengthAllowTriplets, LengthAllowDotted) totalBeatCount = currentStartBeat + noteLength //create new note dim newNote as NoteObj = ParentWindow.NoteMgr.CreateNote(noteStartBeat, notePitch, noteLength) //add to track ParentWindow.TrackListObj1.CurrentTrack.AddObject(newNote) //check this iteration to see if we've hit the user's settings if MelodyLengthUseNotes then if thisNote = lastNote then stopFlag = true end if else if totalBeatCount >= totalBeats then stopFlag = true end if end if //set up for the next iteration lastNotePitch = notePitch currentStartBeat = currentStartBeat + noteLength thisNote = thisNote + 1 if MelodyLengthUseNotes then StatusWindow.IncrementProgressBar(1) else StatusWindow.IncrementProgressBar(noteLength) end if loop until stopFlag = true StatusWindow.Hide WindowACSBasicSequence.Hide End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function CreateRandomNoteLength() As Integer dim firstNoteLength as integer = 2 dim lastNoteLength as integer = 4 dim newNoteLength as integer = MIDILib.kNoteLength_08 dim noteLengthSelector as integer = ACSRandom.InRange(firstNoteLength, lastNoteLength) select case noteLengthSelector case 0 newNoteLength = MIDILib.kNoteLength_01 case 1 newNoteLength = MIDILib.kNoteLength_02 case 2 newNoteLength = MIDILib.kNoteLength_04 case 3 newNoteLength = MIDILib.kNoteLength_08 case 4 newNoteLength = MIDILib.kNoteLength_16 case 5 newNoteLength = MIDILib.kNoteLength_32 case 6 newNoteLength = MIDILib.kNoteLength_64 end select return newNoteLength End Function #tag EndMethod #tag Method, Flags = &h21 Private Function CreateRandomNoteLength(LongestLength as NoteLength, ShortestLength as NoteLength, AllowTriplets as Boolean, AllowDotted as Boolean) As Integer //method 1 //the note length is a random number between the length limits in beats. //the note length is then parsed to the closest NoteLength.value_xx_y //a modifier is assigned randomly. If both modifiers are selected, randomly select one, and then randomly assign it. 'dim longestLengthInBeats as integer = MIDILib.GetNoteLength(LongestLength) 'dim shortestLengthInBeats as integer = MIDILib.GetNoteLength(ShortestLength) //method2 //the note length is a random number assigned to each of the NoteLength.value_xx_y //Allowed NoteLength values are assigned to an array //the array is sorted //the array is shuffled //the first value in the array is selected if Ubound(AllowedNoteLengths) = -1 then return MIDILib.kNoteLength_08 AllowedNoteLengths.Shuffle Return AllowedNoteLengths(0) End Function #tag EndMethod #tag Method, Flags = &h21 Private Function CreateRandomNotePitch(PreviousPitch as integer) As Integer dim pitchIndex as integer = ParentWindow.SongMgr.Keys(0).GetPitchIndex(PreviousPitch) dim varianceUp as integer = 4 dim varianceDown as integer = -4 dim pitchVariance as integer = ACSRandom.InRange(varianceDown, varianceUp) dim newPitchIndex as integer = pitchIndex + pitchVariance if newPitchIndex > Ubound(ParentWindow.SongMgr.Keys(0).Pitches) or newPitchIndex < 0 then newPitchIndex = pitchIndex end if return ParentWindow.SongMgr.Keys(0).Pitches(newPitchIndex) End Function #tag EndMethod #tag Method, Flags = &h0 Sub CreateSequencerSound() //see notes on this one to dim thisRound as integer = 1 dim firstRound as integer = 1 dim lastRound as integer = 50 dim mStatusWindow as WindowACSProgress = DisplayStatusBarWindow(lastRound + 2) for thisRound = firstRound to lastRound MakeBasicRandomMelody mStatusWindow.IncrementProgressBar(1) next ParentWindow.NoteMgr.SelectAll mStatusWindow.IncrementProgressBar(1) ParentWindow.EditMgr.SetLength(MIDILib.kNoteLength_64) mStatusWindow.IncrementProgressBar(1) UpdateParentWindow mStatusWindow.Close End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function DisplayStatusBarWindow(MaxValue as integer) As WindowACSProgress StatusWindow = new WindowACSProgress StatusWindow.Show StatusWindow.ProgressBar1.Maximum = MaxValue return StatusWindow End Function #tag EndMethod #tag Method, Flags = &h21 Private Function GetStartNotePitch() As Integer dim middlePitchIndex as integer = ParentWindow.SongMgr.Keys(0).Pitches(UBound(ParentWindow.SongMgr.Keys(0).Pitches) \ 2) dim pitchIndexArray(-1) as integer dim thisHigherPitchIndex as integer = 0 dim firstHigherPitchIndex as integer = middlePitchIndex + 1 dim lastHigherPitchIndex as integer = middlePitchIndex + 5 for thisHigherPitchIndex = firstHigherPitchIndex to lastHigherPitchIndex dim theHigherPitchIndex as integer = middlePitchIndex + thisHigherPitchIndex if theHigherPitchIndex > 0 and theHigherPitchIndex < UBound(ParentWindow.SongMgr.Keys(0).Pitches) then pitchIndexArray.Append(theHigherPitchIndex) end if next dim thisLowerPitchIndex as integer = 0 dim firstLowerPitchIndex as integer = middlePitchIndex + 1 dim lastLowerPitchIndex as integer = middlePitchIndex + 5 for thisLowerPitchIndex = firstLowerPitchIndex to lastLowerPitchIndex dim theLowerPitchIndex as integer = middlePitchIndex + thisLowerPitchIndex if theLowerPitchIndex > 0 and theLowerPitchIndex < UBound(ParentWindow.SongMgr.Keys(0).Pitches) then pitchIndexArray.Append(theLowerPitchIndex) end if next dim newPitchIndex as integer = ParentWindow.SongMgr.Keys(0).Pitches(UBound(ParentWindow.SongMgr.Keys(0).Pitches) \ 2) if UBound(pitchIndexArray) <> -1 then pitchIndexArray.Sort dim highPitchIndex as integer = pitchIndexArray(0) dim lowPitchIndex as integer = pitchIndexArray(Ubound(pitchIndexArray)) newPitchIndex = ACSRandom.InRange(highPitchIndex, lowPitchIndex) end if return newPitchIndex End Function #tag EndMethod #tag Method, Flags = &h0 Sub MakeBasicRandomMelody() //get a starter note in the key's pitches dim lastNoteStartBeat as integer = 0 dim lastNotePitch as integer = GetStartNotePitch dim lastNoteLength as integer = MIDILib.kNoteLength_08 dim currentStartBeat as integer = lastNoteStartBeat dim thisNote as integer = 1 dim firstNote as integer = 2 dim lastNote as integer = 16 'dim mStatusWindow as WindowACSProgress = DisplayStatusBarWindow(lastNote) for thisNote = firstNote to lastNote dim noteBeat as integer = currentStartBeat dim notePitch as integer = CreateRandomNotePitch(lastNotePitch) dim noteLength as integer = CreateRandomNoteLength dim theNote as NoteObj = ParentWindow.NoteMgr.CreateNote(noteBeat, notePitch, noteLength) ParentWindow.TrackListObj1.CurrentTrack.AddObject(theNote) currentStartBeat = noteBeat + noteLength 'mStatusWindow.IncrementProgressBar(1) next UpdateParentWindow 'mStatusWindow.IncrementProgressBar(1) 'mStatusWindow.Close End Sub #tag EndMethod #tag Method, Flags = &h0 Sub UpdateParentWindow() ParentWindow.PlayMgr.SetStopCursorToEnd ParentWindow.WindowNeedsSaving = true ParentWindow.ResizeBars ParentWindow.GUIObj1.Draw End Sub #tag EndMethod #tag Note, Name = Create Sequencer Sound Create multiple rounds of note objects starting at predetermined SnapTos (1/4 - 1/16) Select all notes created Set all to 1/32 - 1/64 lengths On each start beat, sort out which pitch has the highest number of notes. Place a pre-determined intervaled note (say every 1/8 or 1/6) where that max count is. On each start beat, based on the number of notes for each pitch, remove the excess pitches and leave only one decrease the velocity based on the number of pitches. Based on a single note create multiple rounds of note object starting at predetermined SnapTos (1/4-1/16) but all on same pitch, granularity will have to change based on frequency Options [ ] Depth [ ] Number of measures from Note. [ ] Sequence Frequency (1/64, 1/32, 1/16) [ ] Velocity variation Based on a chord or multiple notes create multiple rounds of note object starting at predetermined SnapTos (1/4-1/16), granularity will have to change based on frequency Pitch variance based on random selection of pitches in selection Options [ ] Depth [ ] Number of measures from EditCursor [ ] sequence frequency (1/64, 1/32, 1/16) [ ] Velocity Variation Good Sequencer Sounds 18 Percussive Organ 87 Fifths Lead 88 Bass + Lead 13 Marimbas #tag EndNote #tag Note, Name = How this works The ACS controls exist in the bottom of the window. Sequences are generated or altered using a keyboard or button command. (CMD+R) #tag EndNote #tag Note, Name = New Sequence Generation Get Settings NoteMgr MusicLib Make Master Sequence (MasterSequenceObj) Check Up-Down Melody Check Large Jumps Check endless loop Make Phrases (array of PhraseObj) Check Tritones Check Large Jumps Check endless loop Combine Phrases (recursive?) Output to NoteMgr (link notes together) (Array of notes in OutputObj) Refresh #tag EndNote #tag Note, Name = Object Hierarchy ACSObj * Contains all of the parameter information used to generate the Master sequence and phrases. \MasterSequenceObj \PhraseObj \OutputObj #tag EndNote #tag Note, Name = Options for Basic Note Sequence Generation [ ] Pure Random [ ] Pitch [ ] Start Pitch [ ] If there is one selected, use that [ ] If there isn't one selected [ ] Highest octave [ ] Lowest octave [ ] Variance Up [ ] For both up and down, this could be based on basic melody theory (like no more than three, avoid 6's, and the like) [ ] Variance Down [ ] Highest Octave [ ] Lowest Octave [ ] Length [ ] Min Note Length [ ] Max Note Length [ ] Sequence [ ] Max Length [ ] Sequencer Notes [ ] Include Pure Random Options [ ] Depth (Number of rounds of Pure Random) (50 is a good balance between depth and speed) [ ] Sequencer Interval (typically 1/8 - 1/16) [ ] Sequencer Step Length (typically 1/32 - 1/64) [ ] Optional Sequencer Melody [ ] Note Intervals [ ] Pitch [ ] Based on Highest/Lowest Velocities [ ] Length [ ] Based on Highest/Lowest Velocites [ ] Optional Object Management [ ] Put Sequencer Notes into a GroupObj [ ] Put Sequecner Notes into a RepeaterObj (v2) #tag EndNote #tag Note, Name = Parameters Pitches Base On Mode (v2) Scale Pitch Randomly generated Pre-selected Octave Range +n to -n or by Octave Numbers Recommend Chords Chord Progesssions Values Note value range Whole to 1/64 Rest Value Range Whole to 1/64 % of rests at beginning, end, or random locations Based on rhythm (v2) Shuffle Swing Bass based on rock beats Notes Number of pitches Number of measures 4 / 8 / 16 / 12 (blues) Characteristics Upward Downward Allow large jumps? (3+ half steps) Allow Tritones Allow accidentals If it is in a pre-existing sequence, do we want to add or delete notes? #tag EndNote #tag Note, Name = Preexisting Sequence Alteration MasterSequenceObj is held in ACS for reference later NoteObj links to MasterSequenceObj Note MUST be selected and in a sequence Get Master Sequence Analyze Notes/Sequence Refactor Sequence based on new parameters. #tag EndNote #tag Note, Name = Scratch Text NoteLength.Value_01 NoteLength.Value_02 NoteLength.Value_04 NoteLength.Value_08 NoteLength.Value_16 NoteLength.Value_32 NoteLength.Value_64 NoteLength.value_01_triplet NoteLength.value_02_triplet NoteLength.value_04_triplet NoteLength.value_08_triplet NoteLength.value_16_triplet NoteLength.value_32_triplet NoteLength.value_64_triplet NoteLength.value_02_dotted NoteLength.value_04_dotted NoteLength.value_08_dotted NoteLength.value_16_dotted NoteLength.value_32_dotted NoteLength.value_64_dotted #tag EndNote #tag Property, Flags = &h0 ACSRandom As Random #tag EndProperty #tag Property, Flags = &h21 Private AllowedNoteLengths(-1) As Integer #tag EndProperty #tag Property, Flags = &h0 ParentWindow As WindowEditor #tag EndProperty #tag Property, Flags = &h0 StatusWindow As WindowACSProgress #tag EndProperty #tag Constant, Name = kRandomMelody_MaxMeasures, Type = Double, Dynamic = False, Default = \"100", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_MaxNotes, Type = Double, Dynamic = False, Default = \"1000", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_MinLength, Type = Double, Dynamic = False, Default = \"1", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_PitchVarianceMaxHi, Type = Double, Dynamic = False, Default = \"12", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_PitchVarianceMaxLo, Type = Double, Dynamic = False, Default = \"-12", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_PitchVarianceMinHi, Type = Double, Dynamic = False, Default = \"1", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_PitchVarianceMinLo, Type = Double, Dynamic = False, Default = \"-1", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_WeightMax, Type = Double, Dynamic = False, Default = \"50", Scope = Public #tag EndConstant #tag Constant, Name = kRandomMelody_WeightMin, Type = Double, Dynamic = False, Default = \"-50", Scope = Public #tag EndConstant #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class MusicObj #tag Method, Flags = &h0 Sub Constructor() MusicObjCount = ObjectCount Description = Str(MusicObjCount) End Sub #tag EndMethod #tag Method, Flags = &h0 Function IsAltered() As Boolean if CommandBufferLength <> OldLength then return true if CommandBufferPitch <> OldPitch then return true if CommandBufferStartBeat <> StartBeat then return true return false End Function #tag EndMethod #tag Method, Flags = &h0 Sub SetOldData() //called from NoteMgr.EditNote to ensure dragged items stay in formation //called from NoteMgr.AddSelectionFromNote to get the initial values in case we go straight to drag. CommandBufferLength = Length CommandBufferPitch = Pitch CommandBufferStartBeat = StartBeat OldStartBeat = StartBeat OldPitch = Pitch OldLength = Length End Sub #tag EndMethod #tag Property, Flags = &h21 Private CommandBufferLength As Integer #tag EndProperty #tag Property, Flags = &h21 Private CommandBufferPitch As Integer #tag EndProperty #tag Property, Flags = &h21 Private CommandBufferStartBeat As Integer #tag EndProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get if Selected then return mDescription + "*" return mDescription End Get #tag EndGetter #tag Setter Set mDescription = value End Set #tag EndSetter Description As String #tag EndComputedProperty #tag Property, Flags = &h0 Group As GroupObj #tag EndProperty #tag Property, Flags = &h0 Hidden As Integer #tag EndProperty #tag Property, Flags = &h0 #tag Note ID is at file saving. It is simply an object's index in its respective array. #tag EndNote ID As String #tag EndProperty #tag Property, Flags = &h0 #tag Note label is what it shown in the help popups #tag EndNote Label As String #tag EndProperty #tag Property, Flags = &h0 Length As Integer #tag EndProperty #tag Property, Flags = &h0 Locked As Boolean #tag EndProperty #tag Property, Flags = &h21 #tag Note This the unique ID for trouble shooting #tag EndNote Private mDescription As String #tag EndProperty #tag Property, Flags = &h21 Private MusicObjCount As Integer #tag EndProperty #tag Property, Flags = &h0 Name As String #tag EndProperty #tag Property, Flags = &h0 #tag Note [ ] This is a note array that tracks only the notes and not grouping objects like ChordObj and GroupObj. [ ] The NoteList is managed in the object creation methods for both ChordObjs and GroupObjs. [ ] The purpose of the NoteList is to buffer all of the notes within a MusicObj for drag selection purposes. [ ] Edits should not use this list and instead go down the object hierarchy. [ ] This maintains the consistency of the methods for object management (e.g. group/ungroup) and edits. #tag EndNote NoteList(-1) As NoteObj #tag EndProperty #tag ComputedProperty, Flags = &h21 #tag Getter Get if ParentWindow <> nil then return ParentWindow.NoteMgr end if End Get #tag EndGetter Private NoteMgr As NoteMgrObj #tag EndComputedProperty #tag Property, Flags = &h0 OldLength As Integer #tag EndProperty #tag Property, Flags = &h0 OldPitch As Integer #tag EndProperty #tag Property, Flags = &h0 OldStartBeat As Integer #tag EndProperty #tag ComputedProperty, Flags = &h21 #tag Getter Get if Track <> nil then return Track.TrackList.ParentWindow end if End Get #tag EndGetter Private ParentWindow As WindowEditor #tag EndComputedProperty #tag Property, Flags = &h0 Pitch As Integer #tag EndProperty #tag Property, Flags = &h0 Selected As Boolean = False #tag EndProperty #tag Property, Flags = &h0 StartBeat As Integer #tag EndProperty #tag Property, Flags = &h0 Track As TrackObj #tag EndProperty #tag Property, Flags = &h0 Velocity As Integer = 60 #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/ChordObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class ChordObj Inherits MusicObj Implements NoteListInterface #tag Method, Flags = &h21 Private Sub AddExtensions() //called from CalculatePitches //Add on the extensions if DataLib.GetFlag(DataLib.kFlagChordExtension_Sixth_Major, Settings) then StepValuesString.Append MusicLib.kChordExtension_Sixth_Major if DataLib.GetFlag(DataLib.kFlagChordExtension_Sixth_Minor, Settings) then StepValuesString.Append MusicLib.kChordExtension_Sixth_Minor if DataLib.GetFlag(DataLib.kFlagChordExtension_Seventh_Major, Settings) then StepValuesString.Append MusicLib.kChordExtension_Seventh_Major if DataLib.GetFlag(DataLib.kFlagChordExtension_Seventh_Minor, Settings) then StepValuesString.Append MusicLib.kChordExtension_Seventh_Minor if DataLib.GetFlag(DataLib.kFlagChordExtension_Ninth_Major, Settings) then StepValuesString.Append MusicLib.kChordExtension_Ninth_Major if DataLib.GetFlag(DataLib.kFlagChordExtension_Ninth_Minor, Settings) then StepValuesString.Append MusicLib.kChordExtension_Ninth_Minor if DataLib.GetFlag(DataLib.kFlagChordExtension_Eleventh_Major, Settings) then StepValuesString.Append MusicLib.kChordExtension_Eleventh_Major if DataLib.GetFlag(DataLib.kFlagChordExtension_Eleventh_Minor, Settings) then StepValuesString.Append MusicLib.kChordExtension_Eleventh_Minor End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub AddNote(StepValue as integer, pitchModifier as integer) //now that we've sorted next pitch, get the rest of the values and make the note. dim NotePitchIndex as integer dim NotePitch, NoteLength, NoteStartBeat as integer dim Note as NoteObj NotePitchIndex = RootIndex + StepValue NotePitch = Track.TrackList.ParentWindow.SongMgr.Keys(0).Pitches(NotePitchIndex) NotePitch = NotePitch + pitchModifier NoteLength = me.Length NoteStartBeat = me.StartBeat #if kLogMethods 'NoteStartBeat = NoteStartBeat + (MIDILib.kNoteLength_16 * i) //arpeggiate for testing. #endif Note = Track.TrackList.ParentWindow.NoteMgr.CreateNote(NoteStartBeat, NotePitch, NoteLength) Note.Track = me.Track //grab that last note made, and link everything together. Note.Chord = me me.Notes.Append Note me.Notes(Ubound(me.Notes)).Chord = me End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub ApplyModifiers() //called from CalculatePitches //Do the modifiers //If the chord is suspended, change the 3 in the array into a 4 if DataLib.GetFlag(DataLib.kFlagChordModifier_Suspended, Settings) then StepValuesString(1) = "4" //If the chord is a power chord, remove the 3 from the array if DataLib.GetFlag(DataLib.kFlagChordModifier_Power, Settings) then StepValuesString.Remove(1) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ApplyRootSettingsToChord(Note as NoteObj) //this is called from EditMgr.MakeChord Root = Note //now that's set, we pull all of the information from the root to ensure we're grabbing the right info. Group = Root.Group Notes.Append Root Root.Chord = me Root.Selected = false Hidden = Root.Hidden Length = Root.Length Locked = Root.Locked OldLength = Root.OldLength OldStartBeat = Root.OldStartBeat Selected = Root.Selected StartBeat = Root.StartBeat Track = Root.Track Velocity = Root.Velocity End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Arpeggiate() //let's if we're arpeggiateing first of all if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_LowToHigh, Settings) OR DataLib.GetFlag(DataLib.kFlagChordArpeggiate_HighToLow, Settings) then //let's sort out by how much dim ArpeggioLengthMask as integer = 0 if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_Length_01, settings) then ArpeggioLengthMask = ArpeggioLengthMask + DataLib.kFlagChordArpeggiate_Length_01 if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_Length_02, settings) then ArpeggioLengthMask = ArpeggioLengthMask + DataLib.kFlagChordArpeggiate_Length_02 if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_Length_04, settings) then ArpeggioLengthMask = ArpeggioLengthMask + DataLib.kFlagChordArpeggiate_Length_04 if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_Length_08, settings) then ArpeggioLengthMask = ArpeggioLengthMask + DataLib.kFlagChordArpeggiate_Length_08 if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_Length_16, settings) then ArpeggioLengthMask = ArpeggioLengthMask + DataLib.kFlagChordArpeggiate_Length_16 if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_Length_32, settings) then ArpeggioLengthMask = ArpeggioLengthMask + DataLib.kFlagChordArpeggiate_Length_32 if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_Length_64, settings) then ArpeggioLengthMask = ArpeggioLengthMask + DataLib.kFlagChordArpeggiate_Length_64 dim ArpeggioLengthBeats as integer = 0 Select Case ArpeggioLengthMask Case DataLib.kFlagChordArpeggiate_Length_01 ArpeggioLengthBeats = MIDILib.kNoteLength_01 Case DataLib.kFlagChordArpeggiate_Length_02 ArpeggioLengthBeats = MIDILib.kNoteLength_02 Case DataLib.kFlagChordArpeggiate_Length_02 + DataLib.kFlagChordArpeggiate_Length_04 ArpeggioLengthBeats = MIDILib.kNoteLength_02 + MIDILib.kNoteLength_04 Case DataLib.kFlagChordArpeggiate_Length_04 ArpeggioLengthBeats = MIDILib.kNoteLength_04 Case DataLib.kFlagChordArpeggiate_Length_04 + DataLib.kFlagChordArpeggiate_Length_08 ArpeggioLengthBeats = MIDILib.kNoteLength_04 + MIDILib.kNoteLength_08 Case DataLib.kFlagChordArpeggiate_Length_08 ArpeggioLengthBeats = MIDILib.kNoteLength_08 Case DataLib.kFlagChordArpeggiate_Length_08 + DataLib.kFlagChordArpeggiate_Length_16 ArpeggioLengthBeats = MIDILib.kNoteLength_08 + MIDILib.kNoteLength_16 Case DataLib.kFlagChordArpeggiate_Length_16 ArpeggioLengthBeats = MIDILib.kNoteLength_16 Case DataLib.kFlagChordArpeggiate_Length_16 + DataLib.kFlagChordArpeggiate_Length_32 ArpeggioLengthBeats = MIDILib.kNoteLength_16 + MIDILib.kNoteLength_32 Case DataLib.kFlagChordArpeggiate_Length_32 ArpeggioLengthBeats = MIDILib.kNoteLength_32 Case DataLib.kFlagChordArpeggiate_Length_32 + DataLib.kFlagChordArpeggiate_Length_64 ArpeggioLengthBeats = MIDILib.kNoteLength_32 + MIDILib.kNoteLength_64 Case DataLib.kFlagChordArpeggiate_Length_64 ArpeggioLengthBeats = MIDILib.kNoteLength_64 else //ArpeggioLengthBeats = 0 End Select //now let's sort which direction and arpeggiate dim thisNote as Integer dim firstNote as integer = 0 dim lastNote as integer = UBound(me.Notes) if DataLib.GetFlag(DataLib.kFlagChordArpeggiate_LowToHigh, Settings) then for thisNote = firstNote to lastNote if me.Notes(thisNote) <> nil then dim note as NoteObj = me.Notes(thisNote) note.StartBeat = note.StartBeat + (ArpeggioLengthBeats * thisNote) end if next elseif DataLib.GetFlag(DataLib.kFlagChordArpeggiate_HighToLow, Settings) then for thisNote = lastNote DownTo firstNote if me.Notes(thisNote) <> nil then dim note as NoteObj = me.Notes(thisNote) note.StartBeat = note.StartBeat + (ArpeggioLengthBeats * InvertIterator(thisNote, lastNote)) end if next end if end if End Sub #tag EndMethod #tag Method, Flags = &h0 Function CalculatePitches() As Boolean //called from EditMgr.MakeChord if me.Settings = 0 then return false if Root = nil then MsgBox "ChordObj.CalculatePitches: A root note must be selected and applied to the chord before it can calculate the pitches." return false end if RootIndex = Track.TrackList.ParentWindow.SongMgr.Keys(0).IsPitchWithinKey(Root.Pitch) //NilObjectException on SongMgrObj if RootIndex = -1 then MsgBox "ChordObj.CalculatePitches: The selected note must be in key to create a chord." return false end if RemoveArpeggio ClearNotes GetChordInformation AddExtensions ApplyModifiers dim i as integer for i = 1 to Ubound(StepValuesString) dim StepValue as Integer = GetStepValue(StepValuesString(i)) dim pitchModifier as integer = GetPitchModifer(StepValuesString(i)) AddNote(StepValue, pitchModifier) next //Arpeggios are keen! Let's make one! Arpeggiate SetNoteList return true End Function #tag EndMethod #tag Method, Flags = &h21 Private Sub ClearNotes() dim i, n, x, y, z as integer if Ubound(Notes) <> -1 then for i = Ubound(Notes) DownTo 1 //only down to 1 because note 0 is the root note. if Notes(i) <> nil and Notes(i) <> Root then Notes(i).Chord = nil //destroyNote also destroys the chord, so we break the link Track.TrackList.ParentWindow.NoteMgr.DestroyNote(Notes(i)) Notes.Remove(i) end if next end if End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Constructor() // Calling the overridden superclass constructor. Super.Constructor End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DeselectObj() #if kLogMethods Log("ChordObj.DeselectObj") #endif if me.Selected = false then return me.Selected = false dim thisNote as integer = 0 dim firstNote as integer = 0 dim lastNote as integer = Ubound(me.Notes) for thisNote = firstNote to lastNote if Notes(thisNote) <> nil then Notes(thisNote).DeselectObj end if next End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub GetChordInformation() //called from CalculatePitches //get the chord information if DataLib.GetFlag(DataLib.kFlagChordType_Major, Settings) then Type = MusicLib.kChordType_Major if DataLib.GetFlag(DataLib.kFlagChordType_Minor, Settings) then Type = MusicLib.kChordType_Minor if DataLib.GetFlag(DataLib.kFlagChordType_Diminished, Settings) then Type = MusicLib.kChordType_Diminished if DataLib.GetFlag(DataLib.kFlagChordType_Augmented, Settings) then Type = MusicLib.kChordType_Augmented dim ChordInfo(-1) as string ChordInfo = Split(Type, "=") //parse key name Name = MusicLib.GetNoteName(Root.Pitch) + " " + ChordInfo(0) //Make step values string array out of second part StepValuesString = Split(ChordInfo(1), " ") End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function GetPitchModifer(TheStepValue as string) As Integer dim stepChr as string = GetStepCharacter(TheStepValue) dim pitchModifier as integer = 0 if stepChr = "b" then pitchModifier = -1 elseif stepChr = "#" then pitchModifier = 1 end if return pitchModifier End Function #tag EndMethod #tag Method, Flags = &h21 Private Function GetStepCharacter(TheStep as String) As String dim stepChr as string = Left(TheStep, 1) return stepChr End Function #tag EndMethod #tag Method, Flags = &h21 Private Function GetStepValue(TheStepValue as string) As Integer //calculate the pitches for the chord. //Major=1 3 5 //Minor=1 b3 5 //All possibilities //1 [b]3 [#]5 [6|[b]7] [b]9 [b]11 //here we parse the step value dim StepValue as integer dim stepChr as string stepChr = GetStepCharacter(TheStepValue) if InStr(0, "1234567890", stepChr) > 0 then //it's a number StepValue = Val(TheStepValue) - 1 else //it's a modifier StepValue = Val(Right(TheStepValue, Len(TheStepValue) - 1)) - 1 end if return StepValue End Function #tag EndMethod #tag Method, Flags = &h21 Private Function GetStepValuesString() As String '//FOR TROUBLESHOOTING PURPOSES ONLY ' 'dim returnString as string = "" ' '//GET THE STEP STRING 'dim thisString as integer 'dim firstString as integer = 0 'dim lastString as integer = Ubound(StepValuesString) ' 'for thisString = firstString to lastString 'returnString = returnString + " " + StepValuesString(thisString) 'next ' '//GET THE NOTE VALUES 'returnString = returnString + " : " ' 'dim thisNote as integer 'dim firstNote as integer = 0 'dim lastNote as integer = Ubound(me.Notes) ' 'for thisNote = firstNote to lastNote 'dim note as noteObj = me.Notes(thisNote) ' 'if note <> nil then 'returnString = returnString + " " + Str(Note.Pitch) 'end if 'next ' 'return returnString End Function #tag EndMethod #tag Method, Flags = &h21 Private Sub GroupObj() // Part of the GroupInterfaceObj interface. End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function InvertIterator(theAmount as integer, theUbound as integer) As Integer dim theInvertedAmount as integer theInvertedAmount = Abs(theAmount - theUbound) return theInvertedAmount End Function #tag EndMethod #tag Method, Flags = &h21 Private Sub Log(theText as string) WindowLog.Log(theText) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub RemoveArpeggio() dim i, n, x, y, z as integer dim thisNote as integer dim ChordStartBeat as integer = me.Root.StartBeat if Ubound(Notes) <> -1 then for thisNote = Ubound(Notes) DownTo 0 if Notes(thisNote) <> nil then dim note as NoteObj = Notes(thisNote) ChordStartBeat = min(ChordStartBeat, Note.StartBeat) end if next end if me.Root.StartBeat = ChordStartBeat End Sub #tag EndMethod #tag Method, Flags = &h0 Sub RemoveNote(Note as NoteObj) dim firstObject as integer = 0 dim thisObject as integer = 0 dim lastObject as integer = Ubound(Notes) for thisObject = lastObject DownTo firstObject if Notes(thisObject) <> nil then if Notes(thisObject) IsA NoteObj then if Notes(thisObject) = Note then Notes.Remove(thisObject) end if end if end if next End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub ResetNoteList() // Part of the NoteListInterface interface. redim NoteList(-1) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SelectObj() if me.Selected = true then return me.Selected = true dim thisNote as integer = 0 dim firstNote as integer = 0 dim lastNote as integer = Ubound(me.Notes) for thisNote = firstNote to lastNote if Notes(thisNote) <> nil then Notes(thisNote).SelectObj end if next End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetNoteList() // Part of the NoteListInterface interface. // called when the chord has been created and the notes added to the list. ResetNoteList dim thisNote as integer = 0 dim firstNote as integer = 0 dim lastNote as integer = Ubound(Notes) for thisNote = firstNote to lastNote if Notes(thisNote) <> nil then dim theNote as NoteObj = Notes(thisNote) dim thisNestedNote as integer = 0 dim firstNestedNote as integer = 0 dim lastNestedNote as integer = UBound(theNote.NoteList) for thisNestedNote = firstNestedNote to lastNestedNote if theNote.NoteList(thisNestedNote) <> nil then dim theNestedNote as NoteObj = theNote.NoteList(thisNestedNote) NoteList.Append theNestedNote end if next end if next End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub UnGroupObj() // Part of the GroupInterfaceObj interface. End Sub #tag EndMethod #tag Note, Name = How Chords Are Made Chords are complicated, so we need to be sure we can do this in a manageable order. Essentially, they way it will work is we're going to build a string that will tell us what perfects and modified perfects to add the music. In each step below, the chord name is built as well... [ ] Get the basic chord type. This builds the initial string. [ ] Check the extensions; in all positive cases, add the name of the extension to the chord's name (which should still be a buffer). [ ] If the extension is an Eleventh, select the Ninth and Seventh [ ] if the extension is a Ninth, select the Seventh [ ] if the extension is a Seventh, do nothing. [ ] otherwise, leave the controls alone [ ] Check the modfiers [ ] If the chord is suspended, change the 3 in the string into a 4 [ ] If the chord is a power chord, remove the 3 (or 4) from the string [ ] Handle inversions (TK) Once the string is built, loop through the values and make the chord. #tag EndNote #tag Property, Flags = &h0 Notes(-1) As NoteObj #tag EndProperty #tag Property, Flags = &h0 Root As NoteObj #tag EndProperty #tag Property, Flags = &h0 RootIndex As Integer = -1 #tag EndProperty #tag Property, Flags = &h0 Settings As Integer #tag EndProperty #tag Property, Flags = &h0 StepValuesString(-1) As String #tag EndProperty #tag Property, Flags = &h0 Type As String #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="RootIndex" Group="Behavior" InitialValue="-1" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Settings" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Type" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/CursorObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class CursorObj Inherits MusicObj #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/CursorObjs/EditCursorObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class EditCursorObj Inherits CursorObj #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/CursorObjs/LoopStartCursorObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class LoopStartCursorObj Inherits CursorObj #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/CursorObjs/LoopStopCursorObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class LoopStopCursorObj Inherits CursorObj #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/CursorObjs/StartCursorObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class StartCursorObj Inherits CursorObj #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/CursorObjs/StopCursorObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class StopCursorObj Inherits CursorObj #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/GroupObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class GroupObj Inherits MusicObj Implements NoteListInterface #tag Method, Flags = &h0 Sub Constructor() // Calling the overridden superclass constructor. Super.Constructor End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DeselectObj() #if kLogMethods Log("GroupObj.DeselectObj") #endif if Selected = false then return Selected = false dim thisObject as integer = 0 dim firstObject as integer = 0 dim lastObject as integer = Ubound(Objects) for thisObject = firstObject to lastObject if Objects(thisObject) <> nil then dim theMusicObj as MusicObj = Objects(thisObject) if Objects(thisObject) IsA GroupObj then dim group as GroupObj = Objects(thisObject) group.DeSelectObj end if if Objects(thisObject) IsA ChordObj then dim chord as ChordObj = Objects(thisObject) chord.DeSelectObj end if if Objects(thisObject) IsA NoteObj then dim note as NoteObj = Objects(thisObject) note.DeselectObj end if end if next End Sub #tag EndMethod #tag Method, Flags = &h0 Function GetBounds(GroupOutline as GroupOutlineObj) As GroupOutlineObj dim GroupOutlineReturn as GroupOutlineObj = GroupOutline dim thisObject as integer = 0 dim firstObject as integer = 0 dim lastObject as integer = Ubound(Objects) for thisObject = firstObject to lastObject if Objects(thisObject) <> nil then dim theMusicObj as MusicObj = Objects(thisObject) if Objects(thisObject) IsA GroupObj then dim group as GroupObj = Objects(thisObject) GroupOutlineReturn = group.GetBounds(GroupOutlineReturn) end if if Objects(thisObject) IsA ChordObj then dim chord as ChordObj = Objects(thisObject) dim thisNote as integer = 0 dim firstNote as integer = 0 dim lastNote as integer = Ubound(chord.Notes) for thisNote = firstNote to lastNote dim note as noteObj = chord.Notes(thisNote) GroupOutlineReturn = SetBounds(GroupOutlineReturn, Note) next end if if Objects(thisObject) IsA NoteObj then dim note as NoteObj = Objects(thisObject) GroupOutlineReturn = SetBounds(GroupOutlineReturn, Note) end if end if next return GroupOutlineReturn End Function #tag EndMethod #tag Method, Flags = &h0 Function IsGroupWithinBounds(Beat1 as integer, Pitch1 as integer, Beat2 as integer, Pitch2 as integer) As Boolean dim o, c as integer dim objectCount as integer dim WithinBounds as boolean dim note as noteObj dim chord as chordOBj dim group as groupObj objectCount = Ubound(Objects) for o = objectCount DownTo 0 if Objects(o) <> nil then if Objects(o) IsA NoteObj then note = Objects(o) WithinBounds = note.IsNoteWithinDragBounds(Beat1, Pitch1, Beat2, Pitch2) if WithinBounds = true then WindowMgr.CurrentEditor.NoteMgr.AddSelectionFromNote(Note) else WindowMgr.CurrentEditor.NoteMgr.RemoveSelection(Note) end if end if end if if Objects(o) IsA ChordObj then chord = Objects(o) dim chordNoteCount as integer = Ubound(chord.Notes) for c = chordNoteCount DownTo 0 if Chord.Notes(c) <> nil then note = Chord.Notes(c) WithinBounds = note.IsNoteWithinDragBounds(Beat1, Pitch1, Beat2, Pitch2) if WithinBounds = true then WindowMgr.CurrentEditor.NoteMgr.AddSelectionFromNote(Note) exit else WindowMgr.CurrentEditor.NoteMgr.RemoveSelection(Note) end if end if next end if //this is where it gets tricky because the GroupObj can be nested. 'if Objects(o) IsA GroupObj then 'group = Objects(o) 'group.IsGroupWithinBounds(Beat1, Pitch1, Beat2, Pitch2) 'end if next End Function #tag EndMethod #tag Method, Flags = &h21 Private Sub Log(theText as string) WindowLog.Log(theText) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub ResetNoteList() // Part of the NoteListInterface interface. redim NoteList(-1) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SelectObj() if Selected = true then return Selected = true dim thisObject as integer = 0 dim firstObject as integer = 0 dim lastObject as integer = Ubound(Objects) for thisObject = firstObject to lastObject if Objects(thisObject) <> nil then if Objects(thisObject) IsA GroupObj then dim group as GroupObj = Objects(thisObject) group.SelectObj end if if Objects(thisObject) IsA ChordObj then dim chord as ChordObj = Objects(thisObject) chord.SelectObj end if if Objects(thisObject) IsA NoteObj then dim note as NoteObj = Objects(thisObject) note.SelectObj end if end if next End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function SetBounds(GroupOutline as GroupOutlineObj, Note as NoteObj) As GroupOutlineObj dim GroupOutlineReturn as GroupOutlineObj = GroupOutline if GroupOutlineReturn.outlineX1 = -1 then GroupOutlineReturn.outlineX1 = note.StartBeat if GroupOutlineReturn.outlineY1 = -1 then GroupOutlineReturn.outlineY1 = note.Pitch if GroupOutlineReturn.outlineX2 = -1 then GroupOutlineReturn.outlineX2 = note.StartBeat if GroupOutlineReturn.outlineY2 = -1 then GroupOutlineReturn.outlineY2 = note.Pitch GroupOutlineReturn.outlineX1 = min(GroupOutlineReturn.outlineX1, note.StartBeat) GroupOutlineReturn.outlineY1 = max(GroupOutlineReturn.outlineY1, note.Pitch) GroupOutlineReturn.outlineX2 = max(GroupOutlineReturn.outlineX2, note.StartBeat + note.Length) GroupOutlineReturn.outlineY2 = min(GroupOutlineReturn.outlineY2, note.Pitch) return GroupOutlineReturn End Function #tag EndMethod #tag Method, Flags = &h0 Sub SetNoteList() // Part of the NoteListInterface interface. // called from EditMgrObj.MakeGroup ResetNoteList dim thisObject as integer = 0 dim firstObject as integer = 0 dim lastObject as integer = Ubound(Objects) for thisObject = firstObject to lastObject if Objects(thisObject) <> nil then if Objects(thisObject) IsA GroupObj then dim group as GroupObj = Objects(thisObject) dim thisGroupNote as integer = 0 dim firstGroupNote as integer = 0 dim lastGroupNote as integer = Ubound(group.NoteList) for thisGroupNote = firstGroupNote to lastGroupNote if group.NoteList(thisGroupNote) <> nil then dim theGroupNote as NoteObj = group.NoteList(thisGroupNote) NoteList.Append theGroupNote end if next end if if Objects(thisObject) IsA ChordObj then dim chord as ChordObj = Objects(thisObject) dim thisChordNote as integer = 0 dim firstChordNote as integer = 0 dim lastChordNote as integer = Ubound(Chord.NoteList) for thisChordNote = firstChordNote to lastChordNote if Chord.NoteList(thisChordNote) <> nil then dim theChordNote as NoteObj = Chord.NoteList(thisChordNote) NoteList.Append theChordNote end if next end if if Objects(thisObject) IsA NoteObj then dim note as NoteObj = Objects(thisObject) dim thisNoteNote as integer = 0 dim firstNoteNote as integer = 0 dim lastNoteNote as integer = Ubound(Note.NoteList) for thisNoteNote = firstNoteNote to lastNoteNote if Note.NoteList(thisNoteNote) <> nil then dim theNoteNote as NoteObj = Note.NoteList(thisNoteNote) NoteList.Append theNoteNote end if next end if end if next End Sub #tag EndMethod #tag Method, Flags = &h0 Sub UnGroupObj() // Part of the GroupInterfaceObj interface. End Sub #tag EndMethod #tag Note, Name = Brainstorm [ ] Groups are really only there to make sure that everything that needs to be selected will be with one click. That's it. The Group and UnGroup commands are fairly straightforward. SelectObjects needs to go up the group hierarchy, get the topmost group, and add all linked objects to the selection array in the hierarchy. To do this, NoteMgrObj.AddSelectionFromNote needs to check if the object's Group variable is nil. if it isn't, it will call SelectObjects for that group. SelectObjects needs to get the topmost group, and work down from there. DeselectObjects needs to do the same thing: get the topmost parent and work down from there. Because we want to show groups in the editor, we need to get the topmost group, calculate the outermost bounds for all objects, and then draw the outline. #tag EndNote #tag Property, Flags = &h0 Objects(-1) As Variant #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/KeyObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class KeyObj Inherits MusicObj #tag Method, Flags = &h0 Sub CalculatePitches() //if the user is changig the key, then get ready to calculate the new pitches by clearing the current ones. redim Pitches(-1) redim StepValuesString(-1) redim PitchesBuffer(-1) dim i, n, x, y, z as integer //get the key information //Major=2 2 1 2 2 2 1 dim KeyInfo(-1) as string KeyInfo = Split(Key, "=") //parse key name TonicName = MusicLib.GetNoteName(Tonic) Name = TonicName + " " + KeyInfo(0) //Make step values string array out of second part dim StepValues(-1) as integer StepValuesString = Split(KeyInfo(1), " ") for i = 0 to UBound(StepValuesString) StepValues.Append Val(StepValuesString(i)) next //the user can click on any pitch on the keyboard, so let's take this back to C1. dim StartPitch as integer Tonic = GetKeyTonicFromPitchValue(Tonic) //this reduces the user supplied value down to the C1 octave for drawing later. StartPitch = Tonic //iterate through the step values until we come to the top of the C1 octave dim StepIndex as integer = 0//this is a placeholder for when we're done iterating through the step values dim lastPitch as integer //this is the buffer variable so we can check the do...loop //all keys start with the tonic. PitchesBuffer.Append StartPitch //start from the Tonic and go to the top of the C1 octave lastPitch = StartPitch do until StepIndex = Ubound(StepValues) lastPitch = lastPitch + StepValues(StepIndex) PitchesBuffer.Append lastPitch StepIndex = StepIndex + 1 loop //brng down those pitches that fall outside of the C1 octave for i = Ubound(PitchesBuffer) DownTo 0 if PitchesBuffer(i) > 11 then PitchesBuffer(i) = PitchesBuffer(i) - 12 next PitchesBuffer.Sort //make the C1 octave pitches "live" for i = 0 to ubound(PitchesBuffer) Pitches.Append PitchesBuffer(i) next //calculate the notes for the rest of the octaves. for i = 12 to 132 step 12 for n = 0 to Ubound(PitchesBuffer) Pitches.Append i + PitchesBuffer(n) next next //trim off the pitches > 127; we could probably do this up here for i = Ubound(Pitches) DownTo 0 if Pitches(i) > 127 then Pitches.Remove(i) end if next 'if DataLib.GetFlag(DataLib.kFlagKeyMod_PentatonicMajor, Settings) then //1 2 3 5 6; 4 7 'for i = Ubound(Pitches) DownTo 0 step 7 'Pitches.Remove(i) 'Pitches.Remove(i - 3) 'next 'end if ' 'if DataLib.GetFlag(DataLib.kFlagKeyMod_PentatonicMinor, Settings) then //1 3 4 5 7; 2 6 'for i = Ubound(Pitches) DownTo 0 step 7 'Pitches.Remove(i - 1) 'Pitches.Remove(i - 5) 'next 'end if End Sub #tag EndMethod #tag Method, Flags = &h0 Function GetKeyTonicFromPitchValue(Pitch as integer) As Integer //this is called from [don't know where yet] //A user is supposed to be able to pick any note on the keyboard and set the key. //since the tonic is based on those pitched in the C1 octave, this does the math to sort out //which tonic it really is (0-12) and allow the KeyObj be able to calculate the pitches //in the requested key. dim KeyTonic as integer //go through the ranges if Pitch >= 0 and Pitch < 12 then KeyTonic = Pitch elseif Pitch >= 12 and Pitch < 24 then KeyTonic = Pitch - 12 elseif Pitch >= 24 and Pitch < 36 then KeyTonic = Pitch - 24 elseif Pitch >= 36 and Pitch < 48 then KeyTonic = Pitch - 36 elseif Pitch >= 48 and Pitch < 60 then KeyTonic = Pitch - 48 elseif Pitch >= 60 and Pitch < 72 then KeyTonic = Pitch - 60 elseif Pitch >= 72 and Pitch < 84 then KeyTonic = Pitch - 72 elseif Pitch >= 84 and Pitch < 96 then KeyTonic = Pitch - 84 elseif Pitch >= 96 and Pitch < 108 then KeyTonic = Pitch - 96 elseif Pitch >= 108 and Pitch < 120 then KeyTonic = Pitch - 108 elseif Pitch >= 120 and Pitch < 127 then KeyTonic = Pitch - 120 end if return KeyTonic End Function #tag EndMethod #tag Method, Flags = &h0 Function GetPitchIndex(ThePitch as integer) As Integer dim thisPitch as integer = 0 dim firstPitch as integer = 0 dim lastPitch as integer = UBound(Pitches) for thisPitch = firstPitch to lastPitch dim mPitch as integer = Pitches(thisPitch) if mPitch = ThePitch then return thisPitch end if next return UBound(Pitches) \ 2 End Function #tag EndMethod #tag Method, Flags = &h0 Function GetPitchInKeyAbove(Pitch as integer) As Integer dim thisPitch as integer = 0 dim firstPitch as integer = 0 dim lastPitch as integer = Ubound(Pitches) for thisPitch = lastPitch DownTo firstPitch dim thePitch as integer = Pitches(thisPitch) if thePitch > Pitch then return thePitch next Return MIDILib.kMIDINoteCount - 1 End Function #tag EndMethod #tag Method, Flags = &h0 Function GetPitchInKeyAboveIndex(Pitch as integer) As Integer dim thisPitch as integer = 0 dim firstPitch as integer = 0 dim lastPitch as integer = Ubound(Pitches) for thisPitch = lastPitch DownTo firstPitch dim thePitch as integer = Pitches(thisPitch) if thePitch > Pitch then return thisPitch next return UBound(Pitches) End Function #tag EndMethod #tag Method, Flags = &h0 Function GetPitchInKeyBelow(Pitch as integer) As Integer dim thisPitch as integer = 0 dim firstPitch as integer = 0 dim lastPitch as integer = Ubound(Pitches) for thisPitch = firstPitch To lastPitch dim thePitch as integer = Pitches(thisPitch) if thePitch < Pitch then return thePitch next return 0 End Function #tag EndMethod #tag Method, Flags = &h0 Function GetPitchInKeyBelowIndex(Pitch as integer) As Integer dim thisPitch as integer = 0 dim firstPitch as integer = 0 dim lastPitch as integer = Ubound(Pitches) for thisPitch = firstPitch To lastPitch dim thePitch as integer = Pitches(thisPitch) if thePitch < Pitch then return thisPitch next return 0 End Function #tag EndMethod #tag Method, Flags = &h0 Function IsPitchWithinKey(Pitch as integer) As Integer //this is called by GUIObj.DrawKeys to show those pitches in key. //this is also called by ChordObj.CalculatePitches to determine if the root is in key and what the index is to go up the steps for the chord. //it will also be called by ACS to determine if the pitch created is in key //this assumes that the Pitches array has been populated. //this returns the index of the pitch or -1 if the pitch isn't in the array dim i as integer dim pitchCount as integer = Ubound(Pitches) dim checkPitch as integer dim foundPitch as integer = -1 for i = 0 to pitchCount checkPitch = Pitches(i) if pitch = checkPitch then foundPitch = i next return foundPitch End Function #tag EndMethod #tag Note, Name = CalculatePitches Brainstorm //If the Key or the tonic wasn't set properly default to C major. If Key = "" then Key = MusicLib.kKeyMajor If Tonic < 0 or Tonic > 127 then Tonic = 0 //get the key information //Major=2 2 1 2 2 2 1 dim KeyInfo(-1) as string KeyInfo = Split(Key, "=") //parse key name TonicName = MusicLib.GetNoteName(Tonic) Name = TonicName + " " + KeyInfo(0) //Make step values integer array out of second part dim StepValues(-1) as integer StepValues = Split(KeyInfo(1), " ") //now we get all the values in the C1 octave because this is the basis for the rest of the octaves dim StartNote as integer StartNote = GetKeyTonicFromPitchValue(Tonic) We iterate up the scale until we get to a pitch > 11. From there, we need to calculate how far up the step values we went and then back track. C1 note calculation begins with the tonic itself. The step values then move up from there. The last step value bring us back to the tonic in the next octave #tag EndNote #tag Note, Name = Known Bugs All new bug reports need to go to MusicSketchBugs.003 [FIXED] The following tonics aren't doing the correct math The sequenced notes show the same note. //1 @ 6-7 //3 @ 7-8 //5 @ 1-2 //8 @ 3-4 //10 @ 4-5 #tag EndNote #tag Property, Flags = &h0 Key As String #tag EndProperty #tag Property, Flags = &h0 Modifier As Integer #tag EndProperty #tag Property, Flags = &h0 Pitches(-1) As Integer #tag EndProperty #tag Property, Flags = &h0 #tag Note Make Private when not troubleshooting #tag EndNote PitchesBuffer(-1) As Integer #tag EndProperty #tag Property, Flags = &h0 Settings As Integer #tag EndProperty #tag Property, Flags = &h0 Song As SongMgrObj #tag EndProperty #tag Property, Flags = &h0 #tag Note This will eventually be called by the new ruler to show where keys change. #tag EndNote StartBeat As Integer = 0 #tag EndProperty #tag Property, Flags = &h0 #tag Note Make Private when not troubleshooting #tag EndNote StepValuesString(-1) As String #tag EndProperty #tag Property, Flags = &h0 #tag Note This is based on the 0-12 MIDI Note values in the C11 octave -1 means no value #tag EndNote Tonic As Integer = -1 #tag EndProperty #tag Property, Flags = &h0 TonicName As String #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Key" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" EditorType="MultiLineEditor" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Modifier" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Settings" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Tonic" Group="Behavior" InitialValue="-1" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="TonicName" Group="Behavior" Type="String" EditorType="MultiLineEditor" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/MusicObjs/NoteListInterface.rbbas
@@ -0,0 +1 @@
+#tag Interface Protected Interface NoteListInterface #tag Method, Flags = &h0 Sub ResetNoteList() End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetNoteList() End Sub #tag EndMethod #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag EndViewBehavior End Interface #tag EndInterface
View
1 Music Objects/MusicObjs/NoteObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class NoteObj Inherits MusicObj Implements NoteListInterface #tag Method, Flags = &h0 Sub Constructor() // Calling the overridden superclass constructor. Super.Constructor SetNoteList End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DeselectObj() #if kLogMethods Log("NoteObj.DeselectObj") #endif if me.Selected = false then return me.Selected = false End Sub #tag EndMethod #tag Method, Flags = &h0 Function IsNoteWithinDragBounds(Beat1 as integer, Pitch1 as integer, Beat2 as integer, Pitch2 as integer) As Boolean //called by GUIObj.MouseDrag when GUIObj.DragSelectMode = true Dim PitchConditionMet as Boolean Dim BeatConditionMet as Boolean if me.Pitch <= Pitch1 and me.Pitch >= Pitch2 then PitchConditionMet = true end if //this goes through the center of the Note //It should go by either end and cutting through the middle, but this works. if me.StartBeat + (me.Length \ 2) >= Beat1 and me.StartBeat + (me.Length \ 2) <= Beat2 then BeatConditionMet = true end if if PitchConditionMet and BeatConditionMet then return true end if return false End Function #tag EndMethod #tag Method, Flags = &h21 Private Sub Log(theText as string) WindowLog.Log(theText) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub ResetNoteList() // Part of the NoteListInterface interface. redim NoteList(-1) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SelectObj() if me.Selected = true then return Selected = true End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetNoteList() // Part of the NoteListInterface interface. // called by NoteMgrObj.CreateNote ResetNoteList NoteList.Append Me End Sub #tag EndMethod #tag Property, Flags = &h0 Chord As ChordObj #tag EndProperty #tag Property, Flags = &h0 NextNote As NoteObj #tag EndProperty #tag Property, Flags = &h0 PreviousNote As NoteObj #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Description" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Hidden" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="ID" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Label" Group="Behavior" Type="String" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Length" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Locked" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="OldLength" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="OldPitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="OldStartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Pitch" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="MusicObj" #tag EndViewProperty #tag ViewProperty Name="Selected" Group="Behavior" InitialValue="0" Type="Boolean" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="StartBeat" Group="Behavior" InitialValue="0" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Velocity" Group="Behavior" InitialValue="60" Type="Integer" InheritedFrom="PlayObj" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/YNotePlayer/CoreAudioNotePlayer.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class CoreAudioNotePlayer Implements NotePlayerInterface #tag Method, Flags = &h0 Sub Constructor() dim renderFlags,outSize as MemoryBlock dim busIndex as integer dim synthUnit as memoryBlock dim usesReverb as MemoryBlock dim err as integer 'struct ComponentDescription { 'OSType componentType; 'OSType componentSubType; 'OSType componentManufacturer; 'unsigned long componentFlags; 'unsigned long componentFlagsMask; '}; err = 0 //create the AUGraph graph=NewMemoryBlock(4) graph.long(0) = 0 err = SNewAUGraph Display "SANewAUGraph = "+str(err) //open the DLS Synth description = newMemoryBlock(20) description.long(0) = OSTypeToLong(kAudioUnitComponentType)//Type description.long(4) = OSTypeToLong(kAudioUnitSubType_MusicDevice)//SubType description.long(8) = OSTypeToLong(kAudioUnitID_DLSSynth)//Mfg description.long(12) = 0//Flags description.long(16) = 0//FlagsMask synthNode = NewMemoryBlock(4) synthNode.long(0) = 0 err = SAUGraphNewNode(graph, description, 0, 0, synthNode) Display "SAUGraphNewNode synthNode = "+str(err) // Open the filter 'description.long(0) = OSTypeToLong(kAudioUnitComponentType)//Type 'description.long(4) = OSTypeToLong(kAudioUnitSubType_Effect)//SubType 'description.long(8) = OSTypeToLong(kAudioUnitID_Delay)//kAudioUnitID_LowPassFilter)//Mfg 'description.long(12) = 0//Flags 'description.long(16) = 0//FlagsMask 'filterNode = NewMemoryBlock(4) 'filterNode.long(0) = 0 'err = SAUGraphNewNode(graph, description, 0, 0, filterNode) 'Display "SAUGraphNewNode filterNode = "+str(err) '#define kAudioUnitID_MatrixReverb 'mrev' '#define kAudioUnitID_Delay 'dely' '#define kAudioUnitID_LowPassFilter 'lpas' '#define kAudioUnitID_HighPassFilter 'hpas' '#define kAudioUnitID_BandPassFilter 'bpas' '#define kAudioUnitID_PeakLimiter 'lmtr' '#define kAudioUnitID_DynamicsProcessor 'dcmp' // Open the output device 'description = newMemoryBlock(20) description.long(0) = OSTypeToLong(kAudioUnitComponentType)//Type description.long(4) = OSTypeToLong(kAudioUnitSubType_Output)//SubType description.long(8) = OSTypeToLong(kAudioUnitID_DefaultOutput)//Mfg description.long(12) = 0//Flags description.long(16) = 0//FlagsMask outputNode = NewMemoryBlock(4) outputNode.long(0) = 0 err = SAUGraphNewNode(graph, description, 0, 0, outputNode) Display "SAUGraphNewNode outputNode = "+str(err) // Connect the devices up (with delay unit) 'err = SAUGraphConnectNodeInput(graph,synthNode,1,filterNode,0) 'Display "SAUGraphConnectNodeInput synth->filter = "+str(err) 'err = SAUGraphConnectNodeInput(graph,filterNode,0,outputNode,0) 'Display "SAUGraphConnectNodeInput filter->output = "+str(err) 'err = SAUGraphUpdate(graph) 'Display "SAUGraphUpdate = "+str(err) // Connect the devices up err = SAUGraphConnectNodeInput(graph,synthNode,1,outputNode,0) Display "SAUGraphConnectNodeInput synth->filter = "+str(err) 'err = SAUGraphConnectNodeInput(graph,filterNode,0,outputNode,0) 'Display "SAUGraphConnectNodeInput filter->output = "+str(err) err = SAUGraphUpdate(graph) Display "SAUGraphUpdate = "+str(err) // Open and initialize the audio units err = SAUGraphOpen(graph) Display "SAUGraphOpen = "+str(err) err = SAUGraphInitialize(graph) Display "SAUGraphInitialize = "+str(err) #if kErr then // Turn off the reverb on the synth 'outDescription = newmemoryBlock(4) 'outDescription.long(0) = 0 'outClassDataSize = newmemoryBlock(4) 'outClassData = newmemoryBlock(4) 'outClassData.long(0) = 0 synthUnit = newmemoryBlock(4) err = SAUGraphGetNodeInfo (graph, synthNode, 0,0,0, synthUnit) usesReverb = newmemoryBlock(4) //theAudioUnit as memoryBlock, inID as integer, inScope as integer, //inElement as integer, outData as memoryBlock, ioDataSize as memoryblock 'err = SAudioUnitGetProperty(synthUnit, kMusicDeviceProperty_UsesInternalReverb, kAudioUnitScope_Global, 0, usesReverb, 4) 'usesReverb.long(0) = 0 usesReverb.UInt32Value(0) = 0 'usesReverb.UInt32Value(0) = 1 err = SAudioUnitSetProperty(synthUnit, kMusicDeviceProperty_UsesInternalReverb, kAudioUnitScope_Global, 0, usesReverb, 4) 'err = SAudioUnitSetProperty(synthUnit, kMusicDeviceProperty_UsesInternalReverb, kAudioUnitScope_Global, 1, usesReverb, 4) Display "reverb SAudioUnitSetProperty = "+str(err) // turn off internal reverb 'AudioUnitSetProperty(theSynth, kMusicDeviceProperty_UsesInternalReverb, 'kAudioUnitScope_Global, 0, &reverb, sizeof(UInt32)); 'UInt32 render_flags_3d; 'UInt32 outSize = sizeof(render_flags_3d); renderFlags=NewMemoryBlock(4) outSize=NewMemoryBlock(4) busIndex = 0 // get the current render flags for this bus 'result = AudioUnitGetProperty (mMixerUnit, 'kAudioUnitProperty_3DMixerRenderingFlags, 'kAudioUnitScope_Input, 'busIndex, '&render_flags_3d, '&outSize); //theAudioUnit as memoryBlock, inID as integer, inScope as integer, inElement as integer, outData as memoryBlock, ioDataSize as memoryblock 'outSize.long(0) = 4 'err = SAudioUnitGetProperty (synthUnit,kAudioUnitProperty_3DMixerRenderingFlags,kAudioUnitScope_Input,busIndex,renderFlags,outSize) // turn on this render flag and then set the bus 'render_flags_3d |= k3DMixerRenderingFlags_DistanceDiffusion; 'result = AudioUnitSetProperty( mMixerUnit, 'kAudioUnitProperty_3DMixerRenderingFlags, 'kAudioUnitScope_Input, busIndex, '&render_flags_3d, 'sizeof(render_flags_3d)); 'err = SAudioUnitSetProperty(synthUnit, kMusicDeviceProperty_UsesInternalReverb, kAudioUnitScope_Global, 0, usesReverb, 4) #endif 'enum { 'k3DMixerRenderingFlags_InterAuralDelay = (1L << 0), 'k3DMixerRenderingFlags_DopplerShift = (1L << 1), 'k3DMixerRenderingFlags_DistanceAttenuation = (1L << 2), 'k3DMixerRenderingFlags_DistanceFilter = (1L << 3), 'k3DMixerRenderingFlags_DistanceDiffusion = (1L << 4) '}; // turn off internal reverb 'AudioUnitSetProperty(theSynth, kMusicDeviceProperty_UsesInternalReverb, 'kAudioUnitScope_Global, 0, &reverb, sizeof(UInt32)); //LOOK IN AudioUnitProperties.h for these constants: //kMusicDeviceProperty_UsesInternalReverb = kAudioUnitProperty_UsesInternalReverb //kAudioUnitProperty_UsesInternalReverb = 1005, '// Start playing err = SAUGraphStart(graph) Display "SAUGraphStart = "+str(err) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Destructor() Dispose End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Shared Sub Display(s as string) // A debugging method. We might remove this at some point. #if DebugBuild then 'System.debuglog s #endif End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Sub Dispose() Declare Function AUGraphStop Lib kAudioToolboxLib _ (inGraph as Ptr) as integer Declare Function DisposeAUGraph Lib kAudioToolboxLib _ (inGraph as Ptr) as integer dim err as integer err = SAUGraphStop(graph) Display "SAUGraphStop = "+str(err) 'err = DisposeAUGraph (graph) 'Display "DisposeAUGraph = "+str(err) 'graph.long(0) = 0 // Note from Joe: the above DisposeAUGraph call was commented out in the // code received from Erick. Not yet sure why. End Sub #tag EndMethod #tag Method, Flags = &h0 Function GetInstrument() As Integer // Part of the NotePlayerInterface interface. return curInstrument End Function #tag EndMethod #tag Method, Flags = &h0 Function InstrumentCount() As integer // Get a count of the instruments in the currently loaded file // (or in the built-in set). dim err as integer dim synthUnit as MemoryBlock //get the synth AudioUnit synthUnit = newmemoryBlock(4) err = SAUGraphGetNodeInfo (graph, synthNode, 0,0,0, synthUnit) dim size,count as MemoryBlock//count count = newmemoryBlock(4) size = newmemoryBlock(4) count.long(0) = 0 size.long(0) = 4//the size will be a long (4 bytes) err = SAudioUnitGetProperty(synthUnit, kMusicDeviceProperty_InstrumentCount, kAudioUnitScope_Global, 0, count, size) if err = 0 then return count.long(0) else return 0 end if End Function #tag EndMethod #tag Method, Flags = &h0 Function InstrumentID(instIndex As Integer) As Integer // Get the Instrument ID for a given instrument index. // get the synth AudioUnit Dim synthUnit As New MemoryBlock(4) call SAUGraphGetNodeInfo (graph, synthNode, 0,0,0, synthUnit) // Get the InstrumentID for this instrument index Dim instrumentID As New MemoryBlock(4) Dim size As New MemoryBlock(4) size.long(0) = 4//the size will be a long (4 bytes) call SAudioUnitGetProperty(synthUnit, kMusicDeviceProperty_InstrumentNumber, _ kAudioUnitScope_Global, instindex, instrumentID, size) return instrumentID.Long(0) End Function #tag EndMethod #tag Method, Flags = &h0 Function InstrumentNameByIndex(instIndex as integer) As string // Get the name of an instrument, by its index. dim err as integer dim instrumentID,instrumentName,size as MemoryBlock dim synthUnit as MemoryBlock // get the synth AudioUnit synthUnit = newmemoryBlock(4) err = SAUGraphGetNodeInfo (graph, synthNode, 0,0,0, synthUnit) // Get the InstrumentID for this instrument index instrumentID = newmemoryBlock(4) size = newmemoryBlock(4) size.long(0) = 4//the size will be a long (4 bytes) err = SAudioUnitGetProperty(synthUnit, kMusicDeviceProperty_InstrumentNumber, kAudioUnitScope_Global, instindex, instrumentID, size) instrumentName = newmemoryBlock(256) size = newmemoryBlock(4) size.long(0) = 256 err = SAudioUnitGetProperty(synthUnit, kMusicDeviceProperty_InstrumentName, kAudioUnitScope_Global, instrumentID.long(0), instrumentName, size) 'display " name instrumentID.long(0))="+str(instrumentID.long(0)) return instrumentName.Cstring(0) End Function #tag EndMethod #tag Method, Flags = &h0 Function LoadInstrument(f as folderItem) As integer // Load a SF2 or DLS file, in order to play instrument(s) from that. Declare Function FSMakeFSSpec Lib CarbonLib (vRefNum as Short, dirID as Integer, filename as Pstring, spec as Ptr) as Short dim err as integer dim fileName as String dim synthUnit, fsSpec as MemoryBlock Const noError = 0 Const fileNotFound = -43 //get the synth AudioUnit (we probably already have this from the constructor, but let's load again, just to be snazzy) synthUnit = newmemoryBlock(4) err = SAUGraphGetNodeInfo (graph, synthNode, 0,0,0, synthUnit) if f<>nil then if f.exists then fsSpec=NewMemoryBlock(70) filename = ConvertEncoding(f.Name, Encodings.SystemDefault) err = FSMakeFSSpec(f.MacVRefNum, f.MacDirID, fileName, fsSpec) if (err = fileNotFound) then Display ("CANotePlayer.LoadInstrument fileNotFound") end if If err = noError or err = fileNotFound then //************************************************************************************************************************ // MAJOR LEOPARD/UB FIX : Leopard insists that we stop the graph before we use AudioUnitSetProperty // if we don't, it will crash a mighty crash. I wonder if this will work on Tiger too // perhaps this start stop stuff should go in the SAudioUnitSetProperty method instead //************************************************************************************************************************ err = SAUGraphStop(graph) if err = noError then //load the soundbank err = SAudioUnitSetProperty(synthUnit, kMusicDeviceProperty_SoundBankFSSpec, kAudioUnitScope_Global, 0, fsSpec, 69) if err = noError then //now restart the graph err = SAUGraphStart(graph) if err = noError then //success! else Display ("CANotePlayer.LoadInstrument SAUGraphStart err : ") + str(err) end if else Display ("CANotePlayer.LoadInstrument SAudioUnitSetProperty err : ") + str(err) end if else Display ("CANotePlayer.LoadInstrument SAUGraphStop err : ") + str(err) end if //************************************************************************************************************************ Else 'Raise newMacOSException("FSMakeFSSpec", OSError) Display "CANotePlayer.LoadInstrument FSMakeFSSpec OSError : " + str(err) End if end if end if return err End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function OSTypeToLong(theOSType as string) As Integer Dim i, theLong, aChar, thePower As Integer Dim s As String if Len(theOSType)<>4 then return -1 end if theLong=0 aChar=0 thePower=0 for i=4 downTo 1 aChar=Asc(Mid(theOSType, i, 1)) theLong=theLong+(aChar*(Pow(256, thePower))) thePower=thePower+1 next return theLong End Function #tag EndMethod #tag Method, Flags = &h0 Sub PlayNote(pitch As Integer, velocity As Integer) // Part of the NotePlayerInterface interface. System.DebugLog "PlayNote:" dim err as integer // Simple way (and works on more MIDI devices): //err = SMusicDeviceMIDIEvent( &h90, pitch, velocity, curChannel) // Alternate way -- works only on some, but provides more control: Dim dpitch As Single if pitch < 256 then dpitch = pitch else dpitch = pitch / 256.0 end if if velocity = 0 then Dim idx As Integer = pitchesPlaying.IndexOf( dpitch ) if idx <> -1 then dpitch = notesPlaying( idx ) 'dpitch = notesStarted.Lookup( dpitch, dpitch ) err = SMusicDeviceStopNote( curChannel, dpitch ) System.DebugLog "Stopped note " + Str( dpitch ) _ + " in channel " + Str( curChannel ) + " (result code = " + Str( err ) + ")" pitchesPlaying.Remove idx notesPlaying.Remove idx end if else Dim instrumentID As Integer = curInstrument - 1 if curInstrument = 16385 then instrumentID = 0 err = SMusicDeviceStartNote( instrumentID, curChannel, dpitch, velocity ) 'System.DebugLog "Looking up double value " + Str( dpitch ) 'System.DebugLog "Started note " + notesStarted.Value( dpitch ) + " (from " + Str( dpitch ) + ")" _ '+ " in channel " + Str( curChannel ) + " (result code = " + Str( err ) + ")" end if End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAudioUnitGetProperty(theAudioUnit as memoryBlock, inID as integer, inScope as integer, inElement as integer, outData as memoryBlock, ioDataSize as memoryblock) As integer 'AudioUnitGetProperty '(AudioUnit ci, 'AudioUnitPropertyID inID, 'AudioUnitScope inScope, 'AudioUnitElement inElement, 'void * outData, 'UInt32 * ioDataSize); Declare Function AudioUnitGetProperty _ Lib kAudioUnitLib _ (theAudioUnit as Ptr, inID as integer, inScope as integer, inElement as integer, outData as Ptr, ioDataSize as Ptr) as integer return AudioUnitGetProperty(theAudioUnit.ptr(0), inID, inScope, inElement, outData, ioDataSize) 'result = AudioUnitGetProperty ( 'synthUnit, kMusicDeviceProperty_InstrumentCount, 'kAudioUnitScope_Global, 0, '(void*)&count, &size '); End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAudioUnitSetProperty(theAudioUnit as memoryBlock, inID as integer, inScope as integer, inElement as integer, inData as memoryBlock, inDataSize as integer) As integer Declare Function AudioUnitSetProperty _ Lib kAudioUnitLib _ (theAudioUnit as Ptr, inID as integer, inScope as integer, inElement as integer, inData as Ptr, inDataSize as integer) as integer if theAudioUnit<>nil then Display "SAudioUnitSetProperty theAudioUnit<>nil "+str(theAudioUnit.Size) end if if inData<>nil then Display "SAudioUnitSetProperty inData<>nil"+str(inData.Size) end if Display "SAudioUnitSetProperty inID = "+str(inID) Display "SAudioUnitSetProperty inScope = "+str(inScope) Display "SAudioUnitSetProperty inElement = "+str(inElement) Display "SAudioUnitSetProperty inDataSize = "+str(inDataSize) return AudioUnitSetProperty(theAudioUnit.ptr(0), inID, inScope, inElement, inData, inDataSize) //LOOK IN AudioUnitProperties.h for these constants: //kMusicDeviceProperty_UsesInternalReverb = kAudioUnitProperty_UsesInternalReverb //kAudioUnitProperty_UsesInternalReverb = 1005, //example from SimpleSynth: 'AudioUnitSetProperty ( 'synthUnit, 'kMusicDeviceProperty_UsesInternalReverb, kAudioUnitScope_Global, '0, '&usesReverb, sizeof (usesReverb) '); End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphConnectNodeInput(inGraph as memoryBlock, srcNode as memoryBlock, inSourceOutputNumber as integer, destNode as memoryBlock, inDestInputNumber as integer) As integer 'AUGraphConnectNodeInput 'extern OSStatus AUGraphConnectNodeInput( 'AUGraph inGraph, 'AUNode inSourceNode, 'UInt32 inSourceOutputNumber, 'AUNode inDestNode, 'UInt32 inDestInputNumber '); Declare Function AUGraphConnectNodeInput _ Lib kAudioToolboxLib _ (inGraph as Ptr, inSourceNode as Ptr, inSourceOutputNumber as integer, inDestNode as Ptr, inDestInputNumber as integer) as integer return AUGraphConnectNodeInput(inGraph.Ptr(0), srcNode.Ptr(0), inSourceOutputNumber, destNode.Ptr(0), inDestInputNumber) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphGetNodeInfo(inGraph as memoryblock, inNode as memoryblock, outDescription as integer, outClassDataSize as integer, outClassData as integer, outAudioUnit as memoryblock) As integer 'extern OSStatus AUGraphGetNodeInfo( 'AUGraph inGraph, 'AUNode inNode, 'ComponentDescription *outDescription, 'UInt32 *outClassDataSize, 'void **outClassData, 'AudioUnit *outAudioUnit '); Declare Function AUGraphGetNodeInfo _ Lib kAudioToolboxLib _ (inGraph as Ptr, inNode as Ptr, outDescription as integer, outClassDataSize as integer, outClassData as integer, outAudioUnit as Ptr) as integer return AUGraphGetNodeInfo(inGraph.Ptr(0), inNode.Ptr(0), outDescription, outClassDataSize, outClassData, outAudioUnit) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphInitialize(inGraph as MemoryBlock) As integer //extern OSStatus AUGraphInitialize(AUGraph inGraph); Declare Function AUGraphInitialize _ Lib kAudioToolboxLib _ (inGraph as Ptr) as integer return AUGraphInitialize(inGraph.Ptr(0)) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphNewNode(inGraph as memoryBlock, inDescription as MemoryBlock, inClassDataSize as integer, inClassData as integer, outNode as memoryBlock) As integer 'extern OSStatus AUGraphNewNode( 'AUGraph inGraph, 'const ComponentDescription *inDescription, 'UInt32 inClassDataSize, 'const void *inClassData, 'AUNode *outNode '); Declare Function AUGraphNewNode _ Lib kAudioToolboxLib _ (inGraph as Ptr, inDescription as Ptr, inClassDataSize as integer, inClassData as integer, outNode as Ptr) as integer return AUGraphNewNode(inGraph.Ptr(0), inDescription, inClassDataSize, inClassData, outNode) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphOpen(inGraph as MemoryBlock) As integer //extern OSStatus AUGraphOpen(AUGraph inGraph); Declare Function AUGraphOpen _ Lib kAudioToolboxLib _ (inGraph as Ptr) as integer return AUGraphOpen( inGraph.Ptr(0) ) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphStart(inGraph as MemoryBlock) As Integer //extern OSStatus AUGraphStart(AUGraph inGraph); Declare Function AUGraphStart _ Lib kAudioToolboxLib _ (inGraph as Ptr) as integer return AUGraphStart( inGraph.Ptr(0) ) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphStop(inGraph as MemoryBlock) As integer Declare Function AUGraphStop _ Lib kAudioToolboxLib _ (inGraph as Ptr) as integer return AUGraphStop( inGraph.Ptr(0) ) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Shared Function SAUGraphUpdate(inGraph as memoryBlock) As integer 'extern OSStatus AUGraphUpdate( 'AUGraph inGraph, 'Boolean *outIsUpdated '); Declare Function AUGraphUpdate _ Lib kAudioToolboxLib _ (inGraph as Ptr, outIsUpdated as integer) as integer return AUGraphUpdate(inGraph.Ptr(0), 0) End Function #tag EndMethod #tag Method, Flags = &h0 Sub SetInstrument(instrument As Integer) // Part of the NotePlayerInterface interface. // Note that NotePlayer notes are 1-based, so we must subtract one // to get the internal MIDI instrument number. curInstrument = instrument if instrument = 16385 then // special case: drum kit, implies channel 9 (and instrument 0) curChannel = 9 instrument = 0 else curChannel = 0 instrument = instrument - 1 end if dim err as integer Dim bankSelectMSB As Integer = Bitwise.BitAnd(Bitwise.ShiftRight(instrument, 16, 32), &h7F) Dim bankSelectLSB As Integer = Bitwise.BitAnd(Bitwise.ShiftRight(instrument, 8, 32), &h7F) Dim programChange As Integer = Bitwise.BitAnd(instrument, &h7F) err = SMusicDeviceMIDIEvent( &hB0, 0, bankSelectMSB, curChannel ) err = SMusicDeviceMIDIEvent( &hB0, 0, bankSelectLSB, curChannel ) err = SMusicDeviceMIDIEvent( &hC0, programChange, 0, curChannel ) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetInstrument(instIndex as integer, channel as integer) dim err as integer dim instrumentID,size as MemoryBlock dim synthUnit as MemoryBlock dim instrument as MemoryBlock //get the synth AudioUnit synthUnit = newmemoryBlock(4) err = SAUGraphGetNodeInfo (graph, synthNode, 0,0,0, synthUnit) 'display "setinst : get the synth AudioUnit="+str(err) //Get the InstrumentID for this instrument index instrumentID = newmemoryBlock(4) size = newmemoryBlock(4) size.long(0) = 4//the size will be a long (4 bytes) err = SAudioUnitGetProperty(synthUnit, kMusicDeviceProperty_InstrumentNumber, _ kAudioUnitScope_Global, instindex, instrumentID, size) 'display "setinst : Get the InstrumentID for this instrument index ="+str(err) 'MsgBox "instrumentID.long(0)="+str(instrumentID.long(0)) instrument=newmemoryBlock(3) 'instrument.byte(0) = 128//Bitwise.BitAnd(Bitwise.ShiftRight(instrumentID.long(0),16,32),&h7F)//bankSelectMSB 'instrument.byte(1) = 0//Bitwise.BitAnd(Bitwise.ShiftRight(instrumentID.long(0),8,32),&h7F)//bankSelectLSB 'instrument.byte(2) = 1//Bitwise.BitAnd(instrumentID.long(0),&h7F)//programChange instrument.byte(0) = Bitwise.BitAnd(Bitwise.ShiftRight(instrumentID.long(0),16,32),&h7F)//bankSelectMSB instrument.byte(1) = Bitwise.BitAnd(Bitwise.ShiftRight(instrumentID.long(0),8,32),&h7F)//bankSelectLSB instrument.byte(2) = Bitwise.BitAnd(instrumentID.long(0),&h7F)//programChange 'SMusicDeviceMIDIEvent(inStatus as integer,inData1 as integer,inData2 as integer, channel as integer) 'err = SMusicDeviceMIDIEvent(&hB0, 0, instrument.byte(0),0) 'err = SMusicDeviceMIDIEvent(&hB0, 0, instrument.byte(1),0) 'err = SMusicDeviceMIDIEvent(&hC0, instrument.byte(2),0,0) err = SMusicDeviceMIDIEvent(&hB0, 0, instrument.byte(0),channel) err = SMusicDeviceMIDIEvent(&hB0, 0, instrument.byte(1),channel) err = SMusicDeviceMIDIEvent(&hC0, instrument.byte(2),0,channel) 'err = SMusicDeviceMIDIEvent(&hB0, 0, instrument.byte(0),9) 'err = SMusicDeviceMIDIEvent(&hB0, 0, instrument.byte(1),9) 'err = SMusicDeviceMIDIEvent(&hC0, instrument.byte(2),0,9) End Sub #tag EndMethod #tag Method, Flags = &h1 Protected Function SMusicDeviceMIDIEvent(inStatus as integer,inData1 as integer,inData2 as integer, channel as integer) As Integer 'for (ch = 0; ch < 16; ch++) '> sts = SMusicDeviceMIDIEvent(gMusicDev, 0x90 + ch, 60 + ch, 127, 0); '> sleep(10); '> for (ch = 0; ch < 16; ch++) '> sts = SMusicDeviceMIDIEvent(gMusicDev, 0x80 + ch, 60 + ch, 127, 0); '0x90=144 'EXTERN_API( ComponentResult ) 'MusicDeviceMIDIEvent( 'MusicDeviceComponent ci, 'UInt32 inStatus, 'UInt32 inData1, 'UInt32 inData2, 'UInt32 inOffsetSampleFrame) FIVEWORDINLINE(0x2F3C, 0x0010, 0x0101, 0x7000, 0xA82A); //extern OSStatus NewAUGraph(AUGraph *outGraph); Declare Function MusicDeviceMIDIEvent _ Lib kAudioUnitLib _ (inGraph as Ptr, inStatus as integer,inData1 as integer,inData2 as integer,inOffSetSampleFrame as integer) as integer 'inGraph as memoryblock, 'inNode as memoryblock, 'outDescription as memoryblock, 'outClassDataSize as memoryblock, 'outClassData as memoryblock, 'outAudioUnit as memoryblock dim err as integer 'dim outDescription as memoryblock 'dim outClassDataSize as memoryblock 'dim outClassData as memoryblock dim synthUnit as MemoryBlock 'outDescription = newmemoryBlock(4) 'outDescription.long(0) = 0 'outClassDataSize = newmemoryBlock(4) 'outClassDataSize.long(0) = 0 'outClassData = newmemoryBlock(4) 'outClassData.long(0) = 0 //get the synth AudioUnit synthUnit = newmemoryBlock(4) err = SAUGraphGetNodeInfo (graph, synthNode, 0,0,0, synthUnit) 'return MusicDeviceMIDIEvent(synthUnit.Ptr(0), 144,60,127,0) return MusicDeviceMIDIEvent(synthUnit.Ptr(0), inStatus+channel,inData1+channel,inData2,0) End Function #tag EndMethod #tag Method, Flags = &h1 Protected Function SMusicDeviceStartNote(instrumentID As Integer, channel As Integer, pitch As Double, velocity As Single) As Integer // Reference: MusicDevice.h (part of AudioUnit.framework) //----------------------------------------------------------------------------- // MusicDeviceNoteParams // // This is the structure that should be used as the // const MusicDeviceNoteParams *inParams argument with MusicDeviceStartNote. // // This argument has 2 flavours // (1) MusicDeviceStdNoteParams // where argCount is 2, and the first argument is pitch (defined as // 0 < 128 MIDI NoteNum), the second velocity (0 < 128) // // (2) ExtendedNoteParams // where argCount is 2 + the number of contained // NoteParamsControlValue structures - so the size of the mControls // array is (argCount - 2) //----------------------------------------------------------------------------- ' 'struct NoteParamsControlValue '{ ' UInt32 mID; ' Float32 mValue; '}; 'typedef struct NoteParamsControlValue NoteParamsControlValue; ' 'struct MusicDeviceNoteParams '{ ' UInt32 argCount; ' Float32 mPitch; ' Float32 mVelocity; ' NoteParamsControlValue mControls[1]; /* arbitrary length */ '}; 'typedef struct MusicDeviceNoteParams MusicDeviceNoteParams; Dim noteParams As New MemoryBlock( 28 ) noteParams.UInt32Value( 0 ) = 2 // argCount noteParams.SingleValue( 4 ) = pitch // mPitch (OK to have fractional values here!) noteParams.SingleValue( 8 ) = velocity '/* 'The instrumentID that is passed in to the MusicDeviceStartNote can 'specify a specific intrument ID. The constant 'kMusicNoteEvent_UseGroupInstrument can alternatively be passed to use 'the current instrument defined for that group. In MIDI this is the 'typical usage of a bank and patch set for a specific channel where 'all notes that start on that channel use that instrument. '*/ 'enum { 'kMusicNoteEvent_UseGroupInstrument = 0xFFFFFFFF '}; ' ' 'typedef UInt32 MusicDeviceGroupID; 'typedef UInt32 NoteInstanceID; 'typedef ComponentInstance MusicDeviceComponent; ' 'extern ComponentResult MusicDeviceStartNote( ' MusicDeviceComponent ci, ' MusicDeviceInstrumentID inInstrument, ' MusicDeviceGroupID inGroupID, ' NoteInstanceID * outNoteInstanceID, ' UInt32 inOffsetSampleFrame, ' const MusicDeviceNoteParams * inParams) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; Declare Function MusicDeviceStartNote Lib kAudioUnitLib ( _ synthUnit as Ptr, _ instrumentID as UInt32, _ groupID as UInt32, _ ByRef outNoteInstanceID as Integer, _ inOffsetSampleFrame as UInt32, _ inParams As Ptr) as Integer Dim err as integer // get the synth AudioUnit Dim synthUnit as New MemoryBlock(4) err = SAUGraphGetNodeInfo( graph, synthNode, 0, 0, 0, synthUnit ) // start the note Dim midiPitch As Integer = pitch err = MusicDeviceStartNote( synthUnit.Ptr(0) , instrumentID, channel, midiPitch, 0, noteParams ) System.DebugLog "SMusicDeviceStartNote started note " + Str( midiPitch ) + " (from " + Str( pitch ) + ")" if err = 0 then if notesStarted is nil then notesStarted = New Dictionary notesStarted.Value( pitch ) = midiPitch System.DebugLog "Stored dict value under double " + Str( pitch ) pitchesPlaying.Append pitch notesPlaying.Append midiPitch end if return err End Function #tag EndMethod #tag Method, Flags = &h1 Protected Function SMusicDeviceStopNote(channel As Integer, pitch As Single) As Integer // Reference: MusicDevice.h (part of AudioUnit.framework) 'typedef UInt32 MusicDeviceGroupID; 'typedef UInt32 NoteInstanceID; 'typedef ComponentInstance MusicDeviceComponent; ' 'extern ComponentResult MusicDeviceStopNote( ' MusicDeviceComponent ci, ' MusicDeviceGroupID inGroupID, ' NoteInstanceID inNoteInstanceID, ' UInt32 inOffsetSampleFrame) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; Declare Function MusicDeviceStopNote Lib kAudioUnitLib ( _ synthUnit as Ptr, _ groupID as UInt32, _ inNoteInstanceID as Integer, _ inOffsetSampleFrame as UInt32) as Integer Dim err as integer // get the synth AudioUnit Dim synthUnit as New MemoryBlock(4) err = SAUGraphGetNodeInfo( graph, synthNode, 0, 0, 0, synthUnit ) // stop the note Dim midiPitch As Integer if notesStarted is nil or not notesStarted.HasKey( pitch ) then midiPitch = pitch else midiPitch = notesStarted.Value( pitch ) notesStarted.Remove pitch end if err = MusicDeviceStopNote( synthUnit.Ptr(0) , channel, midiPitch, 0 ) 'System.DebugLog "Stopped note " + Str( midiPitch ) return err End Function #tag EndMethod #tag Method, Flags = &h1 Protected Function SNewAUGraph() As Integer //extern OSStatus NewAUGraph(AUGraph *outGraph); Declare Function NewAUGraph Lib kAudioToolboxLib _ (graph as Ptr) as integer return NewAUGraph( graph ) End Function #tag EndMethod #tag Method, Flags = &h0 Shared Sub TestHack(testVersion As Integer) // This is a hacked-out test to figure out why SMusicDeviceStopNote isn't working on 10.5. System.DebugLog "TestHack:" Declare Function MusicDeviceStartNote Lib kAudioUnitLib ( _ synthUnit as Ptr, instrumentID as UInt32, groupID as UInt32, _ ByRef outNoteInstanceID as Integer, inOffsetSampleFrame as UInt32, _ inParams As Ptr) as Integer Declare Function MusicDeviceStopNote Lib kAudioUnitLib ( _ synthUnit as Ptr, groupID as UInt32, _ inNoteInstanceID as Integer, inOffsetSampleFrame as UInt32) as Integer Dim np As New CoreAudioNotePlayer np.SetInstrument 17 Dim err as integer Dim channel As Integer = 0 Dim instrumentID As Integer = 16 Dim pitch As Single = 60 Dim velocity As Single = 127 Dim noteParams As New MemoryBlock( 28 ) noteParams.UInt32Value( 0 ) = 2 // argCount noteParams.SingleValue( 4 ) = pitch // mPitch (OK to have fractional values here!) noteParams.SingleValue( 8 ) = velocity // get the synth AudioUnit Dim synthUnit as New MemoryBlock(4) err = SAUGraphGetNodeInfo( np.graph, np.synthNode, 0, 0, 0, synthUnit ) // start the note Dim midiPitch As Integer = pitch err = MusicDeviceStartNote( synthUnit.Ptr(0) , instrumentID, channel, midiPitch, 0, noteParams ) System.DebugLog "Started note " + Str( midiPitch ) + " (from " + Str( pitch ) + ")" _ + " (result code = " + Str( err ) + ")" // wait a bit... Dim now As Integer =Ticks do loop until Ticks > now + 60 // stop the note err = MusicDeviceStopNote( synthUnit.Ptr(0) , channel, midiPitch, 0 ) System.DebugLog "Stopped note " + Str( midiPitch ) _ + " (result code = " + Str( err ) + ")" End Sub #tag EndMethod #tag Note, Name = AUNotes typedef UInt32 AudioUnitParameterUnit; // if the "unit" field contains a value not in the enum above, then assume kAudioUnitParameterUnit_Generic typedef struct AudioUnitParameterInfo { #if TARGET_API_MAC_OSX char name[56]; // UTF8 encoded C string, may be treated as 56 characters // if kAudioUnitParameterFlag_HasCFNameString not set UInt32 clumpID; // only valid if kAudioUnitParameterFlag_HasClump CFStringRef cfNameString; // only valid if kAudioUnitParameterFlag_HasCFNameString #else char name[64]; // UTF8 encoded C string #endif AudioUnitParameterUnit unit; Float32 minValue; Float32 maxValue; Float32 defaultValue; UInt32 flags; } AudioUnitParameterInfo; //delay params // Parameters for the Delay Unit enum { // Global, EqPow Crossfade, 0->100, 50 kDelayParam_WetDryMix = 0, // Global, Secs, 0->2, 1 kDelayParam_DelayTime = 1, // Global, Percent, -100->100, 50 kDelayParam_Feedback = 2, // Global, Hz, 10->(SampleRate/2), 15000 kDelayParam_LopassCutoff = 3 }; #tag EndNote #tag Note, Name = componentcode struct ComponentDescription { OSType componentType; OSType componentSubType; OSType componentManufacturer; unsigned long componentFlags; unsigned long componentFlagsMask; }; //theAIFFExportComponentInstance=OpenDefaultComponent(SAOSTypeToLong("spit"),SAOSTypeToLong("AIFF")) Dim i,osErr As Integer Dim s As String Dim theSpec,sdHandle,resourceBlock As MemoryBlock //Display "SAudioConverter Method: SAConvertMovieToFile" #If TargetMacOS then #If TargetCarbon then Declare Function NewHandleClear Lib "CarbonLib" (byteCount As Integer) As Integer Declare Function MovieExportSetSampleDescription Lib "Apple;Carbon;Multimedia" (ci As Integer, desc As Integer, mediaType As Integer) As Integer Declare Sub SetMovieProgressProc Lib "Apple;Carbon;Multimedia" (theMovie As Integer, p As Integer, refcon As Integer) Declare Function ConvertMovieToFile Lib "Apple;Carbon;Multimedia" (theMovie As Integer, onlyTrack As Integer, outputFile As Ptr, fileType As Integer, creator As Integer, scriptTag As Integer, resID As Ptr, flags As Integer, userComp As Integer) As Integer Declare Sub DisposeHandle Lib "CarbonLib" (h As Integer) #else Declare Function NewHandleClear Lib "InterfaceLib" (byteCount As Integer) As Integer Declare Function MovieExportSetSampleDescription Lib "QuickTimeLib" (ci As Integer, desc As Integer, mediaType As Integer) As Integer Declare Sub SetMovieProgressProc Lib "QuickTimeLib" (theMovie As Integer, p As Integer, refcon As Integer) Declare Function ConvertMovieToFile Lib "QuickTimeLib" (theMovie As Integer, onlyTrack As Integer, outputFile As Ptr, fileType As Integer, creator As Integer, scriptTag As Integer, resID As Ptr, flags As Integer, userComp As Integer) As Integer Declare Sub DisposeHandle Lib "InterfaceLib" (h As Integer) #endif #else Declare Function NewHandleClear Lib "qtmlClient.dll" (byteCount As Integer) As Integer Declare Function MovieExportSetSampleDescription Lib "qtmlClient.dll" (ci As Integer, desc As Integer, mediaType As Integer) As Integer Declare Sub SetMovieProgressProc Lib "qtmlClient.dll" (theMovie As Integer, p As Integer, refcon As Integer) Declare Function ConvertMovieToFile Lib "qtmlClient.dll" (theMovie As Integer, onlyTrack As Integer, outputFile As Ptr, fileType As Integer, creator As Integer, scriptTag As Integer, resID As Ptr, flags As Integer, userComp As Integer) As Integer Declare Sub DisposeHandle Lib "qtmlClient.dll" (h As Integer) #endif sdHandle=NewMemoryBlock(4) resourceBlock=NewMemoryBlock(4) theSpec=NewMemoryBlock(69) theSpec.short(0)=theWAVEFile.MacVRefNum theSpec.Long(2)=theWAVEFile.MacDirID theSpec.PString(6)=theWAVEFile.Name sdHandle.Long(0)=NewHandleClear(36) if sdHandle.Long(0)<>0 then sdHandle.ptr(0).ptr(0).long(0)=36 'long descSize; sdHandle.ptr(0).ptr(0).long(4)=SAOSTypeToLong("NONE")'twos")//("raw ") 'long dataFormat; sdHandle.ptr(0).ptr(0).long(8)=0 'long resvd1; sdHandle.ptr(0).ptr(0).short(12)=0 'short resvd2; sdHandle.ptr(0).ptr(0).short(14)=0 'short dataRefIndex; sdHandle.ptr(0).ptr(0).short(16)=1 'short version; sdHandle.ptr(0).ptr(0).short(18)=0 'short revlevel; sdHandle.ptr(0).ptr(0).long(20)=SAOSTypeToLong("SA") 'long vendor; sdHandle.ptr(0).ptr(0).short(24)=1 'short numChannels; sdHandle.ptr(0).ptr(0).short(26)=16 'short sampleSize; sdHandle.ptr(0).ptr(0).short(28)=0 'short compressionID; sdHandle.ptr(0).ptr(0).short(30)=0 'short packetSize; sdHandle.ptr(0).ptr(0).long(32)=44100*65536 'UnsignedFixed sampleRate; osErr=MovieExportSetSampleDescription(theAIFFExportComponentInstance,sdHandle.Long(0),SAOSTypeToLong("soun")) if osErr<>0 then else SetMovieProgressProc theMovie.Handle,-1,0 'osErr=ConvertMovieToFile(theMovie.Handle,0,theSpec,SAOSTypeToLong("AIFF"),SAOSTypeToLong("TVOD"),0,resourceBlock,0,theAIFFExportComponentInstance) 'osErr=ConvertMovieToFile(theMovie.Handle,0,theSpec,SAOSTypeToLong("AIFF"),SAOSTypeToLong("TVOD"),0,resourceBlock,0,0) osErr=ConvertMovieToFile(theMovie.Handle,0,theSpec,SAOSTypeToLong("sfil"),SAOSTypeToLong("TVOD"),0,resourceBlock,0,theAIFFExportComponentInstance) if osErr<>0 then else DisposeHandle sdHandle.Long(0) end if end if end if Return osErr #tag EndNote #tag Note, Name = constants enum { kAudioUnitComponentType = FOUR_CHAR_CODE('aunt'), kAudioUnitSubType_Output = FOUR_CHAR_CODE('out '), kAudioUnitID_SoundManagerOutput = FOUR_CHAR_CODE('smgr'), kAudioUnitID_HALOutput = FOUR_CHAR_CODE('ahal'), kAudioUnitID_DefaultOutput = FOUR_CHAR_CODE('def '), kAudioUnitSubType_MusicDevice = FOUR_CHAR_CODE('musd'), kAudioUnitID_DLSSynth = FOUR_CHAR_CODE('dls '), kAudioUnitSubType_Encoder = FOUR_CHAR_CODE('aenc'), kAudioUnitSubType_Decoder = FOUR_CHAR_CODE('adec'), kAudioUnitSubType_BitDepthConverter = FOUR_CHAR_CODE('bdcv'), kAudioUnitSubType_SampleRateConverter = FOUR_CHAR_CODE('srcv'), kAudioUnitID_PolyphaseSRC = FOUR_CHAR_CODE('poly'), kAudioUnitSubType_FormatConverter = FOUR_CHAR_CODE('fmtc'), kAudioUnitID_Interleaver = FOUR_CHAR_CODE('inlv'), kAudioUnitID_Deinterleaver = FOUR_CHAR_CODE('dnlv'), kAudioUnitSubType_Effect = FOUR_CHAR_CODE('efct'), kAudioUnitID_MatrixReverb = FOUR_CHAR_CODE('mrev'), kAudioUnitID_Delay = FOUR_CHAR_CODE('dely'), kAudioUnitID_LowPassFilter = FOUR_CHAR_CODE('lpas'), kAudioUnitID_PeakLimiter = FOUR_CHAR_CODE('lmtr'), kAudioUnitSubType_Mixer = FOUR_CHAR_CODE('mixr'), kAudioUnitID_StereoMixer = FOUR_CHAR_CODE('smxr') }; #tag EndNote #tag Note, Name = outline Setting up an Audio Unit Graph When using AUGraph, certain steps need to be followed in order for the graph to function properly. These steps must be followed in this order: • Create the graph. Call NewAUGraph on an AUGraph instance. • Populate the graph. Use AUGraphNewNode and AUGraphNewNodeSubGraph to populate the graph. • Make connections between nodes. AUGraphConnectNodeInput sets up connections between the nodes. Nodes may have multiple inputs and outputs, though sharing an input or output is not allowed. This is otherwise known as “fan in” and “fan out,” and is not allowed in AUGraph. • Open the graph. Up until this point, each node was being used in the abstract AUNode representation. Upon calling AUGraphOpen, each node is instantiated. This allows for properties to be set for each Audio Unit inside of the graph. • Set output sample rates and channel layouts. A common error is for sample rates and channel layouts to be mismatched between nodes. If any format changes occur, it is imperative that sample rates and channel number be set for all Audio Unit outputs prior to initialization • Initialize the graph. Once setup has occurred, AUGraphInitialize may be called. This makes all the connections between the nodes, and initializes all of the Audio Units that are part of a connection. At the least, the output unit is initialized, even if no connections lead to it. • Start the graph. Calling AUGraphStart begins rendering, starting with the output unit and traversing through the graph. #tag EndNote #tag Note, Name = possiblyuseful //audioToolbox.h // this will return the name of a sound bank from a sound bank file extern OSStatus GetNameFromSoundBank(const FSRef *inSoundBankRef, CFStringRef *outName); #tag EndNote #tag Note, Name = prototypes 'extern OSStatus NewAUGraph(AUGraph *outGraph); 'extern OSStatus AUGraphNewNode( 'AUGraph inGraph, 'const ComponentDescription *inDescription, 'UInt32 inClassDataSize, 'const void *inClassData, 'AUNode *outNode '); #tag EndNote #tag Note, Name = simplesynth Defined Data Types Typedefs are used to simplify the declaration of converters and the use of properties in the context of a graph. • typedef SInt32 AUNode • typedef struct OpaqueAUGraph *AUGraph @interface AudioSystem : NSObject { // Audio related AUGraph graph; AUNode synthNode; AUNode filterNode; AUNode outputNode; MusicDeviceInstrumentID channelInstrument[16]; // MIDI related PYMIDIEndpoint* currentMIDIEndpoint; } - (void)setUpAudio; { ComponentDescription description; AudioUnit synthUnit; UInt32 usesReverb; int i; // Create the graph NewAUGraph (&graph); // Open the DLS Synth description.componentType = kAudioUnitComponentType; description.componentSubType = kAudioUnitSubType_MusicDevice; description.componentManufacturer = kAudioUnitID_DLSSynth; description.componentFlags = 0; description.componentFlagsMask = 0; AUGraphNewNode (graph, &description, 0, NULL, &synthNode); for (i = 0; i < 16; i++) channelInstrument[i] = 0; // Open the filter description.componentType = kAudioUnitComponentType; description.componentSubType = kAudioUnitSubType_Effect; description.componentManufacturer = kAudioUnitID_LowPassFilter; description.componentFlags = 0; description.componentFlagsMask = 0; AUGraphNewNode (graph, &description, 0, NULL, &filterNode); // Open the output device description.componentType = kAudioUnitComponentType; description.componentSubType = kAudioUnitSubType_Output; description.componentManufacturer = kAudioUnitID_DefaultOutput; description.componentFlags = 0; description.componentFlagsMask = 0; AUGraphNewNode (graph, &description, 0, NULL, &outputNode); // Connect the devices up AUGraphConnectNodeInput (graph, synthNode, 1, filterNode, 0); AUGraphConnectNodeInput (graph, filterNode, 0, outputNode, 0); AUGraphUpdate (graph, NULL); // Open and initialize the audio units AUGraphOpen (graph); AUGraphInitialize (graph); // Turn off the reverb on the synth AUGraphGetNodeInfo (graph, synthNode, NULL, NULL, NULL, &synthUnit); usesReverb = 0; AudioUnitSetProperty ( synthUnit, kMusicDeviceProperty_UsesInternalReverb, kAudioUnitScope_Global, 0, &usesReverb, sizeof (usesReverb) ); // Start playing AUGraphStart (graph); } #tag EndNote #tag Property, Flags = &h21 Private curChannel As Integer #tag EndProperty #tag Property, Flags = &h21 Private curInstrument As Integer #tag EndProperty #tag Property, Flags = &h21 Private description As memoryBlock #tag EndProperty #tag Property, Flags = &h21 Private filterNode As memoryBlock #tag EndProperty #tag Property, Flags = &h21 Private graph As memoryBlock #tag EndProperty #tag Property, Flags = &h21 Private notesPlaying() As Integer #tag EndProperty #tag Property, Flags = &h21 #tag Note This dictionary keeps tracks of notes started with SMusicDeviceStartNote, and not yet stopped with SMusicDeviceStopNote. key: floating-point Pitch value value: midi pitch (real or fake, as in generated by MusicDeviceStartNote) to specify to stop that note. #tag EndNote Private notesStarted As Dictionary #tag EndProperty #tag Property, Flags = &h21 Private outputNode As memoryBlock #tag EndProperty #tag Property, Flags = &h21 Private pitchesPlaying() As Double #tag EndProperty #tag Property, Flags = &h21 Private synthNode As MemoryBlock #tag EndProperty #tag Constant, Name = CarbonLib, Type = String, Dynamic = False, Default = \"", Scope = Public #Tag Instance, Platform = Mac Mach-O, Language = Default, Definition = \"/System/Library/Frameworks/Carbon.framework/Carbon" #Tag Instance, Platform = Mac Carbon PEF, Language = Default, Definition = \"CarbonLib" #tag EndConstant #tag Constant, Name = kAudioToolboxLib, Type = String, Dynamic = False, Default = \"/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitComponentType, Type = String, Dynamic = False, Default = \"aunt", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitID_DefaultOutput, Type = String, Dynamic = False, Default = \"def ", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitID_Delay, Type = String, Dynamic = False, Default = \"dely", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitID_DLSSynth, Type = String, Dynamic = False, Default = \"dls ", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitID_HALOutput, Type = String, Dynamic = False, Default = \"ahal", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitID_LowPassFilter, Type = String, Dynamic = False, Default = \"lpas", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitID_MatrixReverb, Type = String, Dynamic = False, Default = \"mrev", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitID_SoundManagerOutput, Type = String, Dynamic = False, Default = \"smgr", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitLib, Type = String, Dynamic = False, Default = \"/System/Library/Frameworks/AudioUnit.framework/AudioUnit", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitProperty_3DMixerRenderingFlags, Type = Double, Dynamic = False, Default = \"3003", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitProperty_ParameterInfo, Type = Double, Dynamic = False, Default = \"4", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitProperty_UsesInternalReverb, Type = Integer, Dynamic = False, Default = \"1005", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitScope_Global, Type = Integer, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitScope_Input, Type = Double, Dynamic = False, Default = \"1", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitSubType_Effect, Type = String, Dynamic = False, Default = \"efct", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitSubType_MusicDevice, Type = String, Dynamic = False, Default = \"musd", Scope = Public #tag EndConstant #tag Constant, Name = kAudioUnitSubType_Output, Type = String, Dynamic = False, Default = \"out ", Scope = Public #tag EndConstant #tag Constant, Name = kDelayParam_DelayTime, Type = Integer, Dynamic = False, Default = \"1", Scope = Public #tag EndConstant #tag Constant, Name = kDelayParam_Feedback, Type = Integer, Dynamic = False, Default = \"2", Scope = Public #tag EndConstant #tag Constant, Name = kDelayParam_LopassCutoff, Type = Integer, Dynamic = False, Default = \"3", Scope = Public #tag EndConstant #tag Constant, Name = kDelayParam_WetDryMix, Type = Integer, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Constant, Name = kErr, Type = Boolean, Dynamic = False, Default = \"true", Scope = Public #tag EndConstant #tag Constant, Name = kMusicDeviceProperty_GroupOutputBus, Type = Integer, Dynamic = False, Default = \"1002", Scope = Public #tag EndConstant #tag Constant, Name = kMusicDeviceProperty_InstrumentCount, Type = Integer, Dynamic = False, Default = \"1000", Scope = Public #tag EndConstant #tag Constant, Name = kMusicDeviceProperty_InstrumentName, Type = Integer, Dynamic = False, Default = \"1001", Scope = Public #tag EndConstant #tag Constant, Name = kMusicDeviceProperty_InstrumentNumber, Type = Integer, Dynamic = False, Default = \"1004", Scope = Public #tag EndConstant #tag Constant, Name = kMusicDeviceProperty_SoundBankFSSpec, Type = Integer, Dynamic = False, Default = \"1003", Scope = Public #tag EndConstant #tag Constant, Name = kMusicDeviceProperty_UsesInternalReverb, Type = Integer, Dynamic = False, Default = \"1005", Scope = Public #tag EndConstant #tag Constant, Name = kMusicNoteEvent_UseGroupInstrument, Type = Double, Dynamic = False, Default = \"&hFFFFFFFF", Scope = Protected #tag EndConstant #tag Constant, Name = noErr, Type = Integer, Dynamic = False, Default = \"0", Scope = Public #tag EndConstant #tag Constant, Name = QuickTimeLib, Type = String, Dynamic = False, Default = \"/System/Library/Frameworks/QuickTime.framework/QuickTime", Scope = Public #tag EndConstant #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Music Objects/YNotePlayer/NotePlayerInterface.rbbas
@@ -0,0 +1 @@
+#tag Interface Protected Interface NotePlayerInterface #tag Method, Flags = &h0 Function GetInstrument() As Integer End Function #tag EndMethod #tag Method, Flags = &h0 Sub PlayNote(pitch As Integer, velocity As Integer) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetInstrument(instrument As Integer) End Sub #tag EndMethod #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag EndViewBehavior End Interface #tag EndInterface
View
1 Music Objects/YNotePlayer/YNotePlayerObj.rbbas
@@ -0,0 +1 @@
+#tag Class Protected Class YNotePlayerObj #tag Method, Flags = &h0 Sub Constructor() mImplementor = New CoreAudioNotePlayer Instrument = 0 End Sub #tag EndMethod #tag Method, Flags = &h0 Sub PlayNote(pitch As Integer, velocity As Integer) if not (mImplementor is Nil) then mImplementor.PlayNote pitch, velocity End Sub #tag EndMethod #tag ComputedProperty, Flags = &h0 #tag Getter Get if not (mImplementor is Nil) then return mImplementor.GetInstrument End Get #tag EndGetter #tag Setter Set if not (mImplementor is Nil) then mImplementor.SetInstrument value End Set #tag EndSetter Instrument As Integer #tag EndComputedProperty #tag Property, Flags = &h21 Private mImplementor As NotePlayerInterface #tag EndProperty #tag ViewBehavior #tag ViewProperty Name="Index" Visible=true Group="ID" InitialValue="-2147483648" Type="Integer" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Instrument" Group="Behavior" InitialValue="0" Type="Integer" #tag EndViewProperty #tag ViewProperty Name="Left" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Name" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Super" Visible=true Group="ID" InheritedFrom="Object" #tag EndViewProperty #tag ViewProperty Name="Top" Visible=true Group="Position" InitialValue="0" InheritedFrom="Object" #tag EndViewProperty #tag EndViewBehavior End Class #tag EndClass
View
1 Windows/ACS/WindowACSBasicSequence.rbfrm
@@ -0,0 +1 @@
+#tag Window Begin Window WindowACSBasicSequence BackColor = 16777215 Backdrop = "" CloseButton = True Composite = False Frame = 8 FullScreen = False HasBackColor = False Height = 457 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 600 MaximizeButton = False MaxWidth = 600 MenuBar = "" MenuBarVisible = True MinHeight = 400 MinimizeButton = True MinWidth = 295 Placement = 0 Resizeable = False Title = "Create Basic Sequence Settings" Visible = True Width = 562 Begin GroupBox FirstPitch_GB AutoDeactivate = True Bold = "" Caption = "First Pitch" Enabled = True Height = 100 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 14 Underline = "" Visible = True Width = 255 Begin StaticText FirstPitchHighestOctave_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "FirstPitch_GB" Italic = "" Left = 41 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Text = "Highest Octave" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 46 Underline = "" Visible = True Width = 120 End Begin StaticText FirstPitchLowestOctave_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "FirstPitch_GB" Italic = "" Left = 41 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True Text = "Lowest Octave" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 78 Underline = "" Visible = True Width = 120 End Begin PopupMenu FirstPitchHighestOctave_PM AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "FirstPitch_GB" InitialValue = "" Italic = "" Left = 173 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 46 Underline = "" Visible = True Width = 80 End Begin PopupMenu FirstPitchLowestOctave_PM AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "FirstPitch_GB" InitialValue = "" Italic = "" Left = 173 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 78 Underline = "" Visible = True Width = 80 End End Begin PushButton Create_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Create" Default = True Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 462 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 417 Underline = "" Visible = True Width = 80 End Begin PushButton Cancel_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Cancel" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 370 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 417 Underline = "" Visible = True Width = 80 End Begin GroupBox PitchVariance_GB AutoDeactivate = True Bold = "" Caption = "Pitch Variance" Enabled = True Height = 160 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 126 Underline = "" Visible = True Width = 255 Begin StaticText PitchVarianceHighestOctave_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Italic = "" Left = 41 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Text = "Highest Octave" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 220 Underline = "" Visible = True Width = 120 End Begin PopupMenu PitchVarianceHighestOctave_PM AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" InitialValue = "" Italic = "" Left = 173 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 219 Underline = "" Visible = True Width = 80 End Begin StaticText PitchVarianceLowestOctave_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Italic = "" Left = 41 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True Text = "Lowest Octave" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 251 Underline = "" Visible = True Width = 120 End Begin PopupMenu PitchVarianceLowestOctave_PM AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" InitialValue = "" Italic = "" Left = 173 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 251 Underline = "" Visible = True Width = 80 End Begin StaticText PitchVarianceMaxDown_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Italic = "" Left = 41 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True Text = "Maximum Down" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 187 Underline = "" Visible = True Width = 120 End Begin StaticText PitchVarianceMaxUp_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Italic = "" Left = 41 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True Text = "Maximum Up" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 155 Underline = "" Visible = True Width = 120 End Begin TextField PitchVarianceMaxHi_EF AcceptTabs = "" Alignment = 2 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Italic = "" Left = 193 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "" Multiline = "" Password = "" ReadOnly = True Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= True Styled = "" TabIndex = 6 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 153 Underline = "" UseFocusRing = True Visible = True Width = 40 End Begin TextField PitchVarianceMaxLo_EF AcceptTabs = "" Alignment = 2 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Italic = "" Left = 193 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "" Multiline = "" Password = "" ReadOnly = True Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= True Styled = "" TabIndex = 7 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 186 Underline = "" UseFocusRing = True Visible = True Width = 40 End Begin UpDownArrows PitchVarianceMaxHi_UDA AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Left = 173 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 8 TabPanelIndex = 0 TabStop = True Top = 152 Visible = True Width = 13 End Begin UpDownArrows PitchVarianceMaxLo_UDA AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "PitchVariance_GB" Left = 173 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 9 TabPanelIndex = 0 TabStop = True Top = 184 Visible = True Width = 13 End End Begin PushButton HelpButton AutoDeactivate = True Bold = "" Cancel = "" Caption = "?" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 417 Underline = "" Visible = True Width = 28 End Begin GroupBox LengthVariance_GB AutoDeactivate = True Bold = "" Caption = "Length Variance" Enabled = True Height = 160 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 287 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 126 Underline = "" Visible = True Width = 255 Begin StaticText LengthVarianceLongest_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "LengthVariance_GB" Italic = "" Left = 308 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Text = "Longest Note" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 156 Underline = "" Visible = True Width = 120 End Begin PopupMenu LengthVarianceLongest_PM AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "LengthVariance_GB" InitialValue = "" Italic = "" Left = 440 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 156 Underline = "" Visible = True Width = 80 End Begin StaticText LengthVarianceShortest_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "LengthVariance_GB" Italic = "" Left = 308 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True Text = "Shortest Note" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 188 Underline = "" Visible = True Width = 120 End Begin PopupMenu LengthVarianceShortest_PM AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "LengthVariance_GB" InitialValue = "" Italic = "" Left = 440 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 187 Underline = "" Visible = True Width = 80 End Begin CheckBox LengthVarianceDotted_CB AutoDeactivate = True Bold = "" Caption = "Allow Dotted Values" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "LengthVariance_GB" Italic = "" Left = 350 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 220 Underline = "" Value = "" Visible = True Width = 170 End Begin CheckBox LengthVarianceTriplet_CB AutoDeactivate = True Bold = "" Caption = "Allow Triplet Values" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "LengthVariance_GB" Italic = "" Left = 350 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 251 Underline = "" Value = "" Visible = True Width = 170 End End Begin GroupBox Characteristics_GB AutoDeactivate = True Bold = "" Caption = "Characteristics" Enabled = True Height = 109 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 154 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 6 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 299 Underline = "" Visible = True Width = 255 Begin Slider CharacteristicsWeight_S AutoDeactivate = True Enabled = True Height = 16 HelpTag = "" Index = -2147483648 InitialParent = "Characteristics_GB" Left = 175 LineStep = 1 LiveScroll = True LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Maximum = 1 Minimum = -1 PageStep = 20 Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 342 Value = 0 Visible = True Width = 201 End Begin StaticText CharacteristicsRising_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Characteristics_GB" Italic = "" Left = 175 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True Text = "Rising" TextAlign = 0 TextColor = 0 TextFont = "System" TextSize = 0 Top = 320 Underline = "" Visible = True Width = 95 End Begin StaticText CharacteristicsFalling_ST AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Characteristics_GB" Italic = "" Left = 281 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True Text = "Falling" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 320 Underline = "" Visible = True Width = 95 End Begin TextField CharacteristicsWeight_EF AcceptTabs = "" Alignment = 2 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "Characteristics_GB" Italic = "" Left = 256 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "" Multiline = "" Password = "" ReadOnly = True Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= True Styled = "" TabIndex = 3 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 377 Underline = "" UseFocusRing = True Visible = True Width = 40 End Begin UpDownArrows CharacteristicsWeight_UD AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "Characteristics_GB" Left = 236 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True Top = 377 Visible = True Width = 12 End Begin StaticText StaticText1 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 12 HelpTag = "" Index = -2147483648 InitialParent = "Characteristics_GB" Italic = "" Left = 175 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True Text = "|" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 10 Top = 361 Underline = "" Visible = True Width = 202 End End Begin GroupBox MelodyLength_GB AutoDeactivate = True Bold = "" Caption = "Melody Length" Enabled = True Height = 100 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 287 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 7 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 14 Underline = "" Visible = True Width = 255 Begin RadioButton MelodyLength_Notes_RB AutoDeactivate = True Bold = "" Caption = "Notes" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "MelodyLength_GB" Italic = "" Left = 308 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 46 Underline = "" Value = "" Visible = True Width = 100 End Begin RadioButton MelodyLength_Measures_RB AutoDeactivate = True Bold = "" Caption = "Measures" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "MelodyLength_GB" Italic = "" Left = 308 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 78 Underline = "" Value = "" Visible = True Width = 100 End Begin UpDownArrows MelodyLength_Notes_UDA AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "MelodyLength_GB" Left = 420 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True Top = 43 Visible = True Width = 13 End Begin TextField MelodyLength_Notes_EF AcceptTabs = "" Alignment = 2 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "MelodyLength_GB" Italic = "" Left = 440 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "" Multiline = "" Password = "" ReadOnly = True Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= True Styled = "" TabIndex = 3 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 44 Underline = "" UseFocusRing = True Visible = True Width = 40 End Begin TextField MelodyLength_Measures_EF AcceptTabs = "" Alignment = 2 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "MelodyLength_GB" Italic = "" Left = 440 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "" Multiline = "" Password = "" ReadOnly = True Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= True Styled = "" TabIndex = 4 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 76 Underline = "" UseFocusRing = True Visible = True Width = 40 End Begin UpDownArrows MelodyLength_Measures_UDA AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "MelodyLength_GB" Left = 420 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True Top = 75 Visible = True Width = 13 End End End #tag EndWindow #tag WindowCode #tag Event Sub Open() Open_Initialize_Characteristics Open_Initialize_FirstPitch Open_Initialize_LengthVariance Open_Initialize_MelodyLength Open_Initialize_PitchVariance UpdateWindow End Sub #tag EndEvent #tag Method, Flags = &h21 Private Sub CheckFirstPitchOctaveSelections() if self.FirstPitchHighestOctave_PM.Index > self.FirstPitchLowestOctave_PM.Index then self.FirstPitchHighestOctave_PM.Index = self.FirstPitchLowestOctave_PM.Index end if End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub CheckPitchVarianceOctaveSelections() if self.PitchVarianceHighestOctave_PM.Index > self.PitchVarianceLowestOctave_PM.Index then self.PitchVarianceHighestOctave_PM.Index = self.PitchVarianceLowestOctave_PM.Index end if End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub CreateRandomMelody() ParentWindow.ACS.CreateRandomMelody(_ CharacteristicsWeight, _ LengthVarianceLongest, _ LengthVarianceShortest, _ MelodyLengthNotes, _ LengthAllowTriplet, _ LengthAllowDotted, _ MelodyLengthMeasures, _ MelodyLengthUseNotes, _ PitchVarianceMaxHi, _ PitchVarianceMaxLo, _ PitchVarianceHighestOctave, _ PitchVarianceLowestOctave _ ) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_Characteristics() CharacteristicsWeight_S.Maximum = ParentWindow.ACS.kRandomMelody_WeightMax CharacteristicsWeight_S.Minimum = ParentWindow.ACS.kRandomMelody_WeightMin CharacteristicsWeight_S.Value = 0 CharacteristicsWeight_EF.Text = Str(CharacteristicsWeight_S.Value) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_FirstPitch() FirstPitchHighestOctave_PM.AddRow("C11") FirstPitchHighestOctave_PM.AddRow("C10") FirstPitchHighestOctave_PM.AddRow("C9") FirstPitchHighestOctave_PM.AddRow("C8") FirstPitchHighestOctave_PM.AddRow("C7") FirstPitchHighestOctave_PM.AddRow("C6") FirstPitchHighestOctave_PM.AddRow("C5") FirstPitchHighestOctave_PM.AddRow("C4") FirstPitchHighestOctave_PM.AddRow("C3") FirstPitchHighestOctave_PM.AddRow("C2") FirstPitchHighestOctave_PM.AddRow("C1") FirstPitchHighestOctave_PM.ListIndex = 5 FirstPitchLowestOctave_PM.AddRow("C11") FirstPitchLowestOctave_PM.AddRow("C10") FirstPitchLowestOctave_PM.AddRow("C9") FirstPitchLowestOctave_PM.AddRow("C8") FirstPitchLowestOctave_PM.AddRow("C7") FirstPitchLowestOctave_PM.AddRow("C6") FirstPitchLowestOctave_PM.AddRow("C5") FirstPitchLowestOctave_PM.AddRow("C4") FirstPitchLowestOctave_PM.AddRow("C3") FirstPitchLowestOctave_PM.AddRow("C2") FirstPitchLowestOctave_PM.AddRow("C1") FirstPitchLowestOctave_PM.ListIndex = 6 End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_LengthVariance() LengthVarianceLongest_PM.AddRow("Whole") LengthVarianceLongest_PM.AddRow("1/2") LengthVarianceLongest_PM.AddRow("1/4") LengthVarianceLongest_PM.AddRow("1/8") LengthVarianceLongest_PM.AddRow("1/16") LengthVarianceLongest_PM.AddRow("1/32") LengthVarianceLongest_PM.AddRow("1/64") LengthVarianceLongest_PM.ListIndex = 2 LengthVarianceShortest_PM.AddRow("Whole") LengthVarianceShortest_PM.AddRow("1/2") LengthVarianceShortest_PM.AddRow("1/4") LengthVarianceShortest_PM.AddRow("1/8") LengthVarianceShortest_PM.AddRow("1/16") LengthVarianceShortest_PM.AddRow("1/32") LengthVarianceShortest_PM.AddRow("1/64") LengthVarianceShortest_PM.ListIndex = 4 End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_MelodyLength() MelodyLength_Notes_RB.Value = True MelodyLengthNotes = 8 MelodyLength_Notes_EF.text = str(MelodyLengthNotes) MelodyLength_Measures_RB.Value = False MelodyLengthMeasures = 2 MelodyLength_Measures_EF.text = Str(MelodyLengthMeasures) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_PitchVariance() PitchVarianceHighestOctave_PM.AddRow("C11") PitchVarianceHighestOctave_PM.AddRow("C10") PitchVarianceHighestOctave_PM.AddRow("C9") PitchVarianceHighestOctave_PM.AddRow("C8") PitchVarianceHighestOctave_PM.AddRow("C7") PitchVarianceHighestOctave_PM.AddRow("C6") PitchVarianceHighestOctave_PM.AddRow("C5") PitchVarianceHighestOctave_PM.AddRow("C4") PitchVarianceHighestOctave_PM.AddRow("C3") PitchVarianceHighestOctave_PM.AddRow("C2") PitchVarianceHighestOctave_PM.AddRow("C1") PitchVarianceHighestOctave_PM.ListIndex = 5 PitchVarianceLowestOctave_PM.AddRow("C11") PitchVarianceLowestOctave_PM.AddRow("C10") PitchVarianceLowestOctave_PM.AddRow("C9") PitchVarianceLowestOctave_PM.AddRow("C8") PitchVarianceLowestOctave_PM.AddRow("C7") PitchVarianceLowestOctave_PM.AddRow("C6") PitchVarianceLowestOctave_PM.AddRow("C5") PitchVarianceLowestOctave_PM.AddRow("C4") PitchVarianceLowestOctave_PM.AddRow("C3") PitchVarianceLowestOctave_PM.AddRow("C2") PitchVarianceLowestOctave_PM.AddRow("C1") PitchVarianceLowestOctave_PM.ListIndex = 6 PitchVarianceMaxHi = 2 PitchVarianceMaxLo = -2 PitchVarianceMaxHi_EF.Text= str(PitchVarianceMaxHi) PitchVarianceMaxLo_EF.Text = str(PitchVarianceMaxLo) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetControls() if Ubound(ParentWindow.NoteMgr.Selection) <> -1 then FirstPitch_GB.Caption = FirstPitch_GB.Caption + " (Already selected)" FirstPitch_GB.Enabled = False end if return End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub UpdateWindow() CharacteristicsWeight_EF.Text = Str(CharacteristicsWeight) PitchVarianceMaxHi_EF.Text = Str(PitchVarianceMaxHi) PitchVarianceMaxLo_EF.Text = Str(PitchVarianceMaxLo) MelodyLength_Measures_EF.text = Str(MelodyLengthMeasures) MelodyLength_Notes_EF.text = Str(MelodyLengthNotes) self.Refresh End Sub #tag EndMethod #tag Property, Flags = &h21 Private CharacteristicsWeight As Integer = 0 #tag EndProperty #tag Property, Flags = &h21 Private FirstPitchHighestOctave As Octave #tag EndProperty #tag Property, Flags = &h21 Private FirstPitchLowestOctave As Octave #tag EndProperty #tag Property, Flags = &h21 Private LengthAllowDotted As Boolean #tag EndProperty #tag Property, Flags = &h21 Private LengthAllowTriplet As Boolean #tag EndProperty #tag Property, Flags = &h21 Private LengthVarianceLongest As NoteLength #tag EndProperty #tag Property, Flags = &h21 Private LengthVarianceShortest As NoteLength #tag EndProperty #tag ComputedProperty, Flags = &h21 #tag Getter Get return mMelodylengthmeasures End Get #tag EndGetter #tag Setter Set dim parsedValue as Integer = value if value < ParentWindow.ACS.kRandomMelody_MinLength then parsedValue = ParentWindow.ACS.kRandomMelody_MinLength end if if value > ParentWindow.ACS.kRandomMelody_MaxMeasures then parsedValue = ParentWindow.ACS.kRandomMelody_MaxMeasures end if mMelodylengthmeasures = parsedValue End Set #tag EndSetter Private MelodyLengthMeasures As Integer #tag EndComputedProperty #tag ComputedProperty, Flags = &h21 #tag Getter Get return mMelodylengthnotes End Get #tag EndGetter #tag Setter Set dim parsedValue as Integer = value if value < ParentWindow.ACS.kRandomMelody_MinLength then parsedValue = ParentWindow.ACS.kRandomMelody_MinLength end if if value > ParentWindow.ACS.kRandomMelody_MaxNotes then parsedValue = ParentWindow.ACS.kRandomMelody_MaxNotes end if mMelodylengthnotes = parsedValue End Set #tag EndSetter Private MelodyLengthNotes As Integer #tag EndComputedProperty #tag Property, Flags = &h21 Private MelodyLengthUseNotes As Boolean = False #tag EndProperty #tag Property, Flags = &h21 Private mMelodylengthmeasures As Integer #tag EndProperty #tag Property, Flags = &h21 Private mMelodylengthnotes As Integer #tag EndProperty #tag Property, Flags = &h21 Private mPitchvariancemaxhi As Integer #tag EndProperty #tag Property, Flags = &h21 Private mPitchvariancemaxlo As Integer #tag EndProperty #tag Property, Flags = &h0 ParentWindow As WindowEditor #tag EndProperty #tag Property, Flags = &h21 Private PitchVarianceHighestOctave As Octave #tag EndProperty #tag Property, Flags = &h21 Private PitchVarianceLowestOctave As Octave #tag EndProperty #tag ComputedProperty, Flags = &h21 #tag Getter Get return mPitchvariancemaxhi End Get #tag EndGetter #tag Setter Set dim parsedValue as Integer = value if value < ParentWindow.ACS.kRandomMelody_PitchVarianceMinHi then parsedValue = ParentWindow.ACS.kRandomMelody_PitchVarianceMinHi end if if value > ParentWindow.ACS.kRandomMelody_PitchVarianceMaxHi then parsedValue = ParentWindow.ACS.kRandomMelody_PitchVarianceMaxHi end if mPitchvariancemaxhi = parsedValue End Set #tag EndSetter Private PitchVarianceMaxHi As Integer #tag EndComputedProperty #tag ComputedProperty, Flags = &h21 #tag Getter Get return mPitchvariancemaxlo End Get #tag EndGetter #tag Setter Set dim parsedValue as Integer = value if value > ParentWindow.ACS.kRandomMelody_PitchVarianceMinLo then parsedValue = ParentWindow.ACS.kRandomMelody_PitchVarianceMinLo end if if value < ParentWindow.ACS.kRandomMelody_PitchVarianceMaxLo then parsedValue = ParentWindow.ACS.kRandomMelody_PitchVarianceMaxLo end if mPitchvariancemaxlo = parsedValue End Set #tag EndSetter Private PitchVarianceMaxLo As Integer #tag EndComputedProperty #tag EndWindowCode #tag Events FirstPitchHighestOctave_PM #tag Event Sub Change() Select Case me.ListIndex Case 0'("C11") FirstPitchHighestOctave = MusicLib.Octave.C11 Case 1'("C10") FirstPitchHighestOctave = MusicLib.Octave.C10 Case 2'("C9") FirstPitchHighestOctave = MusicLib.Octave.C9 Case 3'("C8") FirstPitchHighestOctave = MusicLib.Octave.C8 Case 4'("C7") FirstPitchHighestOctave = MusicLib.Octave.C7 Case 5'("C6") FirstPitchHighestOctave = MusicLib.Octave.C6 Case 6'("C5") FirstPitchHighestOctave = MusicLib.Octave.C5 Case 7'("C4") FirstPitchHighestOctave = MusicLib.Octave.C4 Case 8'("C3") FirstPitchHighestOctave = MusicLib.Octave.C3 Case 9'("C2") FirstPitchHighestOctave = MusicLib.Octave.C2 Case 10'("C1") FirstPitchHighestOctave = MusicLib.Octave.C1 Else FirstPitchHighestOctave = MusicLib.Octave.C11 End Select CheckFirstPitchOctaveSelections End Sub #tag EndEvent #tag EndEvents #tag Events FirstPitchLowestOctave_PM #tag Event Sub Change() Select Case me.ListIndex Case 0'("C11") FirstPitchLowestOctave = MusicLib.Octave.C11 Case 1'("C10") FirstPitchLowestOctave = MusicLib.Octave.C10 Case 2'("C9") FirstPitchLowestOctave = MusicLib.Octave.C9 Case 3'("C8") FirstPitchLowestOctave = MusicLib.Octave.C8 Case 4'("C7") FirstPitchLowestOctave = MusicLib.Octave.C7 Case 5'("C6") FirstPitchLowestOctave = MusicLib.Octave.C6 Case 6'("C5") FirstPitchLowestOctave = MusicLib.Octave.C5 Case 7'("C4") FirstPitchLowestOctave = MusicLib.Octave.C4 Case 8'("C3") FirstPitchLowestOctave = MusicLib.Octave.C3 Case 9'("C2") FirstPitchLowestOctave = MusicLib.Octave.C2 Case 10'("C1") FirstPitchLowestOctave = MusicLib.Octave.C1 Else FirstPitchLowestOctave = MusicLib.Octave.C11 End Select CheckFirstPitchOctaveSelections End Sub #tag EndEvent #tag EndEvents #tag Events Create_PB #tag Event Sub Action() CreateRandomMelody End Sub #tag EndEvent #tag EndEvents #tag Events Cancel_PB #tag Event Sub Action() self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents #tag Events PitchVarianceHighestOctave_PM #tag Event Sub Change() Select Case me.ListIndex Case 0'("C11") FirstPitchHighestOctave = MusicLib.Octave.C11 Case 1'("C10") FirstPitchHighestOctave = MusicLib.Octave.C10 Case 2'("C9") FirstPitchHighestOctave = MusicLib.Octave.C9 Case 3'("C8") FirstPitchHighestOctave = MusicLib.Octave.C8 Case 4'("C7") FirstPitchHighestOctave = MusicLib.Octave.C7 Case 5'("C6") FirstPitchHighestOctave = MusicLib.Octave.C6 Case 6'("C5") FirstPitchHighestOctave = MusicLib.Octave.C5 Case 7'("C4") FirstPitchHighestOctave = MusicLib.Octave.C4 Case 8'("C3") FirstPitchHighestOctave = MusicLib.Octave.C3 Case 9'("C2") FirstPitchHighestOctave = MusicLib.Octave.C2 Case 10'("C1") FirstPitchHighestOctave = MusicLib.Octave.C1 Else FirstPitchHighestOctave = MusicLib.Octave.C11 End Select CheckPitchVarianceOctaveSelections End Sub #tag EndEvent #tag EndEvents #tag Events PitchVarianceLowestOctave_PM #tag Event Sub Change() Select Case me.ListIndex Case 0'("C11") FirstPitchHighestOctave = MusicLib.Octave.C11 Case 1'("C10") FirstPitchHighestOctave = MusicLib.Octave.C10 Case 2'("C9") FirstPitchHighestOctave = MusicLib.Octave.C9 Case 3'("C8") FirstPitchHighestOctave = MusicLib.Octave.C8 Case 4'("C7") FirstPitchHighestOctave = MusicLib.Octave.C7 Case 5'("C6") FirstPitchHighestOctave = MusicLib.Octave.C6 Case 6'("C5") FirstPitchHighestOctave = MusicLib.Octave.C5 Case 7'("C4") FirstPitchHighestOctave = MusicLib.Octave.C4 Case 8'("C3") FirstPitchHighestOctave = MusicLib.Octave.C3 Case 9'("C2") FirstPitchHighestOctave = MusicLib.Octave.C2 Case 10'("C1") FirstPitchHighestOctave = MusicLib.Octave.C1 Else FirstPitchHighestOctave = MusicLib.Octave.C11 End Select CheckPitchVarianceOctaveSelections End Sub #tag EndEvent #tag EndEvents #tag Events PitchVarianceMaxHi_UDA #tag Event Sub Down() PitchVarianceMaxHi = PitchVarianceMaxHi - 1 UpdateWindow End Sub #tag EndEvent #tag Event Sub Up() PitchVarianceMaxHi = PitchVarianceMaxHi + 1 UpdateWindow End Sub #tag EndEvent #tag EndEvents #tag Events PitchVarianceMaxLo_UDA #tag Event Sub Down() PitchVarianceMaxLo = PitchVarianceMaxLo - 1 UpdateWindow End Sub #tag EndEvent #tag Event Sub Up() PitchVarianceMaxLo = PitchVarianceMaxLo + 1 UpdateWindow End Sub #tag EndEvent #tag EndEvents #tag Events HelpButton #tag Event Sub Action() //this will show the UniHelp page for information on how to use this window End Sub #tag EndEvent #tag EndEvents #tag Events LengthVarianceDotted_CB #tag Event Sub Action() LengthAllowDotted = me.Value End Sub #tag EndEvent #tag EndEvents #tag Events LengthVarianceTriplet_CB #tag Event Sub Action() LengthAllowTriplet = me.Value End Sub #tag EndEvent #tag EndEvents #tag Events CharacteristicsWeight_S #tag Event Sub ValueChanged() CharacteristicsWeight = me.Value UpdateWindow End Sub #tag EndEvent #tag EndEvents #tag Events CharacteristicsWeight_UD #tag Event Sub Down() CharacteristicsWeight_S.Value = CharacteristicsWeight_S.Value - 1 End Sub #tag EndEvent #tag Event Sub Up() CharacteristicsWeight_S.Value = CharacteristicsWeight_S.Value + 1 End Sub #tag EndEvent #tag EndEvents #tag Events MelodyLength_Notes_RB #tag Event Sub Action() if me.Value = true then MelodyLengthUseNotes = true MelodyLength_Notes_UDA.Enabled = true MelodyLength_Notes_EF.Enabled = true else MelodyLengthUseNotes = False MelodyLength_Notes_UDA.Enabled = false MelodyLength_Notes_EF.Enabled = false end if End Sub #tag EndEvent #tag EndEvents #tag Events MelodyLength_Measures_RB #tag Event Sub Action() if me.Value = true then MelodyLengthUseNotes = false MelodyLength_Measures_UDA.Enabled = true MelodyLength_Measures_EF.Enabled = true else MelodyLengthUseNotes = true MelodyLength_Measures_UDA.Enabled = false MelodyLength_Measures_EF.Enabled = false end if End Sub #tag EndEvent #tag EndEvents #tag Events MelodyLength_Notes_UDA #tag Event Sub Down() MelodyLengthNotes = MelodyLengthNotes - 1 UpdateWindow End Sub #tag EndEvent #tag Event Sub Up() MelodyLengthNotes = MelodyLengthNotes + 1 UpdateWindow End Sub #tag EndEvent #tag EndEvents #tag Events MelodyLength_Measures_UDA #tag Event Sub Up() MelodyLengthMeasures = MelodyLengthMeasures + 1 UpdateWindow End Sub #tag EndEvent #tag Event Sub Down() MelodyLengthMeasures = MelodyLengthMeasures - 1 UpdateWindow End Sub #tag EndEvent #tag EndEvents
View
1 Windows/ACS/WindowACSProgress.rbfrm
@@ -0,0 +1 @@
+#tag Window Begin Window WindowACSProgress BackColor = 16777215 Backdrop = "" CloseButton = True Composite = False Frame = 8 FullScreen = False HasBackColor = False Height = 88 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 32000 MaximizeButton = False MaxWidth = 32000 MenuBar = "" MenuBarVisible = True MinHeight = 64 MinimizeButton = True MinWidth = 64 Placement = 0 Resizeable = False Title = "Calculating Music..." Visible = True Width = 480 Begin ProgressBar ProgressBar1 AutoDeactivate = True Enabled = True Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 20 LockBottom = False LockedInPosition= False LockLeft = True LockRight = False LockTop = True Maximum = 100 Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 46 Value = 0 Visible = True Width = 440 End Begin StaticText StaticText1 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Text = "Calculating Music..." TextAlign = 0 TextColor = 0 TextFont = "System" TextSize = 0 Top = 14 Underline = "" Visible = True Width = 440 End End #tag EndWindow #tag WindowCode #tag Method, Flags = &h0 Sub IncrementProgressBar(stepValue as integer) ProgressBar1.Value = ProgressBar1.Value + stepValue self.Refresh End Sub #tag EndMethod #tag EndWindowCode
View
1 Windows/SplashWindow.rbfrm
@@ -0,0 +1 @@
+#tag Window Begin Window SplashWindow BackColor = 16777215 Backdrop = "" BalloonHelp = "" CloseButton = True Composite = False Frame = 4 FullScreen = False HasBackColor = False Height = 300 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 32000 MaximizeButton = False MaxWidth = 32000 MenuBar = "" MenuBarVisible = True MinHeight = 64 MinimizeButton = True MinWidth = 64 Placement = 0 Resizeable = False Title = "MusicSketch" Visible = True Width = 600 Begin SplashCanvas SplashCanvas1 AcceptFocus = "" AcceptTabs = "" AutoDeactivate = True Backdrop = "" Enabled = True EraseBackground = True Height = 300 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = True Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 0 UseFocusRing = True Visible = True Width = 600 End End #tag EndWindow #tag WindowCode #tag EndWindowCode #tag Events SplashCanvas1 #tag Event Sub MouseUp(X As Integer, Y As Integer) if App.Opening = false then WindowMgr.CurrentEditor.Show self.Close end if End Sub #tag EndEvent #tag EndEvents
View
1 Windows/WindowChangeKey.rbfrm
@@ -0,0 +1 @@
+#tag Window Begin Window WindowChangeKey BackColor = 16777215 Backdrop = "" BalloonHelp = "" CloseButton = True Composite = False Frame = 8 FullScreen = False HasBackColor = False Height = 200 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 200 MaximizeButton = False MaxWidth = 400 MenuBar = "" MenuBarVisible = True MinHeight = 200 MinimizeButton = True MinWidth = 400 Placement = 0 Resizeable = False Title = "Change Key" Visible = True Width = 400 Begin StaticText ST_Key AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Text = "Key" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 14 Underline = "" Visible = True Width = 100 End Begin PopupMenu PM_Key AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" InitialValue = "" Italic = "" Left = 132 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 13 Underline = "" Visible = True Width = 80 End Begin PushButton Cancel_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Cancel" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 208 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 160 Underline = "" Visible = True Width = 80 End Begin PushButton OK_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "OK" Default = True Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 300 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 160 Underline = "" Visible = True Width = 80 End Begin StaticText ST_Type AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True Text = "Type" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 45 Underline = "" Visible = True Width = 100 End Begin PopupMenu PM_Type AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" InitialValue = "" Italic = "" Left = 132 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 44 Underline = "" Visible = True Width = 156 End End #tag EndWindow #tag WindowCode #tag Method, Flags = &h0 Sub ChangeKey() dim settings as integer settings = &h00000000 //this is probably unecessary Select Case PM_Key.ListIndex Case 0'"C" settings = DataLib.SetFlag(DataLib.kFlagKeyType_C, settings) Case 1'"C#/Db" settings = DataLib.SetFlag(DataLib.kFlagKeyType_CsharpDflat, settings) Case 2'"D" settings = DataLib.SetFlag(DataLib.kFlagKeyType_D, settings) Case 3'"D#/Eb" settings = DataLib.SetFlag(DataLib.kFlagKeyType_DsharpEflat, settings) Case 4'"E" settings = DataLib.SetFlag(DataLib.kFlagKeyType_E, settings) Case 5'"F" settings = DataLib.SetFlag(DataLib.kFlagKeyType_F, settings) Case 6'"F#/Gb" settings = DataLib.SetFlag(DataLib.kFlagKeyType_FsharpGflat, settings) Case 7'"G" settings = DataLib.SetFlag(DataLib.kFlagKeyType_G, settings) Case 8'"G#/Ab" settings = DataLib.SetFlag(DataLib.kFlagKeyType_GsharpAFlat, settings) Case 9'"A" settings = DataLib.SetFlag(DataLib.kFlagKeyType_A, settings) Case 10'"A#/Bb" settings = DataLib.SetFlag(DataLib.kFlagKeyType_AsharpBflat, settings) Case 11'"B" settings = DataLib.SetFlag(DataLib.kFlagKeyType_B, settings) End Select Select Case PM_Type.ListIndex Case 0 '"Major") settings = DataLib.SetFlag(DataLib.kFlagKeyMod_Major, settings) Case 1 'Separator Case 2 '"Minor") settings = DataLib.SetFlag(DataLib.kFlagKeyMod_Minor, settings) Case 3 '"Harmonic Minor") settings = DataLib.SetFlag(DataLib.kFlagKeyMod_MinorHarmonic, settings) Case 4 '"Melodic Minor") settings = DataLib.SetFlag(DataLib.kFlagKeyMod_MinorMelodic, settings) Case 5 'Separator Case 6 '"Pentatonic Major") settings = DataLib.SetFlag(DataLib.kFlagKeyMod_PentatonicMajor, settings) Case 7 '"Pentatonic Minor") settings = DataLib.SetFlag(DataLib.kFlagKeyMod_PentatonicMinor, settings) End Select ParentWindow.EditMgr.ChangeKey(Settings) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub GetKey(Key As KeyObj) if DataLib.GetFlag(DataLib.kFlagKeyType_C, Key.Settings) then self.PM_Key.ListIndex = 0 if DataLib.GetFlag(DataLib.kFlagKeyType_CsharpDflat, Key.Settings) then self.PM_Key.ListIndex = 1 if DataLib.GetFlag(DataLib.kFlagKeyType_D, Key.Settings) then self.PM_Key.ListIndex = 2 if DataLib.GetFlag(DataLib.kFlagKeyType_DsharpEflat, Key.Settings) then self.PM_Key.ListIndex = 3 if DataLib.GetFlag(DataLib.kFlagKeyType_E, Key.Settings) then self.PM_Key.ListIndex = 4 if DataLib.GetFlag(DataLib.kFlagKeyType_F, Key.Settings) then self.PM_Key.ListIndex = 5 if DataLib.GetFlag(DataLib.kFlagKeyType_FsharpGflat, Key.Settings) then self.PM_Key.ListIndex = 6 if DataLib.GetFlag(DataLib.kFlagKeyType_G, Key.Settings) then self.PM_Key.ListIndex = 7 if DataLib.GetFlag(DataLib.kFlagKeyType_GsharpAFlat, Key.Settings) then self.PM_Key.ListIndex = 8 if DataLib.GetFlag(DataLib.kFlagKeyType_A, Key.Settings) then self.PM_Key.ListIndex = 9 if DataLib.GetFlag(DataLib.kFlagKeyType_AsharpBflat, Key.Settings) then self.PM_Key.ListIndex = 10 if DataLib.GetFlag(DataLib.kFlagKeyType_B, Key.Settings) then self.PM_Key.ListIndex = 11 if DataLib.GetFlag(DataLib.kFlagKeyMod_Major, Key.Settings) then self.PM_Type.ListIndex = 0 if DataLib.GetFlag(DataLib.kFlagKeyMod_Minor, Key.Settings) then self.PM_Type.ListIndex = 2 if DataLib.GetFlag(DataLib.kFlagKeyMod_MinorHarmonic, Key.Settings) then self.PM_Type.ListIndex = 3 if DataLib.GetFlag(DataLib.kFlagKeyMod_MinorMelodic, Key.Settings) then self.PM_Type.ListIndex = 4 if DataLib.GetFlag(DataLib.kFlagKeyMod_PentatonicMajor, Key.Settings) then self.PM_Type.ListIndex = 6 if DataLib.GetFlag(DataLib.kFlagKeyMod_PentatonicMinor, Key.Settings) then self.PM_Type.ListIndex = 7 End Sub #tag EndMethod #tag Property, Flags = &h0 ParentWindow As WindowEditor #tag EndProperty #tag EndWindowCode #tag Events PM_Key #tag Event Sub Open() me.AddRow("C") me.AddRow("C#/Db") me.AddRow("D") me.AddRow("D#/Eb") me.AddRow("E") me.AddRow("F") me.AddRow("F#/Gb") me.AddRow("G") me.AddRow("G#/Ab") me.AddRow("A") me.AddRow("A#/Bb") me.AddRow("B") me.ListIndex = 0 End Sub #tag EndEvent #tag EndEvents #tag Events Cancel_PB #tag Event Sub Action() self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents #tag Events OK_PB #tag Event Sub Action() ChangeKey self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents #tag Events PM_Type #tag Event Sub Open() me.AddRow("Major") me.AddSeparator me.AddRow("Minor") me.AddRow("Harmonic Minor") me.AddRow("Melodic Minor") 'me.AddSeparator 'me.AddRow("Pentatonic Major") 'me.AddRow("Pentatonic Minor") Me.ListIndex = 0 End Sub #tag EndEvent #tag EndEvents
View
1 Windows/WindowEditNote.rbfrm
@@ -0,0 +1 @@
+#tag Window Begin Window WindowEditNote BackColor = 16777215 Backdrop = "" BalloonHelp = "" CloseButton = True Composite = False Frame = 8 FullScreen = False HasBackColor = False Height = 352 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 1000 MaximizeButton = False MaxWidth = 1000 MenuBar = "" MenuBarVisible = True MinHeight = 100 MinimizeButton = True MinWidth = 532 Placement = 0 Resizeable = False Title = "Edit Notes" Visible = True Width = 532 Begin GroupBox Length_GroupBox AutoDeactivate = True Bold = "" Caption = "Length" Enabled = True Height = 137 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 163 Underline = "" Visible = True Width = 492 Begin PopupMenu Length_Set_PM AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" InitialValue = "" Italic = "" Left = 41 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 188 Underline = "" Visible = True Width = 150 End Begin Separator Separator2 AutoDeactivate = True Enabled = True Height = 4 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Left = 34 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True Top = 221 Visible = True Width = 464 End Begin Slider Length_Scale_Slider AutoDeactivate = True Enabled = True Height = 16 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Left = 129 LineStep = 1 LiveScroll = True LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Maximum = 200 Minimum = 25 PageStep = 20 Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True Top = 243 Value = 100 Visible = True Width = 255 End Begin StaticText ST_Length_Scale_100 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 220 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True Text = "|" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 271 Underline = "" Visible = True Width = 40 End Begin StaticText ST_Length_Scale_200 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 356 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True Text = "200%" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 271 Underline = "" Visible = True Width = 60 End Begin StaticText ST_Length_Scale_25 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 114 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True Text = "25%" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 271 Underline = "" Visible = True Width = 36 End Begin TextField Length_Scale_EF AcceptTabs = "" Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 41 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "###" Multiline = "" Password = "" ReadOnly = "" Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= False Styled = "" TabIndex = 6 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 237 Underline = "" UseFocusRing = True Visible = True Width = 48 End Begin UpDownArrows Length_Scale_Arrows AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Left = 94 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 7 TabPanelIndex = 0 TabStop = True Top = 237 Visible = True Width = 13 End Begin StaticText ST_Length_Scale_50 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 155 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 8 TabPanelIndex = 0 TabStop = True Text = "50%" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 271 Underline = "" Visible = True Width = 36 End Begin StaticText ST_Length_Scale_150 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 287 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 9 TabPanelIndex = 0 TabStop = True Text = "150%" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 271 Underline = "" Visible = True Width = 40 End Begin CheckBox Length_Scale_Tempo AutoDeactivate = True Bold = "" Caption = "Group" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 418 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 State = 0 TabIndex = 10 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 237 Underline = "" Value = False Visible = True Width = 76 End Begin PushButton Length_Set_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Apply" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 418 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 11 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 189 Underline = "" Visible = True Width = 80 End Begin PushButton Length_Scale_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Apply" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Length_GroupBox" Italic = "" Left = 418 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 12 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 269 Underline = "" Visible = True Width = 80 End End Begin GroupBox Velocity_GroupBox AutoDeactivate = True Bold = False Caption = "Velocity" Enabled = True Height = 137 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 14 Underline = "" Visible = True Width = 492 Begin Slider Velocity_Set_Slider AutoDeactivate = True Enabled = True Height = 16 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Left = 159 LineStep = 1 LiveScroll = True LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Maximum = 127 Minimum = 0 PageStep = 20 Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 48 Value = 0 Visible = True Width = 127 End Begin TextField Velocity_Set_EF AcceptTabs = "" Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 34 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "###" Multiline = "" Password = "" ReadOnly = "" Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= False Styled = "" TabIndex = 1 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 43 Underline = "" UseFocusRing = True Visible = True Width = 48 End Begin StaticText ST_Velocity_Set_0 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 127 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True Text = 0 TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 Top = 44 Underline = "" Visible = True Width = 20 End Begin StaticText ST_Velocity_Set_127 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 298 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True Text = 127 TextAlign = 0 TextColor = 0 TextFont = "System" TextSize = 0 Top = 44 Underline = "" Visible = True Width = 30 End Begin UpDownArrows Velocity_Set_Arrows AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Left = 86 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True Top = 42 Visible = True Width = 13 End Begin Separator Separator1 AutoDeactivate = True Enabled = True Height = 1 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Left = 34 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True Top = 75 Visible = True Width = 464 End Begin Slider Velocity_Mod_Slider AutoDeactivate = True Enabled = True Height = 16 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Left = 127 LineStep = 1 LiveScroll = True LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Maximum = 127 Minimum = -127 PageStep = 20 Scope = 0 TabIndex = 6 TabPanelIndex = 0 TabStop = True Top = 94 Value = 0 Visible = True Width = 255 End Begin StaticText ST_Velocity_Mod_0 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 246 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 7 TabPanelIndex = 0 TabStop = True Text = 0 TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 122 Underline = "" Visible = True Width = 20 End Begin StaticText ST_Velocity_Mod_127 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 367 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 8 TabPanelIndex = 0 TabStop = True Text = 127 TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 122 Underline = "" Visible = True Width = 30 End Begin StaticText ST_Velocity_Mod_n127 AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 112 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 9 TabPanelIndex = 0 TabStop = True Text = -127 TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 122 Underline = "" Visible = True Width = 36 End Begin TextField Velocity_Mod_EF AcceptTabs = "" Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 34 LimitText = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Mask = "###" Multiline = "" Password = "" ReadOnly = "" Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= False Styled = "" TabIndex = 10 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 0 Top = 88 Underline = "" UseFocusRing = True Visible = True Width = 48 End Begin UpDownArrows Velocity_Mod_Arrows1 AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Left = 87 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 11 TabPanelIndex = 0 TabStop = True Top = 87 Visible = True Width = 13 End Begin PushButton Velocity_Set_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Apply" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 418 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 12 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 42 Underline = "" Visible = True Width = 80 End Begin PushButton Velocity_Mod_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Apply" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "Velocity_GroupBox" Italic = "" Left = 418 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 13 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 122 Underline = "" Visible = True Width = 80 End End Begin PushButton PB_Cancel AutoDeactivate = True Bold = "" Cancel = "" Caption = "Cancel" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 418 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 312 Underline = "" Visible = True Width = 80 End End #tag EndWindow #tag WindowCode #tag Event Sub Close() me.Close ParentWindow.Show End Sub #tag EndEvent #tag Event Sub Open() Velocity_Set_EF.Text = Str(Velocity_Set_Slider.Value) Velocity_Mod_EF.Text = Str(Velocity_Mod_Slider.Value) Length_Scale_EF.Text = Str(Length_Scale_Slider.Value) + "%" Length_Scale_Slider.Minimum = 25 Length_Scale_Slider.Maximum = 200 Length_Scale_Slider.Value = 100 Length_Set_PM.AddRow("Whole") Length_Set_PM.AddRow("1/2") Length_Set_PM.AddRow("1/2 (Dotted)") Length_Set_PM.AddRow("1/4") Length_Set_PM.AddRow("1/4 (Dotted)") Length_Set_PM.AddRow("1/8") Length_Set_PM.AddRow("1/8 (Dotted)") Length_Set_PM.AddRow("1/16") Length_Set_PM.AddRow("1/16 (Dotted)") Length_Set_PM.AddRow("1/32") Length_Set_PM.AddRow("1/32 (Dotted)") Length_Set_PM.AddRow("1/64") 'Length_Set_PM.AddRow("Other Value") Velocity_Mod_Slider.Minimum = -127 Velocity_Mod_Slider.Maximum = 127 Velocity_Mod_Slider.Value = 0 Velocity_Set_Slider.Minimum = 0 Velocity_Set_Slider.Maximum = MIDILib.kMIDIVelocityMax End Sub #tag EndEvent #tag Method, Flags = &h0 Sub SetControls() //here we get the information for the first object in the selection and set the controls based on that. if Ubound(ParentWindow.NoteMgr.Selection) = -1 then return dim note as NoteObj dim chord as ChordObj dim length as integer if ParentWindow.NoteMgr.Selection(0) IsA NoteObj then note = ParentWindow.NoteMgr.Selection(0) length = note.Length elseif ParentWindow.NoteMgr.Selection(0) IsA ChordObj then chord = ParentWindow.NoteMgr.Selection(0) length = chord.Length end if select case length case MIDILib.kNoteLength_01 Length_Set_PM.ListIndex = 0 case MIDILib.kNoteLength_02 Length_Set_PM.ListIndex = 1 case MIDILib.kNoteLength_02 + MIDILib.kNoteLength_04 Length_Set_PM.ListIndex = 2 case MIDILib.kNoteLength_04 Length_Set_PM.ListIndex = 3 case MIDILib.kNoteLength_04 + MIDILib.kNoteLength_08 Length_Set_PM.ListIndex = 4 case MIDILib.kNoteLength_08 Length_Set_PM.ListIndex = 5 case MIDILib.kNoteLength_08 + MIDILib.kNoteLength_16 Length_Set_PM.ListIndex = 6 case MIDILib.kNoteLength_16 Length_Set_PM.ListIndex = 7 case MIDILib.kNoteLength_16 + MIDILib.kNoteLength_32 Length_Set_PM.ListIndex = 8 case MIDILib.kNoteLength_32 Length_Set_PM.ListIndex = 9 case MIDILib.kNoteLength_32 + MIDILib.kNoteLength_64 Length_Set_PM.ListIndex = 10 case MIDILib.kNoteLength_64 Length_Set_PM.ListIndex = 11 else Length_Set_PM.ListIndex = 12 end select if ParentWindow.NoteMgr.Selection(0) IsA NoteObj then note = ParentWindow.NoteMgr.Selection(0) Velocity_Set_Slider.Value = note.Velocity elseif ParentWindow.NoteMgr.Selection(0) IsA ChordObj then chord = ParentWindow.NoteMgr.Selection(0) Velocity_Set_Slider.Value = chord.Velocity end if End Sub #tag EndMethod #tag Property, Flags = &h0 ParentWindow As WindowEditor #tag EndProperty #tag EndWindowCode #tag Events Length_Scale_Slider #tag Event Sub ValueChanged() self.Length_Scale_EF.Text = Str(me.Value) + "%" self.Refresh End Sub #tag EndEvent #tag EndEvents #tag Events Length_Scale_Arrows #tag Event Sub Down() Length_Scale_Slider.Value = Length_Scale_Slider.Value - 1 End Sub #tag EndEvent #tag Event Sub Up() Length_Scale_Slider.Value = Length_Scale_Slider.Value + 1 End Sub #tag EndEvent #tag EndEvents #tag Events Length_Set_PB #tag Event Sub Action() dim NewLength as integer Select Case self.Length_Set_PM.ListIndex case 0 //"Whole" NewLength = MIDILib.kNoteLength_01 case 1 //"1/2" NewLength = MIDILib.kNoteLength_02 case 2 //"1/2 (Dotted)" NewLength = MIDILib.kNoteLength_02 + MIDILib.kNoteLength_04 case 3 //"1/4" NewLength = MIDILib.kNoteLength_04 case 4 //"1/4 (Dotted)" NewLength = MIDILib.kNoteLength_04 + MIDILib.kNoteLength_08 case 5 //"1/8" NewLength = MIDILib.kNoteLength_08 case 6 //"1/8 (Dotted)" NewLength = MIDILib.kNoteLength_08 + MIDILib.kNoteLength_16 case 7 //"1/16" NewLength = MIDILib.kNoteLength_16 case 8 //"1/16 (Dotted)" NewLength = MIDILib.kNoteLength_16 + MIDILib.kNoteLength_32 case 9 //"1/32" NewLength = MIDILib.kNoteLength_32 case 10 //"1/32 (Dotted)" NewLength = MIDILib.kNoteLength_32 + MIDILib.kNoteLength_64 case 11 //"1/64" NewLength = MIDILib.kNoteLength_64 case 12 //"Other Value" end select ParentWindow.EditMgr.SetLength(NewLength) self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents #tag Events Length_Scale_PB #tag Event Sub Action() dim CommandEditScaleLength as CommandEditScaleLengthObj = new CommandEditScaleLengthObj(ParentWindow) ParentWindow.CommandMgr.InvokeCommand(CommandEditScaleLength) ParentWindow.EditMgr.ScaleLength(Length_Scale_Slider.Value) if Length_Scale_Tempo.Value = true then ParentWindow.EditMgr.ScaleStartBeat(Length_Scale_Slider.Value) end if ParentWindow.CommandMgr.InvokePostCommandActions self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents #tag Events Velocity_Set_Slider #tag Event Sub ValueChanged() self.Velocity_Set_EF.Text = Str(me.Value) self.Refresh End Sub #tag EndEvent #tag EndEvents #tag Events Velocity_Set_Arrows #tag Event Sub Down() Velocity_Set_Slider.Value = Velocity_Set_Slider.Value - 1 End Sub #tag EndEvent #tag Event Sub Up() Velocity_Set_Slider.Value = Velocity_Set_Slider.Value + 1 End Sub #tag EndEvent #tag EndEvents #tag Events Velocity_Mod_Slider #tag Event Sub ValueChanged() self.Velocity_Mod_EF.Text = Str(me.Value) self.Refresh End Sub #tag EndEvent #tag EndEvents #tag Events Velocity_Mod_Arrows1 #tag Event Sub Down() Velocity_Mod_Slider.Value = Velocity_Mod_Slider.Value - 1 End Sub #tag EndEvent #tag Event Sub Up() Velocity_Mod_Slider.Value = Velocity_Mod_Slider.Value + 1 End Sub #tag EndEvent #tag EndEvents #tag Events Velocity_Set_PB #tag Event Sub Action() ParentWindow.EditMgr.SetVelocity(Velocity_Set_Slider.Value) self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents #tag Events Velocity_Mod_PB #tag Event Sub Action() ParentWindow.EditMgr.ModifyVelocity(Velocity_Mod_Slider.Value) self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents #tag Events PB_Cancel #tag Event Sub Action() self.Close ParentWindow.Show End Sub #tag EndEvent #tag EndEvents
View
1 Windows/WindowEditor.rbfrm
@@ -0,0 +1 @@
+#tag Window Begin Window WindowEditor BackColor = 16777215 Backdrop = "" BalloonHelp = "" CloseButton = True Composite = False Frame = 0 FullScreen = False HasBackColor = False Height = 640 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 32000 MaximizeButton = True MaxWidth = 32000 MenuBar = 1179086674 MenuBarVisible = True MinHeight = 480 MinimizeButton = True MinWidth = 777 Placement = 0 Resizeable = True Title = "MusicSketch - Main Editor" Visible = True Width = 1280 Begin GUIObj GUIObj1 AcceptFocus = True AcceptTabs = "" AutoDeactivate = True Backdrop = "" DoubleBuffer = False Enabled = True EraseBackground = True Height = 488 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 236 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = True Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 80 UseFocusRing = True Visible = True Width = 1024 End Begin TrackListObj TrackListObj1 AutoDeactivate = True AutoHideScrollbars= True Bold = "" Border = True ColumnCount = 1 ColumnsResizable= "" ColumnWidths = "" DataField = "" DataSource = "" DefaultRowHeight= -1 Enabled = True EnableDrag = False EnableDragReorder= True GridLinesHorizontal= 0 GridLinesVertical= 0 HasHeading = "" HeadingIndex = -1 Height = 488 HelpTag = "" Hierarchical = "" Index = -2147483648 InitialParent = "" InitialValue = "" Italic = "" Left = -1 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = True RequiresSelection= True Scope = 0 ScrollbarHorizontal= True ScrollBarVertical= True SelectionType = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 80 Underline = "" UseFocusRing = True Visible = True Width = 225 _ScrollOffset = 0 _ScrollWidth = -1 End Begin ScrollBar yScrollBar AcceptFocus = true AutoDeactivate = True Enabled = True Height = 378 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 1260 LineStep = 1 LiveScroll = True LockBottom = True LockedInPosition= False LockLeft = False LockRight = True LockTop = True Maximum = 127 Minimum = 0 PageStep = 12 Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True Top = 190 Value = 47 Visible = True Width = 17 End Begin ScrollBar xScrollBar AcceptFocus = true AutoDeactivate = True Enabled = True Height = 17 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 348 LineStep = 40 LiveScroll = True LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = False Maximum = 0 Minimum = 0 PageStep = 40 Scope = 0 TabIndex = 3 TabPanelIndex = 0 TabStop = True Top = 568 Value = 0 Visible = True Width = 912 End Begin BevelButton BButtonNoteAdd AcceptFocus = False AutoDeactivate = True BackColor = "" Bevel = 0 Bold = False ButtonType = 1 Caption = "Add" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = "" IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 236 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True MenuValue = 0 Scope = 0 TabIndex = 4 TabPanelIndex = 0 TabStop = True TextColor = "" TextFont = "System" TextSize = 0 TextUnit = "" Top = 45 Underline = False Value = False Visible = True Width = 60 End Begin BevelButton BButtonNoteDelete AcceptFocus = False AutoDeactivate = True BackColor = "" Bevel = 0 Bold = False ButtonType = 1 Caption = "Delete" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = "" IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 380 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True MenuValue = 0 Scope = 0 TabIndex = 5 TabPanelIndex = 0 TabStop = True TextColor = "" TextFont = "System" TextSize = 0 TextUnit = "" Top = 45 Underline = False Value = False Visible = True Width = 60 End Begin BevelButton BButtonNoteEdit AcceptFocus = False AutoDeactivate = True BackColor = "" Bevel = 0 Bold = False ButtonType = 1 Caption = "Edit" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = "" IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 308 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True MenuValue = 0 Scope = 0 TabIndex = 6 TabPanelIndex = 0 TabStop = True TextColor = "" TextFont = "System" TextSize = 0 TextUnit = "" Top = 45 Underline = False Value = False Visible = True Width = 60 End Begin BevelButton BButtonNoteLock AcceptFocus = False AutoDeactivate = True BackColor = "" Bevel = 0 Bold = False ButtonType = 0 Caption = "Lock/Unlock" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = "" IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 452 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True MenuValue = 0 Scope = 0 TabIndex = 7 TabPanelIndex = 0 TabStop = True TextColor = "" TextFont = "System" TextSize = 0 TextUnit = "" Top = 45 Underline = False Value = False Visible = True Width = 100 End Begin BevelButton BButtonTrackAdd AcceptFocus = False AutoDeactivate = True BackColor = "" Bevel = 0 Bold = False ButtonType = 0 Caption = "Add" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = "" IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 20 LockBottom = False LockedInPosition= False LockLeft = True LockRight = "" LockTop = True MenuValue = 0 Scope = 0 TabIndex = 8 TabPanelIndex = 0 TabStop = True TextColor = "" TextFont = "System" TextSize = 0 TextUnit = "" Top = 45 Underline = False Value = False Visible = True Width = 50 End Begin BevelButton BButtonTrackDelete AcceptFocus = False AutoDeactivate = True BackColor = "" Bevel = 0 Bold = False ButtonType = 0 Caption = "Delete" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = "" IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 82 LockBottom = False LockedInPosition= False LockLeft = True LockRight = "" LockTop = True MenuValue = 0 Scope = 0 TabIndex = 9 TabPanelIndex = 0 TabStop = True TextColor = "" TextFont = "System" TextSize = 0 TextUnit = "" Top = 45 Underline = False Value = False Visible = True Width = 50 End Begin Slider SliderZoomX AutoDeactivate = True Enabled = True Height = 16 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 236 LineStep = 1 LiveScroll = True LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = "" Maximum = 16 Minimum = 1 PageStep = 4 Scope = 0 TabIndex = 10 TabPanelIndex = 0 TabStop = True TickStyle = 0 Top = 571 Value = 2 Visible = True Width = 100 End Begin Slider SliderZoomY AutoDeactivate = True Enabled = True Height = 100 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 1264 LineStep = 1 LiveScroll = True LockBottom = False LockedInPosition= False LockLeft = "" LockRight = True LockTop = True Maximum = 32 Minimum = 8 PageStep = 4 Scope = 0 TabIndex = 11 TabPanelIndex = 0 TabStop = True TickStyle = 0 Top = 78 Value = 16 Visible = True Width = 16 End Begin PopupMenu PM_NewNoteLength AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" InitialValue = "" Italic = "" Left = 585 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 12 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 TextUnit = 0 Top = 45 Underline = "" Visible = True Width = 80 End Begin PopupMenu PM_SnapTo AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" InitialValue = "" Italic = "" Left = 677 ListIndex = 0 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Scope = 0 TabIndex = 13 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 TextUnit = 0 Top = 45 Underline = "" Visible = True Width = 80 End Begin PopupMenu PM_BeatsPerMeasure AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" InitialValue = "" Italic = "" Left = 308 ListIndex = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 TabIndex = 14 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 TextUnit = 0 Top = 598 Underline = "" Visible = True Width = 80 End Begin PopupMenu PM_BasicBeat AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" InitialValue = "" Italic = "" Left = 485 ListIndex = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 TabIndex = 15 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 TextUnit = 0 Top = 598 Underline = "" Visible = True Width = 80 End Begin StaticText ST_NewNoteLength AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 585 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 16 TabPanelIndex = 0 Text = "New Note" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 TextUnit = 0 Top = 13 Underline = "" Visible = True Width = 80 End Begin StaticText ST_SnapTo AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 677 LockBottom = "" LockedInPosition= False LockLeft = True LockRight = "" LockTop = True Multiline = "" Scope = 0 TabIndex = 17 TabPanelIndex = 0 Text = "Snap To" TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 TextUnit = 0 Top = 13 Underline = "" Visible = True Width = 80 End Begin StaticText ST_BeatsPerMeasure AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 169 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Multiline = "" Scope = 0 TabIndex = 18 TabPanelIndex = 0 Text = "Beats per Measure" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 TextUnit = 0 Top = 598 Underline = "" Visible = True Width = 127 End Begin StaticText ST_BasicBeat AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 400 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Multiline = "" Scope = 0 TabIndex = 19 TabPanelIndex = 0 Text = "Basic Beat" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 TextUnit = 0 Top = 599 Underline = "" Visible = True Width = 73 End Begin PushButton Play_PB AutoDeactivate = True Bold = "" Cancel = "" Caption = "Play" Default = True Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 705 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 TabIndex = 20 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 TextUnit = 0 Top = 599 Underline = "" Visible = True Width = 80 End Begin StaticText ST_Tempo AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Multiline = "" Scope = 0 TabIndex = 22 TabPanelIndex = 0 Text = "Tempo" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 0 TextUnit = 0 Top = 599 Underline = "" Visible = True Width = 60 End Begin TextField Tempo_EF AcceptTabs = "" Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 22 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 92 LimitText = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Mask = "###" Multiline = "" Password = "" ReadOnly = True Scope = 0 ScrollbarHorizontal= "" ScrollbarVertical= True Styled = "" TabIndex = 23 TabPanelIndex = 0 TabStop = True Text = 120 TextColor = 0 TextFont = "System" TextSize = 0 TextUnit = 0 Top = 597 Underline = "" UseFocusRing = True Visible = True Width = 54 End Begin UpDownArrows Tempo_UDA AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 150 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 TabIndex = 24 TabPanelIndex = 0 TabStop = True Top = 597 Visible = True Width = 13 End Begin BevelButton BButtonTrackDupe AcceptFocus = False AutoDeactivate = True BackColor = "" Bevel = 0 Bold = False ButtonType = 0 Caption = "Dupe" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = "" IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 144 LockBottom = False LockedInPosition= False LockLeft = True LockRight = "" LockTop = True MenuValue = 0 Scope = 0 TabIndex = 27 TabPanelIndex = 0 TabStop = True TextColor = "" TextFont = "System" TextSize = 0 TextUnit = "" Top = 45 Underline = False Value = False Visible = True Width = 50 End Begin CheckBox Loop_Check AutoDeactivate = True Bold = "" Caption = "Loop" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 797 LockBottom = True LockedInPosition= False LockLeft = True LockRight = "" LockTop = "" Scope = 0 State = 0 TabIndex = 29 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 TextUnit = 0 Top = 599 Underline = "" Value = False Visible = True Width = 100 End End #tag EndWindow #tag WindowCode #tag Event Sub Activate() WindowMgr.EditorSetCurrent(me) End Sub #tag EndEvent #tag Event Sub Close() if WindowMgr.ApplicationQuitFlag = false then dim CloseMe as Boolean = WindowMgr.EditorClose(me) end if End Sub #tag EndEvent #tag Event Sub EnableMenuItems() NewEditor.Enable //need to check demo limits NewTrack.Enable //need to check channel and demo limits if self.WindowNeedsSaving then SaveSave.Enable end if if self.FileMgr.NativeFile <> nil then FileRevertToSaved.Enable end if if Ubound(WindowMgr.Editors) > -1 then FileSaveAll.Enable end if if Ubound(NoteMgr.Notes) > -1 then EditSelectAll.Enable NotesGroup.Enable end if if Ubound(NoteMgr.Selection) > -1 then EditSelectNone.Enable NotesMakeChord.Enable NotesRemoveChord.Enable NotesBreakChord.Enable NotesAlterChord.Enable NotesLockUnlock.Enable If SelectionHasGroup then NotesUngroup.Enable End If end if if CommandMgr.CanUndo then EditUndo.Enable EditUndo.Text = "Undo " + CommandMgr.CurrentUndoName else EditUndo.Text = "Can't Undo" end if if CommandMgr.CanRedo then EditRedo.Enable EditRedo.Text = "Redo " + CommandMgr.CurrentRedoName else EditRedo.Text = "Can't Redo" end if //ALWAYS ON SaveSaveAs.Enable FileExportasMIDI.Enable MusicSetStopCursorToEnd.Enable MusicLoopEntireSong.Enable End Sub #tag EndEvent #tag Event Sub Open() //do an initial check Open_IfAppOpening //set up the necessary links for other commands Open_InitializeMgrs Open_InitializeControlLinks //give them a default track to work with TrackListObj1.AddTrack //set up a basic song Open_InitializeSongMgr //set up the controls Open_Initialize_PM_BeatsPerMeasure Open_Initialize_PM_BasicBeat Open_Initialize_PM_NewNoteLength Open_Initialize_PM_SnapTo Open_InitializeGUIObjParameters Open_InitializeScrollBars //release the control holds (lots of NilObjectExceptions and controls not existing yet) App.Opening = false //update the UI ResizeBars Tempo_EF.Text = Str(SongMgr.Tempo) me.WindowNeedsSaving = false If SplashWindow.Visible = true then SplashWindow.Close me.Refresh #if DebugBuild 'TestSuite.NewWindowCommand #endif End Sub #tag EndEvent #tag Event Sub Resized() ResizeBars End Sub #tag EndEvent #tag Event Sub Resizing() ResizeBars End Sub #tag EndEvent #tag MenuHandler Function CreateSimpleRandomMelody() As Boolean Handles CreateSimpleRandomMelody.Action WindowACSBasicSequence.ParentWindow = me WindowACSBasicSequence.Show WindowACSBasicSequence.SetControls GUIObj1.Draw Return True End Function #tag EndMenuHandler #tag MenuHandler Function EditClear() As Boolean Handles EditClear.Action #if kLogMethods Log("WindowEditor.Menu.Edit.Clear") #endif EditMgr.Delete GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function EditCopy() As Boolean Handles EditCopy.Action EditMgr.Copy return true End Function #tag EndMenuHandler #tag MenuHandler Function EditCut() As Boolean Handles EditCut.Action EditMgr.Cut GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function EditorClose() As Boolean Handles EditorClose.Action dim CloseMe as Boolean = WindowMgr.EditorClose(me) return true End Function #tag EndMenuHandler #tag MenuHandler Function EditPaste() As Boolean Handles EditPaste.Action EditMgr.Paste GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function EditRedo() As Boolean Handles EditRedo.Action CommandMgr.Redo Return True End Function #tag EndMenuHandler #tag MenuHandler Function EditSelectAll() As Boolean Handles EditSelectAll.Action #if kLogMethods Log("WindowEditor.MenuHandler.EditSelectAll") #endif if GUIObj1.EditStatus = GUIObj1.kEditStatus_Default then return false NoteMgr.SelectAll GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function EditSelectNone() As Boolean Handles EditSelectNone.Action #if kLogMethods Log("WindowEditor.MenuHandler.EditSelectNone") #endif if GUIObj1.EditStatus = GUIObj1.kEditStatus_Default then return false NoteMgr.SelectNone GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function EditUndo() As Boolean Handles EditUndo.Action CommandMgr.Undo Return True End Function #tag EndMenuHandler #tag MenuHandler Function FileClose() As Boolean Handles FileClose.Action dim CloseMe as Boolean = WindowMgr.EditorClose(me) End Function #tag EndMenuHandler #tag MenuHandler Function FileExportasMIDI() As Boolean Handles FileExportasMIDI.Action self.FileMgr.ExportToMIDI Return True End Function #tag EndMenuHandler #tag MenuHandler Function MusicChangeKey() As Boolean Handles MusicChangeKey.Action WindowChangeKey.ParentWindow = me WindowChangeKey.Show WindowChangeKey.GetKey(SongMgr.Keys(0)) GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function MusicLoopEntireSong() As Boolean Handles MusicLoopEntireSong.Action PlayMgr.LoopEntireSong Return True End Function #tag EndMenuHandler #tag MenuHandler Function MusicSetStopCursorToEnd() As Boolean Handles MusicSetStopCursorToEnd.Action PlayMgr.SetStopCursorToEnd Return True End Function #tag EndMenuHandler #tag MenuHandler Function NewTrack() As Boolean Handles NewTrack.Action TrackListObj1.AddTrack return true End Function #tag EndMenuHandler #tag MenuHandler Function NotesAlterChord() As Boolean Handles NotesAlterChord.Action EditMgr.MakeAlterChord GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function NotesBreakChord() As Boolean Handles NotesBreakChord.Action EditMgr.BreakChord GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function NotesEditNotes() As Boolean Handles NotesEditNotes.Action WindowEditNote.ParentWindow = me WindowEditNote.Show WindowEditNote.SetControls GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function NotesGroup() As Boolean Handles NotesGroup.Action EditMgr.MakeGroup return true End Function #tag EndMenuHandler #tag MenuHandler Function NotesLockUnlock() As Boolean Handles NotesLockUnlock.Action EditMgr.LockUnlock GUIObj1.Draw Return True End Function #tag EndMenuHandler #tag MenuHandler Function NotesMakeChord() As Boolean Handles NotesMakeChord.Action EditMgr.MakeAlterChord GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function NotesRemoveChord() As Boolean Handles NotesRemoveChord.Action EditMgr.RemoveChord GUIObj1.Draw return true End Function #tag EndMenuHandler #tag MenuHandler Function NotesUngroup() As Boolean Handles NotesUngroup.Action EditMgr.RemoveGroup return true End Function #tag EndMenuHandler #tag MenuHandler Function SaveSave() As Boolean Handles SaveSave.Action self.FileMgr.Save Return True End Function #tag EndMenuHandler #tag MenuHandler Function SaveSaveAs() As Boolean Handles SaveSaveAs.Action self.FileMgr.Save Return True End Function #tag EndMenuHandler #tag MenuHandler Function TestChords() As Boolean Handles TestChords.Action TestSuite.CreateTestChords Return True End Function #tag EndMenuHandler #tag MenuHandler Function TestCreateBasicRandomMelody() As Boolean Handles TestCreateBasicRandomMelody.Action ACS.MakeBasicRandomMelody Return True End Function #tag EndMenuHandler #tag MenuHandler Function TestCreateSequencerSound() As Boolean Handles TestCreateSequencerSound.Action ACS.CreateSequencerSound Return True End Function #tag EndMenuHandler #tag MenuHandler Function TestNestedGroupsSample() As Boolean Handles TestNestedGroupsSample.Action TestSuite.CreateOdeToJoy TestSuite.CreateNestedGroups Return True End Function #tag EndMenuHandler #tag MenuHandler Function TestOdeToJoySample() As Boolean Handles TestOdeToJoySample.Action TestSuite.CreateOdeToJoy Return True End Function #tag EndMenuHandler #tag Method, Flags = &h0 Sub ChangeScrollX(DeltaValue as integer) //me.Value is based on the number of measures in the song or the rightBoundNote self.GUIObj1.scrollDeltaX = DeltaValue ResizeBars End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ChangeScrollY(DeltaValue as integer) //me.Value is based on the number of total MIDI Notes: 0-127 self.GUIObj1.scrollDeltaY = DeltaValue ResizeBars End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ChangeSnapTo(TheListIndex as integer) Select Case TheListIndex Case 0 '"Whole" GUIObj1.SnapTo = MIDILib.kNoteLength_01 Case 1 '"1/2" GUIObj1.SnapTo = MIDILib.kNoteLength_02 Case 2 '"1/4" GUIObj1.SnapTo = MIDILib.kNoteLength_04 Case 3 '"1/8" GUIObj1.SnapTo = MIDILib.kNoteLength_08 Case 4 '"1/16" GUIObj1.SnapTo = MIDILib.kNoteLength_16 Case 5 '"1/32" GUIObj1.SnapTo = MIDILib.kNoteLength_32 Case 6 '"1/64" GUIObj1.SnapTo = MIDILib.kNoteLength_64 End Select if App.Opening = false then GUIObj1.Draw end if End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ChangeZoomX(NewValue as integer) self.GUIObj1.ResolutionX = NewValue ResizeBars End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ChangeZoomY(NewValue as integer) self.GUIObj1.ResolutionY = NewValue self.GUIObj1.PrepNoteInKeyIndicators ResizeBars End Sub #tag EndMethod #tag Method, Flags = &h0 Sub DecreaseTempo() SongMgr.Tempo = SongMgr.Tempo - 1 if SongMgr.Tempo < MusicLib.kMinTempo then SongMgr.Tempo = MusicLib.kMinTempo self.Tempo_EF.Text = str(SongMgr.Tempo) self.Refresh self.WindowNeedsSaving = true End Sub #tag EndMethod #tag Method, Flags = &h0 Sub IncreaseTempo() SongMgr.Tempo = SongMgr.Tempo + 1 if SongMgr.Tempo > MusicLib.kMaxTempo then SongMgr.Tempo = MusicLib.kMaxTempo self.Tempo_EF.Text = str(SongMgr.Tempo) self.Refresh self.WindowNeedsSaving = true End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Log(theText as string) WindowLog.Log(theText) End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_IfAppOpening() if App.Opening then //add to the window array WindowMgr.Editors.Append me me.Name = "Untitled " + Str(Ubound(WindowMgr.Editors) + 1) me.Title = App.kAppName + " : " + me.Name //add the menu item dim EditorMenuItem as EditorMenuItemObj = new EditorMenuItemObj(me) EditorMenuItem.Text = me.Name EditorMenuItem.Tag = me MenuBar1.Child("EditorMenu").Append(EditorMenuItem) end if End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_InitializeControlLinks() TrackListObj1.ParentWindow = me GUIObj1.ParentWindow = me End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_InitializeGUIObjParameters() //set up the remaining default GUI Parameters GUIObj1.ResolutionX = SliderZoomX.Value GUIObj1.ResolutionY = SliderZoomY.Value GUIObj1.EditStatus = GUIObj.kEditStatus_Default 'GUIObj1.SnapTo = MIDILib.kNoteLength_08 GUIObj1.PrepNoteInKeyIndicators End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_InitializeMgrs() //setting the core objects for all functionality if SongMgr = nil then SongMgr = new SongMgrObj if NoteMgr = nil then NoteMgr = new NoteMgrObj if EditMgr = nil then EditMgr = new EditMgrObj if PlayMgr = nil then PlayMgr = new PlayMgrObj if ACS = nil then ACS = new ACSObj if FileMgr = nil then FileMgr = new FileMgrObj if CommandMgr = nil then CommandMgr = new CommandMgrObj if TestSuite = nil then TestSuite = new TestSuiteObj SongMgr.ParentWindow = me NoteMgr.ParentWindow = me PlayMgr.ParentWindow = me EditMgr.ParentWindow = me ACS.ParentWindow = me FileMgr.ParentWindow = me TestSuite.ParentWindow = me CommandMgr.ParentWindow = me End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_InitializeScrollBars() //set the scrollbar parameters xScrollBar.PageStep = SongMgr.TimeSignatureBeatsPerMeasure * SongMgr.TimeSignatureBasicBeat xScrollBar.LineStep = SongMgr.TimeSignatureBasicBeat xScrollBar.Maximum = self.SongMgr.TimeSignatureBasicBeat * self.SongMgr.TimeSignatureBeatsPerMeasure xScrollBar.Value = 0 yScrollBar.Value = 47 'yScrollBar.PageStep = 12 //a chromatic octave 'yScrollBar.LineStep = 1 End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_InitializeSongMgr() if FileLib.NativeFile = nil then //these were in constructors until the FileOpen command changed all of that. '//We have to have at leat one key in the song. This is C Major 'dim NewKey as KeyObj = new KeyObj 'NewKey.Song = SongMgr 'NewKey.Tonic = 0 'NewKey.Key = MusicLib.kKeyMajor 'NewKey.CalculatePitches ' 'SongMgr.Keys.Append NewKey ' '//set up the remaining default parameters for the song 'SongMgr.CreateColors 'SongMgr.Tempo = 120 'SongMgr.TimeSignatureBeatsPerMeasure = 4 'SongMgr.TimeSignatureBasicBeat = MIDILib.kNoteLength_04 'SongMgr.TotalBeats = SongMgr.TimeSignatureBeatsPerMeasure * SongMgr.TimeSignatureBasicBeat * 16 //the last multiplier being the number of measures. ' 'Tempo_EF.Text = Str(SongMgr.Tempo) end if End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_PM_BasicBeat() PM_BasicBeat.AddRow("1/2") PM_BasicBeat.AddRow("1/4") PM_BasicBeat.ListIndex = PM_BasicBeat.ListCount End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_PM_BeatsPerMeasure() PM_BeatsPerMeasure.AddRow("2") PM_BeatsPerMeasure.AddRow("3") PM_BeatsPerMeasure.AddRow("4") PM_BeatsPerMeasure.ListIndex = PM_BeatsPerMeasure.ListCount End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_PM_NewNoteLength() PM_NewNoteLength.AddRow("Whole") PM_NewNoteLength.AddRow("1/2") PM_NewNoteLength.AddRow("1/4") PM_NewNoteLength.AddRow("1/8") PM_NewNoteLength.AddRow("1/16") PM_NewNoteLength.AddRow("1/32") PM_NewNoteLength.AddRow("1/64") PM_NewNoteLength.ListIndex = 2 End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub Open_Initialize_PM_SnapTo() PM_SnapTo.AddRow("Whole") PM_SnapTo.AddRow("1/2") PM_SnapTo.AddRow("1/4") PM_SnapTo.AddRow("1/8") PM_SnapTo.AddRow("1/16") PM_SnapTo.AddRow("1/32") PM_SnapTo.AddRow("1/64") PM_SnapTo.ListIndex = 3 End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ResizeBars() dim editorWidthInBeats as integer editorWidthInBeats = (self.GUIObj1.Width - self.GUIObj1.kKeyPicWidth) \ self.GUIObj1.ResolutionX SongMgr.TotalBeats = NoteMgr.GetTotalBeats 'xScrollBar.Maximum = Max(SongMgr.TotalBeats, (self.SongMgr.TimeSignatureBasicBeat * self.SongMgr.TimeSignatureBeatsPerMeasure)) '- editorWidthInBeats xScrollBar.Maximum = Max(SongMgr.TotalBeats, self.PlayMgr.StopCursor.StartBeat) GUIObj1.scrollDeltaX = xScrollBar.Value dim editorHeightInKeys as integer editorHeightinKeys = (self.GUIObj1.Height - self.GUIObj1.kRulerPicHeight) \ self.GUIObj1.ResolutionY yScrollBar.Maximum = MIDILib.kMIDINoteCount - editorHeightinKeys + 1 //+1 reslves a bug where the editor wouldn't show note 0 if (self.GUIObj1.Height - self.GUIObj1.kRulerPicHeight) > MIDILib.kMIDINoteCount * self.GUIObj1.ResolutionY then GUIObj1.scrollDeltaY = 0 else GUIObj1.scrollDeltaY = yScrollBar.Value end if GUIObj1.Draw EditorTop = GUIObj1.Top EditorLeft = GUIObj1.Left editorWidth = GUIObj1.Width EditorHeight = GUIObj1.Height TrackListTop = TrackListObj1.Top TrackListLeft = TrackListObj1.Left TrackListWidth = TrackListObj1.Width TrackListHeight = TrackListObj1.Height End Sub #tag EndMethod #tag Method, Flags = &h21 Private Function SelectionHasGroup() As Boolean dim thisObject as integer = 0 dim firstObject as integer = 0 dim lastObject as integer = UBound(NoteMgr.Selection) if lastObject = -1 then return false for thisObject = firstObject to lastObject if NoteMgr.Selection(thisObject) <> nil then if NoteMgr.Selection(thisObject) IsA GroupObj then return true end if next return false End Function #tag EndMethod #tag Method, Flags = &h0 Sub SetEditMode(Mode as integer) #if kLogMethods Log("WindowEditor.SetEditMode(" + Str(Mode) + ")") #endif Select Case Mode Case GUIObj1.kEditStatus_Add //ADD BButtonNoteEdit.Value = false BButtonNoteDelete.Value = false if BButtonNoteAdd.Value = true then GUIObj1.EditStatus = GUIObj1.kEditStatus_Add else GUIObj1.EditStatus = GUIObj1.kEditStatus_Default end if Case GUIObj1.kEditStatus_Edit //EDIT BButtonNoteAdd.Value = false BButtonNoteDelete.Value = false if BButtonNoteEdit.Value = true then GUIObj1.EditStatus = GUIObj1.kEditStatus_Edit else GUIObj1.EditStatus = GUIObj1.kEditStatus_Default end if Case GUIObj1.kEditStatus_Delete //DELETE BButtonNoteAdd.Value = false BButtonNoteEdit.Value = false if BButtonNoteDelete.Value = true then GUIObj1.EditStatus = GUIObj1.kEditStatus_Delete else GUIObj1.EditStatus = GUIObj1.kEditStatus_Default end if End Select End Sub #tag EndMethod #tag Method, Flags = &h0 Sub SetWindowModified(TheWindow As Window, IsModified as Boolean) Dim osErr As Integer Dim v As Variant #if TargetMacOS then #if TargetCarbon then Declare Function SetWindowModified Lib "Carbon" (window As WindowPtr, modified As Integer) As Integer #else Declare Function SetWindowModified Lib "WindowsLib" (window As WindowPtr, modified As Integer) As Integer #endif // TargetCarbon v = IsModified osErr = SetWindowModified(TheWindow, v) #endif // TargetMacOS End Sub #tag EndMethod #tag Property, Flags = &h0 ACS As ACSObj #tag EndProperty #tag Property, Flags = &h0 CommandMgr As CommandMgrObj #tag EndProperty #tag Property, Flags = &h0 EditMgr As EditMgrObj #tag EndProperty #tag Property, Flags = &h21 Private EditorHeight As Integer #tag EndProperty #tag Property, Flags = &h21 Private EditorLeft As Integer #tag EndProperty #tag Property, Flags = &h21 Private EditorTop As Integer #tag EndProperty #tag Property, Flags = &h21 Private EditorWidth As Integer #tag EndProperty #tag Property, Flags = &h0 FileMgr As FileMgrObj #tag EndProperty #tag Property, Flags = &h21 Private mWindowNeedsSaving As Boolean #tag EndProperty #tag Property, Flags = &h0 Name As String #tag EndProperty #tag Property, Flags = &h0 NoteMgr As NoteMgrObj #tag EndProperty #tag Property, Flags = &h0 PlayMgr As PlayMgrObj #tag EndProperty #tag Property, Flags = &h0 SongMgr As SongMgrObj #tag EndProperty #tag Property, Flags = &h0 TestSuite As TestSuiteObj #tag EndProperty #tag Property, Flags = &h21 Private TrackListHeight As Integer #tag EndProperty #tag Property, Flags = &h21 Private TrackListLeft As Integer #tag EndProperty #tag Property, Flags = &h21 Private TrackListTop As Integer #tag EndProperty #tag Property, Flags = &h21 Private TrackListWidth As Integer #tag EndProperty #tag Property, Flags = &h0 WindowHasFileToOpen As Boolean = False #tag EndProperty #tag ComputedProperty, Flags = &h0 #tag Getter Get return mWindowNeedsSaving End Get #tag EndGetter #tag Setter Set mWindowNeedsSaving = value SetWindowModified(self, mWindowNeedsSaving) End Set #tag EndSetter WindowNeedsSaving As Boolean #tag EndComputedProperty #tag EndWindowCode #tag Events TrackListObj1 #tag Event Function HeaderPressed(column as Integer) As Boolean //this keeps the user from sorting the listbox return true End Function #tag EndEvent #tag EndEvents #tag Events yScrollBar #tag Event Sub ValueChanged() ChangeScrollY(me.Value) End Sub #tag EndEvent #tag EndEvents #tag Events xScrollBar #tag Event Sub ValueChanged() ChangeScrollX(me.Value) End Sub #tag EndEvent #tag EndEvents #tag Events BButtonNoteAdd #tag Event Sub Action() #if kLogEvents Log("WindowEditor.BButtonNoteAdd") #endif SetEditMode(GUIObj1.kEditStatus_Add) End Sub #tag EndEvent #tag EndEvents #tag Events BButtonNoteDelete #tag Event Sub Action() #if kLogEvents Log("WindowEditor.BButtonNoteDelete") #endif SetEditMode(GUIObj1.kEditStatus_Delete) End Sub #tag EndEvent #tag EndEvents #tag Events BButtonNoteEdit #tag Event Sub Action() #if kLogEvents Log("WindowEditor.BButtonNoteEdit") #endif SetEditMode(GUIObj1.kEditStatus_Edit) End Sub #tag EndEvent #tag EndEvents #tag Events BButtonNoteLock #tag Event Sub Action() EditMgr.LockUnlock GUIObj1.Draw End Sub #tag EndEvent #tag EndEvents #tag Events BButtonTrackAdd #tag Event Sub Action() #if kLogEvents WindowLog.Log("WindowEditor") #endif self.TrackListObj1.AddTrack End Sub #tag EndEvent #tag EndEvents #tag Events BButtonTrackDelete #tag Event Sub Action() self.TrackListObj1.DeleteTrack End Sub #tag EndEvent #tag EndEvents #tag Events SliderZoomX #tag Event Sub ValueChanged() ChangeZoomX(me.Value) End Sub #tag EndEvent #tag EndEvents #tag Events SliderZoomY #tag Event Sub ValueChanged() ChangeZoomY(me.Value) End Sub #tag EndEvent #tag EndEvents #tag Events PM_NewNoteLength #tag Event Sub Change() Select Case me.ListIndex Case 0 '"Whole" NoteMgr.NewNoteLength = MIDILib.kNoteLength_01 Case 1 '"1/2" NoteMgr.NewNoteLength = MIDILib.kNoteLength_02 Case 2 '"1/4" NoteMgr.NewNoteLength = MIDILib.kNoteLength_04 Case 3 '"1/8" NoteMgr.NewNoteLength = MIDILib.kNoteLength_08 Case 4 '"1/16" NoteMgr.NewNoteLength = MIDILib.kNoteLength_16 Case 5 '"1/32" NoteMgr.NewNoteLength = MIDILib.kNoteLength_32 Case 6 '"1/64" NoteMgr.NewNoteLength = MIDILib.kNoteLength_64 End Select if App.Opening = false then GUIObj1.Draw end if End Sub #tag EndEvent #tag EndEvents #tag Events PM_SnapTo #tag Event Sub Change() ChangeSnapTo(me.ListIndex) End Sub #tag EndEvent #tag EndEvents #tag Events PM_BeatsPerMeasure #tag Event Sub Change() //Any changes to this need to be made to self.FileMgr.MIDI_CreateTrack Select Case me.ListIndex Case 0 '2 SongMgr.TimeSignatureBeatsPerMeasure = 2 Case 1 '3 SongMgr.TimeSignatureBeatsPerMeasure = 3 Case 2 '4 SongMgr.TimeSignatureBeatsPerMeasure = 4 End Select if App.Opening = false then self.WindowNeedsSaving = true GUIObj1.Draw end if End Sub #tag EndEvent #tag EndEvents #tag Events PM_BasicBeat #tag Event Sub Change() //Any changes to this need to be made to self.FileMgr.MIDI_CreateTrack Select Case me.ListIndex Case 0 '2 SongMgr.TimeSignatureBasicBeat = MIDILib.kNoteLength_02 'Case 1 '3 'SongMgr.TimeSignatureBasicBeat = MIDILib.kNoteLength_0 //There are no 1/3 note values in MIDI Case 1 '4 SongMgr.TimeSignatureBasicBeat = MIDILib.kNoteLength_04 End Select if App.Opening = false then self.WindowNeedsSaving = true GUIObj1.Draw end if End Sub #tag EndEvent #tag EndEvents #tag Events Play_PB #tag Event Sub Action() if Ubound(self.NoteMgr.Notes) = -1 then return if me.Default = true then me.Default = false me.Caption = "Stop" PlayMgr.Play else me.Default = true me.Caption = "Play" PlayMgr.StopFlag = true PlayMgr.Stop end if End Sub #tag EndEvent #tag EndEvents #tag Events Tempo_UDA #tag Event Sub Up() IncreaseTempo End Sub #tag EndEvent #tag Event Sub Down() DecreaseTempo End Sub #tag EndEvent #tag EndEvents #tag Events BButtonTrackDupe #tag Event Sub Action() self.TrackListObj1.DuplicateTrack End Sub #tag EndEvent #tag EndEvents #tag Events Loop_Check #tag Event Sub Action() if me.Value = true then PlayMgr.LoopPlay = true else PlayMgr.LoopPlay = false end if GUIObj1.Draw End Sub #tag EndEvent #tag EndEvents
View
1 Windows/WindowLog.rbfrm
@@ -0,0 +1 @@
+#tag Window Begin Window WindowLog BackColor = 16777215 Backdrop = "" CloseButton = True Composite = False Frame = 3 FullScreen = False HasBackColor = False Height = 256 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 32000 MaximizeButton = True MaxWidth = 32000 MenuBar = 1179086674 MenuBarVisible = True MinHeight = 256 MinimizeButton = True MinWidth = 480 Placement = 0 Resizeable = True Title = "DebugLog" Visible = True Width = 480 Begin TextArea EditField1 AcceptTabs = "" Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = "" Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 204 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 0 LimitText = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = True Mask = "" Multiline = True Password = "" ReadOnly = "" Scope = 0 ScrollbarHorizontal= True ScrollbarVertical= True Styled = "" TabIndex = 0 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "Monaco" TextSize = 10 Top = 0 Underline = "" UseFocusRing = True Visible = True Width = 480 End Begin PushButton ShowAllButton AutoDeactivate = True Bold = "" Cancel = "" Caption = "Show All" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 209 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 217 Underline = "" Visible = True Width = 80 End Begin PushButton ShowLastButton AutoDeactivate = True Bold = "" Cancel = "" Caption = "Show Last" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 117 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 2 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 217 Underline = "" Visible = True Width = 80 End Begin PushButton ClearLogButton AutoDeactivate = True Bold = "" Cancel = "" Caption = "Clear" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 301 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 6 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 216 Underline = "" Visible = True Width = 72 End Begin StaticText CursorValue AutoDeactivate = True Bold = "" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 45 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Multiline = "" Scope = 0 TabIndex = 7 TabPanelIndex = 0 TabStop = True Text = -1 TextAlign = 1 TextColor = 0 TextFont = "System" TextSize = 0 Top = 217 Underline = "" Visible = True Width = 60 End Begin UpDownArrows UpDownArrows1 AcceptFocus = False AutoDeactivate = True Enabled = True Height = 23 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 8 TabPanelIndex = 0 TabStop = True Top = 216 Visible = True Width = 13 End Begin PushButton LogObjects AutoDeactivate = True Bold = "" Cancel = "" Caption = "Dump" Default = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = "" Left = 385 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = "" Scope = 0 TabIndex = 9 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 0 Top = 217 Underline = "" Visible = True Width = 80 End End #tag EndWindow #tag WindowCode #tag Event Sub Open() dim CurrentWindow as WindowEditor = WindowMgr.CurrentEditor if CurrentWindow <> nil then me.Left = CurrentWindow.Left + CurrentWindow.Width + 20 else me.Left = 950 end if End Sub #tag EndEvent #tag Method, Flags = &h21 Private Sub AppendObjectDump(theText as String) ObjectDump = ObjectDump + theText + EndOfLine End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub DumpNoteMgr(ParentWindow as WindowEditor) dim Tab as string = chr(kTab) dim NoteMgr as NoteMgrObj = ParentWindow.NoteMgr if UBound(NoteMgr.Notes) > -1 then for each Note as NoteObj in NoteMgr.Notes dim NoteDump as string = "" NoteDump = NoteDump + kNoteMarker + Note.Description if Note.Chord <> nil then NoteDump = NoteDump + Tab + kParentMarker + kChordMarker + Note.Chord.Description end if if Note.Group <> nil then NoteDump = NoteDump + Tab + kParentMarker + kGroupMarker + Note.Group.Description end if if Note.Track <> nil then NoteDump = NoteDump + Tab + kParentTrackMarker + Note.Track.Description end if AppendObjectDump(NoteDump) next else AppendObjectDump("NO NOTES") end if AppendObjectDump("") if UBound(NoteMgr.Chords) > -1 then For each Chord as ChordObj in NoteMgr.Chords dim ChordDump as String = "" ChordDump = ChordDump + kChordMarker + Chord.Description if Ubound(Chord.Notes) > -1 then for each Note as NoteObj in Chord.Notes ChordDump = ChordDump + Tab + kNoteMarker + Note.Description next else ChordDump = ChordDump + Tab + "CHORD ERROR! This chord has no notes." end if if Chord.Group <> nil then ChordDump = ChordDump + Tab + kParentMarker + kGroupMarker + Chord.Group.Description end if if Chord.Track <> nil then ChordDump = ChordDump + Tab + kParentTrackMarker + Chord.Track.Description end if AppendObjectDump(ChordDump) Next else AppendObjectDump("NO CHORDS") end if AppendObjectDump("") if UBound(NoteMgr.Groups) > -1 then For each Group as GroupObj in NoteMgr.Groups dim GroupDump as String = "" GroupDump = GroupDump + kGroupMarker + Group.Description if Ubound(Group.Objects) > -1 then for each Music as MusicObj in Group.Objects if Music IsA NoteObj then GroupDump = GroupDump + Tab + kNoteMarker elseif Music IsA ChordObj then GroupDump = GroupDump + Tab + kChordMarker elseif Music IsA GroupObj then GroupDump = GroupDump + Tab + kGroupMarker else GroupDump = GroupDump + Tab + kUFOMarker end if GroupDump = GroupDump + Music.Description next else GroupDump = GroupDump + Tab + "GROUP ERROR! This group has no objects." end if if Group.Group <> nil then GroupDump = GroupDump + Tab + kParentMarker + kGroupMarker + Group.Group.Description end if if Group.Track <> nil then GroupDump = GroupDump + Tab + kParentTrackMarker + Group.Track.Description end if AppendObjectDump(GroupDump) Next else AppendObjectDump("NO GROUPS") end if AppendObjectDump("") if UBound(NoteMgr.Selection) > -1 then AppendObjectDump("SELECTION(" + Str(Ubound(NoteMgr.Selection)) + ")") for each Music as MusicObj in NoteMgr.Selection if Music IsA NoteObj then AppendObjectDump(kNoteMarker + Music.Description) elseif Music IsA ChordObj then AppendObjectDump(kChordMarker + Music.Description) elseif Music IsA GroupObj then AppendObjectDump(kGroupMarker + Music.Description) else AppendObjectDump(kUFOMarker + Music.Description) end if next else AppendObjectDump("NO SELECTION") end if AppendObjectDump("") End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub DumpTrackList(ParentWindow as WindowEditor) dim Tab as string = chr(kTab) dim TrackList as TrackListObj = ParentWindow.TrackListObj1 dim i as integer dim Track as TrackObj for i = 0 to TrackList.ListCount - 1 dim TrackDump as String = "" Track = TrackList.CellTag(i, 0) TrackDump = TrackDump + kTrackMarker + Track.Description if Ubound(Track.Music) > -1 then for each Music as MusicObj in Track.Music if Music IsA NoteObj then TrackDump = TrackDump + Tab + kNoteMarker elseif Music IsA ChordObj then TrackDump = TrackDump + Tab + kChordMarker elseif Music IsA GroupObj then TrackDump = TrackDump + Tab + kGroupMarker else TrackDump = TrackDump + Tab + kUFOMarker end if TrackDump = TrackDump + Music.Description next else TrackDump = TrackDump + Tab + "NO MUSIC IN TRACK" end if AppendObjectDump(TrackDump) next AppendObjectDump("") End Sub #tag EndMethod #tag Method, Flags = &h0 Sub Log(theText as string) WindowLog.LogText.Append(Str(Ubound(LogText) + 1) + ": " + theText + EndofLine) LogCursor = Ubound(LogText) ShowLastLog WindowLog.Refresh End Sub #tag EndMethod #tag Method, Flags = &h21 Private Sub SerializeObjects(ParentWindow as WindowEditor) dim thisObject as integer = 0 dim firstObject as integer = 0 dim lastObject as integer = Ubound(ParentWindow.NoteMgr.Notes) if lastObject > -1 then for thisObject = firstObject to lastObject if ParentWindow.NoteMgr.Notes(thisObject) <> nil then dim mNote as NoteObj = ParentWindow.NoteMgr.Notes(thisObject) mNote.Description = "N" + Str(thisObject) end if next end if thisObject = 0 firstObject = 0 lastObject = Ubound(ParentWindow.NoteMgr.Chords) if lastObject > -1 then for thisObject = firstObject to lastObject if ParentWindow.NoteMgr.Chords(thisObject) <> nil then dim mChord as ChordObj = ParentWindow.NoteMgr.Chords(thisObject) mChord.Description = "C" + Str(thisObject) end if next end if thisObject = 0 firstObject = 0 lastObject = Ubound(ParentWindow.NoteMgr.Groups) if lastObject > -1 then for thisObject = firstObject to lastObject if ParentWindow.NoteMgr.Groups(thisObject) <> nil then dim mGroup as GroupObj = ParentWindow.NoteMgr.Groups(thisObject) mGroup.Description = "G" + Str(thisObject) end if next end if thisObject = 0 firstObject = 0 lastObject = Ubound(ParentWindow.NoteMgr.Selection) if lastObject > -1 then for thisObject = firstObject to lastObject if ParentWindow.NoteMgr.Selection(thisObject) <> nil then dim mObject as MusicObj = ParentWindow.NoteMgr.Selection(thisObject) mObject.Description = mObject.Description + "s" + Str(thisObject) end if next end if End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ShowCompleteLog() dim lastLogItem as integer = Ubound(LogText) if lastLogItem = -1 then return dim thisLogItem as integer = 0 dim firstLogItem as integer = 0 EditField1.Text = Join(LogText, "") End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ShowCursorLog(CursorValue as integer) dim lastLogItem as integer = Ubound(LogText) if lastLogItem = -1 then return EditField1.Text = LogText(CursorValue) self.CursorValue.Text = str(CursorValue) End Sub #tag EndMethod #tag Method, Flags = &h0 Sub ShowLastLog() dim lastLogItem as integer = Ubound(LogText) if lastLogItem = -1 then return EditField1.Text = LogText(lastLogItem) End Sub #tag EndMethod #tag ComputedProperty, Flags = &h0 #tag Getter Get return mLogcursor End Get #tag EndGetter #tag Setter Set dim lastLogItem as integer = Ubound(LogText) mLogcursor = value if mLogcursor > lastLogItem then mLogcursor = lastLogItem if mLogcursor < 0 then mLogcursor = 0 self.CursorValue.Text = Str(LogCursor) End Set #tag EndSetter LogCursor As Integer #tag EndComputedProperty #tag Property, Flags = &h0 LogText(-1) As String #tag EndProperty #tag Property, Flags = &h21 Private mLogcursor As Integer #tag EndProperty #tag Property, Flags = &h21 Private ObjectDump As String #tag EndProperty #tag Constant, Name = kChordMarker, Type = String, Dynamic = False, Default = \"C", Scope = Private #tag EndConstant #tag Constant, Name = kCommandMarker, Type = String, Dynamic = False, Default = \"K", Scope = Private #tag EndConstant #tag Constant, Name = kGroupMarker, Type = String, Dynamic = False, Default = \"G", Scope = Private #tag EndConstant #tag Constant, Name = kMusicObjMarker, Type = String, Dynamic = False, Default = \"m", Scope = Private #tag EndConstant #tag Constant, Name = kNoteMarker, Type = String, Dynamic = False, Default = \"N", Scope = Private #tag EndConstant #tag Constant, Name = kParentMarker, Type = String, Dynamic = False, Default = \"p", Scope = Private #tag EndConstant #tag Constant, Name = kParentTrackMarker, Type = String, Dynamic = False, Default = \"t", Scope = Private #tag EndConstant #tag Constant, Name = kTab, Type = Double, Dynamic = False, Default = \"9", Scope = Private #tag EndConstant #tag Constant, Name = kTrackMarker, Type = String, Dynamic = False, Default = \"T", Scope = Private #tag EndConstant #tag Constant, Name = kUFOMarker, Type = String, Dynamic = False, Default = \"\?", Scope = Private #tag EndConstant #tag EndWindowCode #tag Events ShowAllButton #tag Event Sub Action() ShowCompleteLog End Sub #tag EndEvent #tag EndEvents #tag Events ShowLastButton #tag Event Sub Action() ShowLastLog End Sub #tag EndEvent #tag EndEvents #tag Events ClearLogButton #tag Event Sub Action() redim LogText(-1) LogCursor = Ubound(LogText) EditField1.Text = "" End Sub #tag EndEvent #tag EndEvents #tag Events UpDownArrows1 #tag Event Sub Down() LogCursor = LogCursor - 1 ShowCursorLog(LogCursor) End Sub #tag EndEvent #tag Event Sub Up() LogCursor = LogCursor + 1 ShowCursorLog(LogCursor) End Sub #tag EndEvent #tag EndEvents #tag Events LogObjects #tag Event Sub Action() dim ParentWindow as WindowEditor = WindowMgr.CurrentEditor ObjectDump = "" AppendObjectDump("Object Dump [" + Str(ObjectCount) + "]") DumpNoteMgr(ParentWindow) DumpTrackList(ParentWindow) EditField1.Text = ObjectDump Log(ObjectDump) End Sub #tag EndEvent #tag EndEvents
View
0 Windows/WindowMakeChord.rbfrm
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 Windows/WindowSaveConfirmation.rbfrm
Sorry, we could not display the changes to this file because there were too many other changes to display.

0 comments on commit 1694051

Please sign in to comment.
Something went wrong with that request. Please try again.