├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .jsbeautifyrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── grammars └── tidal.cson ├── keymaps └── tidal.json ├── lib ├── BootTidal.hs ├── autocomplete-provider.js ├── boot-tidal.js ├── config.js ├── console-view.js ├── editors.js ├── ghc.js ├── osc-loader.js ├── osc-server.js ├── pattern.js ├── process.js ├── repl.js ├── sound-browser.js ├── status.js ├── superdirt-startup.js ├── superdirt.js ├── superdirt_startup.scd ├── tidal-listener-repl.js └── tidalcycles.js ├── menus └── tidalcycles.json ├── package-lock.json ├── package.json ├── settings └── tidal.cson ├── spec ├── TestBootTidal.hs ├── autocomplete-provider-spec.js ├── boot-tidal-spec.js ├── ghc-spec.js └── repl-spec.js └── styles └── tidal.less /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | - push 5 | - pull_request 6 | 7 | jobs: 8 | test: 9 | strategy: 10 | matrix: 11 | os: [ubuntu-latest, macos-latest] 12 | fail-fast: false 13 | runs-on: ${{ matrix.os }} 14 | steps: 15 | - name: Checkout the Latest Package Code 16 | uses: actions/checkout@v3 17 | - name: Setup Pulsar Editor 18 | uses: pulsar-edit/action-pulsar-dependency@v3.2 19 | - name: Run the headless Pulsar Tests 20 | uses: coactions/setup-xvfb@v1.0.1 21 | with: 22 | run: pulsar --test spec 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | *.tidal 5 | .idea 6 | -------------------------------------------------------------------------------- /.jsbeautifyrc: -------------------------------------------------------------------------------- 1 | { 2 | "js": { 3 | "indent_size": 2, 4 | "indent_char": " ", 5 | "indent_level": 0, 6 | "indent_with_tabs": false, 7 | "preserve_newlines": true, 8 | "max_preserve_newlines": 2, 9 | "jslint_happy": true 10 | }, 11 | "json": { 12 | "indent_size": 2, 13 | "indent_char": " ", 14 | "indent_level": 0, 15 | "indent_with_tabs": false, 16 | "preserve_newlines": true, 17 | "max_preserve_newlines": 2, 18 | "jslint_happy": true 19 | }, 20 | "less": { 21 | "indent_char": " ", 22 | "indent_size": 2 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## v4.0.0 4 | * Rebranding from `atom` to `pulsar` 5 | * Configuration restructure. To adapt follow the instructions: 6 | * Open the `config.cson` file (Menu -> `Edit -> Config...`) 7 | * Cut the `tidalcycles:` block and paste it in a file somewhere 8 | * Restart the editor 9 | * Open the TidalCycles plugin configuration 10 | * Configure it as it was before using the file previously saved 11 | 12 | ## v3.16.39 13 | * Bump `dependency-tree` to 3.5.1 14 | 15 | ## v3.16.18 16 | * Support [pulsar](https://pulsar-edit.dev/) 17 | * Update `BootTidal.hs` 18 | 19 | ## v3.16.17 20 | * Fix autocomplete issue with tidal-listener #171 21 | 22 | ## v3.16.14 23 | * Handle multi pattern highlight visualization on tidal listener 24 | * Add detailed logs on ghc and BootTidal file loading 25 | 26 | ## v3.16.13 27 | * Improve tidal-listener highlight visualization 28 | 29 | ## v3.16.12 30 | * Introduced first version of code highlight with tidal-listener 31 | 32 | ## v3.16.11 33 | * Set superdirt autostart to false by default 34 | 35 | ## v3.16.10 36 | * Launch SuperDirt automatically inside Atom 37 | 38 | ## v3.16.9 39 | * Add code block indicators on editor in preparation to listener interface. 40 | 41 | ## v3.16.8 42 | * Fix syntax highlighting for `d10`, `d11`, `d12`... #154 43 | * Introduce new `tidal-listener` interpreter. #157 44 | 45 | ## v3.16.7 46 | * Fix osc eval 47 | 48 | ## v3.16.6 49 | * Change unmuteAll keybind to `ctrl-0` 50 | * Add toggle mute commands for connections from 10 to 11 with keybing `ctrl-shift-` 51 | * Console log tidal version on startup 52 | 53 | ## v3.16.5 54 | * Avoid throwing an error that's not an error 55 | 56 | ## v3.16.3 57 | * Fix a `tidalcycles:boot` bug 58 | * Improve some errors visualization 59 | 60 | ## v3.16.2 61 | * Fallback `BootTidal.hs` loading for paths containing whitespaces 62 | 63 | ## v3.16.1 64 | * Improves `mutes` visualization on console 65 | 66 | ## v3.16.0 67 | * Disable OSC eval server by default, could by enabled with configuration. 68 | * Toggle mute shortcuts with `CTRL-` and toggle mute all with `CTRL-SHIFT-.` 69 | 70 | ## v3.15.0 71 | * **BREAKING CHANGE**: in OSC eval now messages args have key-value structure (like SuperDirt), that interface is well explained in [README](README.md) 72 | * Show sample original file name in sound browser. 73 | * Fix: escape `#` in samples file name in sound browser 74 | 75 | ## v3.14.1 76 | * Improve sound browser UI 77 | 78 | ## v3.14.0 79 | * Introduce sound browser. 80 | 81 | ## v3.13.0 82 | * OSC eval: eval your code through OSC messages. 83 | 84 | ## v3.12.0 85 | * Show atom error notifications by default. Should help troubleshooting. Could be disabled in configuration. 86 | 87 | ## v3.11.0 88 | * Add `ctrl-alt-shift-enter` shortcut to evaluate all the code in the editor 89 | 90 | ## v3.10.1 91 | * Fix `#` syntax highlight #109 92 | 93 | ## v3.10.0 94 | * Add `ctrl-.` shortcut for hush command #102 95 | * Add Console prompt customization, including some placeholders (described in [README](README.md)) 96 | * Removed obsolete `filterPromptFromLogMessages` configuration, with console prompt customization, the prompt log message is always filtered. 97 | 98 | ## v3.9.0 99 | * Add interpreter configuration, to launch TidalCycles with *stack* or *nix* 100 | * In BootTidal.hs moved prompt-cont line to the end of the file to avoid problems with old version of GHC 101 | 102 | ## 0.12.0 - current directory boot file option 103 | 104 | * if selected, searches for a `BootTidal.hs` file in the current directory to use for booting Tidal. 105 | 106 | ## 0.11.0 - configurable boot file path 107 | 108 | * specify location of a custom Tidal boot file in settings 109 | 110 | 111 | ## 0.1.0 - First Release 112 | * Every feature added 113 | * Every bug fixed 114 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TidalCycles plugin for Pulsar 2 | 3 | ![CI](https://github.com/tidalcycles/pulsar-tidalcycles/actions/workflows/ci.yml/badge.svg?branch=master) 4 | 5 | [TidalCycles](https://tidalcycles.org) is a language for live coding algorithmic patterns. 6 | 7 | After TidalCycles installation (checkout [official documentation](https://tidalcycles.org/docs/) for details), 8 | 9 | Then, you can: 10 | * Open a `.tidal` file 11 | * `shift+enter` to evaluate the current line or selection 12 | * `(cmd/ctrl)+enter` to evaluate multiple-lines or selection 13 | * `ctrl+alt+shift+enter` to evaluate the whole editor 14 | * `ctrl+` to mute/unmute the connection 15 | * `ctrl+alt+` to mute/unmute the connection 1 16 | * `ctrl+0` to unmute all 17 | 18 | To send patterns to [SuperDirt](https://github.com/musikinformatik/SuperDirt), use `d1` .. `d9`, e.g.: 19 | ``` 20 | d1 $ sound "bd cp" 21 | ``` 22 | 23 | ## Configuration 24 | 25 | ### Interpreter 26 | You can choose between 3 Haskell interpreters: 27 | * Default: ghci installed with Cabal is the default choice 28 | * Stack: ghci installed with stack 29 | * Nix: ghci installed with nix 30 | 31 | ### GHCI Path 32 | 33 | By default the plugin will use the `ghci` and `ghc-pkg` binaries in $PATH configuration. 34 | 35 | You can configure your Haskell binary folder to use a different version of it. 36 | (Only works with *Default* interpreter) 37 | 38 | ### Boot Tidal Path 39 | 40 | The plugin will load the `BootTidal.hs` file according to this sequence: 41 | * if configured, the file set in the *Boot Tidal Path* configuration 42 | * if exists, the one in the current directory 43 | * if exists, the one in the current Tidal installation, given by the `ghc-pkg` binary configured with *Haskell Path* 44 | * the fallback choice is the one [included with the plugin](lib/BootTidal.hs) 45 | 46 | ### SuperDirt 47 | 48 | SuperDirt can be started automatically at the first tidal code evaluation. 49 | The plugin will use a `superdirt_startup.scp` if it's present into the current folder, otherwise it will use the [default startup command](./lib/superdirt_startup.scd). 50 | This feature can be disabled in configuration. 51 | 52 | ### Autocomplete 53 | You can turn on/off autocomplete with this option. 54 | 55 | #### Documentation details with Hoogle 56 | With [hoogle](https://github.com/ndmitchell/hoogle/blob/master/docs/Install.md) the autocomplete experience will improve and official tidal documentation will be shown. 57 | 58 | Install hoogle and set the *Hoogle Path* configuration (by default it's already `hoogle`) if you install it with `stack`, add two dashes at the end of the property (e.g. `stack hoogle --`). 59 | 60 | After installation you have to generate tidal documentation, in your terminal run:\ 61 | `hoogle generate tidal`\ 62 | or\ 63 | `stack hoogle -- generate tidal` (with stack) 64 | 65 | ### Console 66 | The console can be customized: 67 | 68 | #### Prompt 69 | Customize the console prompt with a string. 70 | Placeholders can be used, e.g. 71 | ``` 72 | eval #%ec 73 | ``` 74 | will prompt: 75 | ``` 76 | eval #1> 77 | eval #2> 78 | etc... 79 | ``` 80 | ##### Placeholders 81 | * *%ec*: eval count 82 | * *%ts*: current timestamp (unix format, seconds) 83 | * *%diff*: character comparison difference between last two evaluations 84 | 85 | #### Only Show Log When Errors 86 | Filter all the console log and show only errors 87 | 88 | #### Only Log Last Message 89 | Filter all the console old logs and show only the last one 90 | 91 | ### Osc Eval 92 | It's possibile to evaluate tidal code with OSC messages. 93 | 94 | #### Port 95 | The plugin is listening on this specified port for incoming osc messages: 96 | * Default Port: 3333 97 | 98 | #### Ip 99 | The plugin is listening on this ip address for incoming osc messages: 100 | 101 | * Default Ip: 127.0.0.1 102 | 103 | #### Address 104 | The plugin is filtering incoming osc messages with this specified address. 105 | * Default address: /pulsar/eval 106 | 107 | #### Arguments 108 | 109 | ##### Type 110 | Mandatory `type` argument to specify what kind of evaluation is requested: 111 | 1. line (evaluate single line) 112 | 2. multi_line (evaluate code block) 113 | 3. whole_editor (evaluate all the editor) 114 | 115 | ##### Row / Column 116 | `row` and `column` parameters can be specified to move the cursor on that position before the evaluation. 117 | 118 | ### Sound Browser 119 | To make the sound browser at the first tidal evaluation, add your paths to the `Sound Browser Folders` in the plugin configuration, separed by commas.\ For example, on macOS, the default SuperDirt samples are at \ 120 | `/Users//Library/Application Support/SuperCollider/downloaded-quarks/Dirt-Samples/` \ 121 | Restart editor (Pulsar) to apply changes. 122 | 123 | ### Other configurations 124 | * **Show error notifications**: show editor notifications on error 125 | 126 | ## Troubleshooting 127 | 128 | ### Some flags have not been recognized: prompt-cont 129 | The GHC version is too old (like 8.0.3). 130 | Solutions: 131 | * Comment, remove or bring to the end of the file the row `:set prompt-cont ""` in the `BootTidal.hs` file 132 | * Upgrade GHC (to at least 8.6) 133 | 134 | ### '' is not recognized as an internal or external command, operable program or batch file. 135 | The BootTidal.hs and ghci path cannot contain whitespace inside. 136 | Solutions: 137 | * put your scripts and the BootTidal.hs in a path that doesn't contain whitespaces. 138 | 139 | Note: this is fixed in GHC version 8.12 140 | 141 | ### Could not find module `Sound.Tidal.Context` 142 | The `BootTidal.hs` file is loaded correctly, but tidal is not installed or did not load correctly. Try restarting your editor. To install tidal, follow the documentation for your platform: \ 143 | [Documentation > Install Tidal](https://tidalcycles.org/docs/) 144 | 145 | ### Variable not in scope 146 | This could mean that the BootTidal.hs file you are using has a value not supported by the version of tidal you have installed. You can find the variable in the error message in your BootTidal.hs and comment out that line (using double hyphens). 147 | 148 | ## Contributing 149 | 150 | If you'd like to contribute to this package, here are some guidelines: 151 | 152 | ### JavaScript Formatting 153 | 154 | A `.jsbeautifyfc` file is used to define JavaScript formatting settings. Please use 155 | a beautifier package (we recommend `atom-beautify`) to format your changes with 156 | these settings. 157 | 158 | ### Specs 159 | Always run specs before open a PR. 160 | To run them: 161 | ```shell 162 | pulsar --test spec 163 | ``` 164 | -------------------------------------------------------------------------------- /grammars/tidal.cson: -------------------------------------------------------------------------------- 1 | 'scopeName': 'source.tidalcycles' 2 | 'fileTypes': [ 3 | 'tidalcycles', 'tidal' 4 | ] 5 | 'name': 'TidalCycles' 6 | 'patterns': [ 7 | { 8 | 'captures': 9 | '1': 10 | 'name': 'punctuation.definition.entity.haskell' 11 | '2': 12 | 'name': 'punctuation.definition.entity.haskell' 13 | 'comment': 'In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).' 14 | 'match': '(`)[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*(`)' 15 | 'name': 'keyword.operator.function.infix.haskell' 16 | } 17 | { 18 | 'match': '\\b(d[1-9][0-9]?)\\b' 19 | 'name': 'keyword.control.haskell' 20 | } 21 | { 22 | 'match': '\\(\\)' 23 | 'name': 'constant.language.unit.haskell' 24 | } 25 | { 26 | 'match': '\\[\\]' 27 | 'name': 'constant.language.empty-list.haskell' 28 | } 29 | { 30 | 'begin': '\\b(module)\\b' 31 | 'beginCaptures': 32 | '1': 33 | 'name': 'keyword.other.haskell' 34 | 'end': '(where)' 35 | 'endCaptures': 36 | '1': 37 | 'name': 'keyword.other.haskell' 38 | 'name': 'meta.declaration.module.haskell' 39 | 'patterns': [ 40 | { 41 | 'include': '#module_name' 42 | } 43 | { 44 | 'include': '#module_exports' 45 | } 46 | { 47 | 'match': '[a-z]+' 48 | 'name': 'invalid' 49 | } 50 | ] 51 | } 52 | { 53 | 'begin': '\\b(class)\\b' 54 | 'beginCaptures': 55 | '1': 56 | 'name': 'keyword.other.haskell' 57 | 'end': '\\b(where)\\b|$' 58 | 'endCaptures': 59 | '1': 60 | 'name': 'keyword.other.haskell' 61 | 'name': 'meta.declaration.class.haskell' 62 | 'patterns': [ 63 | { 64 | 'match': '\\b(Monad|Functor|Eq|Ord|Read|Show|Num|(Frac|Ra)tional|Enum|Bounded|Real(Frac|Float)?|Integral|Floating)\\b' 65 | 'name': 'support.class.prelude.haskell' 66 | } 67 | { 68 | 'match': '[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 69 | 'name': 'entity.other.inherited-class.haskell' 70 | } 71 | { 72 | 'match': '\\b[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 73 | 'name': 'variable.other.generic-type.haskell' 74 | } 75 | ] 76 | } 77 | { 78 | 'begin': '\\b(instance)\\b' 79 | 'beginCaptures': 80 | '1': 81 | 'name': 'keyword.other.haskell' 82 | 'end': '\\b(where)\\b|$' 83 | 'endCaptures': 84 | '1': 85 | 'name': 'keyword.other.haskell' 86 | 'name': 'meta.declaration.instance.haskell' 87 | 'patterns': [ 88 | { 89 | 'include': '#type_signature' 90 | } 91 | ] 92 | } 93 | { 94 | 'begin': '\\b(import)\\b' 95 | 'beginCaptures': 96 | '1': 97 | 'name': 'keyword.other.haskell' 98 | 'end': '($|;|(?=--))' 99 | 'name': 'meta.import.haskell' 100 | 'patterns': [ 101 | { 102 | 'match': '(qualified|as|hiding)' 103 | 'name': 'keyword.other.haskell' 104 | } 105 | { 106 | 'include': '#module_name' 107 | } 108 | { 109 | 'include': '#module_exports' 110 | } 111 | ] 112 | } 113 | { 114 | 'begin': '(deriving)\\s*\\(' 115 | 'beginCaptures': 116 | '1': 117 | 'name': 'keyword.other.haskell' 118 | 'end': '\\)' 119 | 'name': 'meta.deriving.haskell' 120 | 'patterns': [ 121 | { 122 | 'match': '\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 123 | 'name': 'entity.other.inherited-class.haskell' 124 | } 125 | ] 126 | } 127 | { 128 | 'match': '\\b(deriving|where|data|type|case|of|let|in|newtype|default)\\b' 129 | 'name': 'keyword.other.haskell' 130 | } 131 | { 132 | 'match': '\\binfix[lr]?\\b' 133 | 'name': 'keyword.operator.haskell' 134 | } 135 | { 136 | 'match': '\\b(do|if|then|else)\\b' 137 | 'name': 'keyword.control.haskell' 138 | } 139 | { 140 | 'comment': 'Floats are always decimal' 141 | 'match': '\\b([0-9]+\\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b' 142 | 'name': 'constant.numeric.float.haskell' 143 | } 144 | { 145 | 'match': '\\b([0-9]+|0([xX][0-9a-fA-F]+|[oO][0-7]+))\\b' 146 | 'name': 'constant.numeric.haskell' 147 | } 148 | { 149 | 'include': '#pragma' 150 | } 151 | { 152 | 'begin': '"' 153 | 'beginCaptures': 154 | '0': 155 | 'name': 'punctuation.definition.string.begin.haskell' 156 | 'end': '"' 157 | 'endCaptures': 158 | '0': 159 | 'name': 'punctuation.definition.string.end.haskell' 160 | 'name': 'string.quoted.double.haskell' 161 | 'patterns': [ 162 | { 163 | 'match': '\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&])' 164 | 'name': 'constant.character.escape.haskell' 165 | } 166 | { 167 | 'match': '\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+' 168 | 'name': 'constant.character.escape.octal.haskell' 169 | } 170 | { 171 | 'match': '\\^[A-Z@\\[\\]\\\\\\^_]' 172 | 'name': 'constant.character.escape.control.haskell' 173 | } 174 | ] 175 | } 176 | { 177 | 'captures': 178 | '1': 179 | 'name': 'punctuation.definition.string.begin.haskell' 180 | '2': 181 | 'name': 'constant.character.escape.haskell' 182 | '3': 183 | 'name': 'constant.character.escape.octal.haskell' 184 | '4': 185 | 'name': 'constant.character.escape.hexadecimal.haskell' 186 | '5': 187 | 'name': 'constant.character.escape.control.haskell' 188 | '6': 189 | 'name': 'punctuation.definition.string.end.haskell' 190 | 'match': '(?x)\n\t\t\t(\')\n\t\t\t(?:\n\t\t\t\t[\\ -\\[\\]-~]\t\t\t\t\t\t\t\t# Basic Char\n\t\t\t | (\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE\n\t\t\t\t\t|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS\n\t\t\t\t\t|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))\t\t# Escapes\n\t\t\t | (\\\\o[0-7]+)\t\t\t\t\t\t\t\t# Octal Escapes\n\t\t\t | (\\\\x[0-9A-Fa-f]+)\t\t\t\t\t\t# Hexadecimal Escapes\n\t\t\t | (\\^[A-Z@\\[\\]\\\\\\^_])\t\t\t\t\t\t# Control Chars\n\t\t\t)\n\t\t\t(\')\n\t\t\t' 191 | 'name': 'string.quoted.single.haskell' 192 | } 193 | { 194 | 'begin': '^\\s*(?(?:[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*|\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_"\']]+\\))(?:\\s*,\\s*\\g)?)\\s*(::|∷)' 195 | 'beginCaptures': 196 | '1': 197 | 'patterns': [ 198 | { 199 | 'match': '[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 200 | 'name': 'entity.name.function.haskell' 201 | } 202 | { 203 | 'include': '#infix_op' 204 | } 205 | ] 206 | '2': 207 | 'name': 'keyword.other.double-colon.haskell' 208 | 'end': '$\\n?' 209 | 'name': 'meta.function.type-declaration.haskell' 210 | 'patterns': [ 211 | { 212 | 'include': '#type_signature' 213 | } 214 | ] 215 | } 216 | { 217 | 'match': '\\b(Just|Nothing|Left|Right|True|False|LT|EQ|GT|\\(\\)|\\[\\])\\b' 218 | 'name': 'support.constant.haskell' 219 | } 220 | { 221 | 'match': '\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 222 | 'name': 'constant.other.haskell' 223 | } 224 | { 225 | 'include': '#comments' 226 | } 227 | { 228 | 'match': '\\b(abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\\b' 229 | 'name': 'support.function.prelude.haskell' 230 | } 231 | { 232 | 'include': '#infix_op' 233 | } 234 | { 235 | 'comment': 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' 236 | 'match': '[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_"\']]+' 237 | 'name': 'keyword.operator.haskell' 238 | } 239 | { 240 | 'match': ',' 241 | 'name': 'punctuation.separator.comma.haskell' 242 | } 243 | ] 244 | 'repository': 245 | 'block_comment': 246 | 'applyEndPatternLast': 1 247 | 'begin': '\\{-(?!#)' 248 | 'captures': 249 | '0': 250 | 'name': 'punctuation.definition.comment.haskell' 251 | 'end': '-\\}' 252 | 'name': 'comment.block.haskell' 253 | 'patterns': [ 254 | { 255 | 'include': '#block_comment' 256 | } 257 | ] 258 | 'comments': 259 | 'patterns': [ 260 | { 261 | 'begin': '(^[ \\t]+)?(?=--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_"\']]))' 262 | 'beginCaptures': 263 | '1': 264 | 'name': 'punctuation.whitespace.comment.leading.haskell' 265 | 'comment': 'Operators may begin with \'--\' as long as they are not entirely composed of \'-\' characters. This means comments can\'t be immediately followed by an allowable operator character.' 266 | 'end': '(?!\\G)' 267 | 'patterns': [ 268 | { 269 | 'begin': '--' 270 | 'beginCaptures': 271 | '0': 272 | 'name': 'punctuation.definition.comment.haskell' 273 | 'end': '\\n' 274 | 'name': 'comment.line.double-dash.haskell' 275 | } 276 | ] 277 | } 278 | { 279 | 'include': '#block_comment' 280 | } 281 | ] 282 | 'infix_op': 283 | 'comment': 'An operator cannot be composed entirely of \'-\' characters; instead, it should be matched as a comment.' 284 | 'match': '(\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_"\']]+\\)|\\(,+\\))' 285 | 'name': 'entity.name.function.infix.haskell' 286 | 'module_exports': 287 | 'begin': '\\(' 288 | 'end': '\\)' 289 | 'name': 'meta.declaration.exports.haskell' 290 | 'patterns': [ 291 | { 292 | 'match': '\\b[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 293 | 'name': 'entity.name.function.haskell' 294 | } 295 | { 296 | 'match': '\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 297 | 'name': 'storage.type.haskell' 298 | } 299 | { 300 | 'match': ',' 301 | 'name': 'punctuation.separator.comma.haskell' 302 | } 303 | { 304 | 'include': '#infix_op' 305 | } 306 | { 307 | 'comment': 'So named because I don\'t know what to call this.' 308 | 'match': '\\(.*?\\)' 309 | 'name': 'meta.other.unknown.haskell' 310 | } 311 | ] 312 | 'module_name': 313 | 'match': '(?[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*(\\.\\g)?)' 314 | 'name': 'support.other.module.haskell' 315 | 'pragma': 316 | 'begin': '\\{-#' 317 | 'end': '#-\\}' 318 | 'name': 'meta.preprocessor.haskell' 319 | 'patterns': [ 320 | { 321 | 'match': '\\b(LANGUAGE|UNPACK|INLINE)\\b' 322 | 'name': 'keyword.other.preprocessor.haskell' 323 | } 324 | ] 325 | 'type_signature': 326 | 'patterns': [ 327 | { 328 | 'captures': 329 | '1': 330 | 'name': 'entity.other.inherited-class.haskell' 331 | '2': 332 | 'name': 'variable.other.generic-type.haskell' 333 | '3': 334 | 'name': 'keyword.other.big-arrow.haskell' 335 | 'match': '\\(\\s*([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*)\\s+([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*)\\)\\s*(=>)' 336 | 'name': 'meta.class-constraint.haskell' 337 | } 338 | { 339 | 'include': '#pragma' 340 | } 341 | { 342 | 'match': '->' 343 | 'name': 'keyword.other.arrow.haskell' 344 | } 345 | { 346 | 'match': '→' 347 | 'name': 'keyword.other.arrow.haskell' 348 | } 349 | { 350 | 'match': '=>' 351 | 'name': 'keyword.other.big-arrow.haskell' 352 | } 353 | { 354 | 'match': '⇒' 355 | 'name': 'keyword.other.big-arrow.haskell' 356 | } 357 | { 358 | 'match': '\\b(Int(eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(Error)?)\\b' 359 | 'name': 'support.type.prelude.haskell' 360 | } 361 | { 362 | 'match': '\\b[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 363 | 'name': 'variable.other.generic-type.haskell' 364 | } 365 | { 366 | 'match': '\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\']*' 367 | 'name': 'storage.type.haskell' 368 | } 369 | { 370 | 'match': '\\(\\)' 371 | 'name': 'support.constant.unit.haskell' 372 | } 373 | { 374 | 'include': '#comments' 375 | } 376 | ] 377 | -------------------------------------------------------------------------------- /keymaps/tidal.json: -------------------------------------------------------------------------------- 1 | { 2 | "atom-workspace atom-text-editor[data-grammar~='tidalcycles']": { 3 | "shift-enter": "tidalcycles:eval", 4 | "alt-shift-enter": "tidalcycles:eval-copy", 5 | "ctrl-shift-alt-enter": "tidalcycles:eval-whole-editor", 6 | "cmd-enter": "tidalcycles:eval-multi-line", 7 | "ctrl-enter": "tidalcycles:eval-multi-line", 8 | "alt-cmd-enter": "tidalcycles:eval-multi-line-copy", 9 | "alt-ctrl-enter": "tidalcycles:eval-multi-line-copy", 10 | "ctrl-.": "tidalcycles:hush", 11 | "cmd-.": "tidalcycles:hush", 12 | "shift-cmd-h": "tidalcycles:hush", 13 | "shift-ctrl-h": "tidalcycles:hush", 14 | "ctrl-0": "tidalcycles:unmuteAll", 15 | "ctrl-1": "tidalcycles:toggle-mute-1", 16 | "ctrl-2": "tidalcycles:toggle-mute-2", 17 | "ctrl-3": "tidalcycles:toggle-mute-3", 18 | "ctrl-4": "tidalcycles:toggle-mute-4", 19 | "ctrl-5": "tidalcycles:toggle-mute-5", 20 | "ctrl-6": "tidalcycles:toggle-mute-6", 21 | "ctrl-7": "tidalcycles:toggle-mute-7", 22 | "ctrl-8": "tidalcycles:toggle-mute-8", 23 | "ctrl-9": "tidalcycles:toggle-mute-9", 24 | "ctrl-alt-0": "tidalcycles:toggle-mute-10", 25 | "ctrl-alt-1": "tidalcycles:toggle-mute-11", 26 | "ctrl-alt-2": "tidalcycles:toggle-mute-12", 27 | "ctrl-alt-3": "tidalcycles:toggle-mute-13", 28 | "ctrl-alt-4": "tidalcycles:toggle-mute-14", 29 | "ctrl-alt-5": "tidalcycles:toggle-mute-15", 30 | "ctrl-alt-6": "tidalcycles:toggle-mute-16" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/BootTidal.hs: -------------------------------------------------------------------------------- 1 | :set -XOverloadedStrings 2 | :set prompt "" 3 | 4 | import Sound.Tidal.Context 5 | 6 | import System.IO (hSetEncoding, stdout, utf8) 7 | hSetEncoding stdout utf8 8 | 9 | tidal <- startTidal (superdirtTarget {oLatency = 0.05, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cVerbose = True, cFrameTimespan = 1/20}) 10 | 11 | :{ 12 | let only = (hush >>) 13 | p = streamReplace tidal 14 | hush = streamHush tidal 15 | panic = do hush 16 | once $ sound "superpanic" 17 | list = streamList tidal 18 | mute = streamMute tidal 19 | unmute = streamUnmute tidal 20 | unmuteAll = streamUnmuteAll tidal 21 | unsoloAll = streamUnsoloAll tidal 22 | solo = streamSolo tidal 23 | unsolo = streamUnsolo tidal 24 | once = streamOnce tidal 25 | first = streamFirst tidal 26 | asap = once 27 | nudgeAll = streamNudgeAll tidal 28 | all = streamAll tidal 29 | resetCycles = streamResetCycles tidal 30 | setCycle = streamSetCycle tidal 31 | setcps = asap . cps 32 | getcps = streamGetcps tidal 33 | getnow = streamGetnow tidal 34 | xfade i = transition tidal True (Sound.Tidal.Transition.xfadeIn 4) i 35 | xfadeIn i t = transition tidal True (Sound.Tidal.Transition.xfadeIn t) i 36 | histpan i t = transition tidal True (Sound.Tidal.Transition.histpan t) i 37 | wait i t = transition tidal True (Sound.Tidal.Transition.wait t) i 38 | waitT i f t = transition tidal True (Sound.Tidal.Transition.waitT f t) i 39 | jump i = transition tidal True (Sound.Tidal.Transition.jump) i 40 | jumpIn i t = transition tidal True (Sound.Tidal.Transition.jumpIn t) i 41 | jumpIn' i t = transition tidal True (Sound.Tidal.Transition.jumpIn' t) i 42 | jumpMod i t = transition tidal True (Sound.Tidal.Transition.jumpMod t) i 43 | jumpMod' i t p = transition tidal True (Sound.Tidal.Transition.jumpMod' t p) i 44 | mortal i lifespan release = transition tidal True (Sound.Tidal.Transition.mortal lifespan release) i 45 | interpolate i = transition tidal True (Sound.Tidal.Transition.interpolate) i 46 | interpolateIn i t = transition tidal True (Sound.Tidal.Transition.interpolateIn t) i 47 | clutch i = transition tidal True (Sound.Tidal.Transition.clutch) i 48 | clutchIn i t = transition tidal True (Sound.Tidal.Transition.clutchIn t) i 49 | anticipate i = transition tidal True (Sound.Tidal.Transition.anticipate) i 50 | anticipateIn i t = transition tidal True (Sound.Tidal.Transition.anticipateIn t) i 51 | forId i t = transition tidal False (Sound.Tidal.Transition.mortalOverlay t) i 52 | d1 = p 1 . (|< orbit 0) 53 | d2 = p 2 . (|< orbit 1) 54 | d3 = p 3 . (|< orbit 2) 55 | d4 = p 4 . (|< orbit 3) 56 | d5 = p 5 . (|< orbit 4) 57 | d6 = p 6 . (|< orbit 5) 58 | d7 = p 7 . (|< orbit 6) 59 | d8 = p 8 . (|< orbit 7) 60 | d9 = p 9 . (|< orbit 8) 61 | d10 = p 10 . (|< orbit 9) 62 | d11 = p 11 . (|< orbit 10) 63 | d12 = p 12 . (|< orbit 11) 64 | d13 = p 13 65 | d14 = p 14 66 | d15 = p 15 67 | d16 = p 16 68 | :} 69 | 70 | :{ 71 | let getState = streamGet tidal 72 | setI = streamSetI tidal 73 | setF = streamSetF tidal 74 | setS = streamSetS tidal 75 | setR = streamSetR tidal 76 | setB = streamSetB tidal 77 | :} 78 | 79 | :set prompt "tidal> " 80 | :set prompt-cont "" 81 | 82 | default (Pattern String, Integer, Double) 83 | -------------------------------------------------------------------------------- /lib/autocomplete-provider.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | const child_process = require('child_process') 4 | const Ghc = require('./ghc'); 5 | 6 | export default class AutocompleteProvider { 7 | 8 | constructor(ghc) { 9 | this.selector = '.source.tidalcycles'; 10 | this.hooglePath = atom.config.get('tidalcycles.hooglePath') 11 | this.suggestions = [] 12 | if (atom.config.get('tidalcycles.autocomplete')) { 13 | ghc.browseTidal(output => { 14 | this.suggestions = this.parse(output) 15 | }) 16 | } 17 | } 18 | 19 | getSuggestions(options) { 20 | const { prefix } = options; 21 | return this.suggestions 22 | .filter(suggestion => { 23 | let textLower = suggestion.text.toLowerCase(); 24 | return textLower.startsWith(prefix.toLowerCase()); 25 | }); 26 | } 27 | 28 | getSuggestionDetailsOnSelect(suggestion) { 29 | return new Promise((resolve, _) => { 30 | try { 31 | let documentation = child_process 32 | .execSync(`${this.hooglePath} -i "${suggestion.rightLabel}.${suggestion.text}"`) 33 | .toString().trim() 34 | 35 | if (documentation !== 'No results found') { 36 | suggestion.description = documentation 37 | } 38 | resolve(suggestion) 39 | } catch (err) { 40 | resolve(suggestion) 41 | } 42 | }) 43 | } 44 | 45 | parse(exportedIdentifiers) { 46 | let functions = exportedIdentifiers 47 | .split("\n") 48 | .reduce((acc, cur) => 49 | cur.startsWith(" ") 50 | ? acc + ' ' + cur.trim() 51 | : acc + '\n' + cur 52 | ) 53 | 54 | return functions 55 | .split("\n") 56 | .filter(row => row.indexOf('::') > -1) 57 | .map(row => { 58 | let fields = row.split('::') 59 | let functionPath = fields[0].trim().replace("(", "").replace(")", "") 60 | let functionName = functionPath.substring(functionPath.lastIndexOf('.') + 1) 61 | return { 62 | text: functionPath.substring(functionPath.lastIndexOf('.') + 1), 63 | snippet: `${functionName} `, 64 | description: fields[1].trim(), 65 | type: 'function', 66 | rightLabel: functionPath.substring(0, functionPath.lastIndexOf('.')), 67 | } 68 | }) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/boot-tidal.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | 6 | const bootTidalPathProperty = 'tidalcycles.bootTidalPath' 7 | const defaultBootFileName = 'BootTidal.hs'; 8 | const defaultBootFilePath = __dirname + path.sep + defaultBootFileName; 9 | 10 | export default class BootTidal { 11 | 12 | constructor(ghc, rootDirectories, consoleView) { 13 | this.ghc = ghc 14 | this.rootDirectories = rootDirectories 15 | this.consoleView = consoleView 16 | } 17 | 18 | choosePath() { 19 | this.consoleView.appendLog(`Choose BootTidal.hs path`) 20 | const configuredBootFilePath = atom.config.get(bootTidalPathProperty); 21 | if (configuredBootFilePath) { 22 | this.consoleView.appendLog(` * custom path configured`) 23 | return configuredBootFilePath 24 | } else { 25 | this.consoleView.appendLog(` > no custom path configured`) 26 | } 27 | 28 | const currentDirectoryPath = this.rootDirectories.length > 0 ? 29 | this.rootDirectories[0].path + path.sep + defaultBootFileName : 30 | null; 31 | 32 | if (fs.existsSync(currentDirectoryPath)) { 33 | this.consoleView.appendLog(` * found in the current directory`) 34 | return currentDirectoryPath; 35 | } else { 36 | this.consoleView.appendLog(` > not found in current directory`) 37 | } 38 | 39 | try { 40 | let tidalBootPath = path.join(this.ghc.tidalDataDir(), defaultBootFileName) 41 | if (fs.existsSync(tidalBootPath)) { 42 | this.consoleView.appendLog(` * found in the tidal installation folder`) 43 | return tidalBootPath 44 | } else { 45 | this.consoleView.appendLog(` > not found in the tidal installation folder`) 46 | } 47 | } catch (err) { 48 | this.consoleView.appendLog(` > cannot get tidal installation folder ${err.toString().trim()}`) 49 | } 50 | 51 | this.consoleView.appendLog(` * use the default contained in the plugin`) 52 | return defaultBootFilePath 53 | 54 | } 55 | 56 | blocks() { 57 | return fs.readFileSync(this.choosePath(), { encoding: 'utf8'}) 58 | .split('\n\n') 59 | .map(block => block.replace(":{", "").replace(":}", "")) 60 | .flatMap(block => block.startsWith(":set") 61 | ? block.split("\n") 62 | : [block] 63 | ) 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /lib/config.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | export default { 4 | 'interpreter': { 5 | type: 'string', 6 | default: 'default', 7 | enum: [ 8 | { value: 'default', description: 'Default (ghc installed through cabal)' }, 9 | { value: 'stack', description: 'Stack' }, 10 | { value: 'nix', description: 'Nix' }, 11 | { value: 'listener', description: 'tidal-listener' } 12 | ], 13 | order: 0 14 | }, 15 | 'ghciPath': { 16 | type: 'string', 17 | default: '', 18 | description: 'Haskell (ghci) path, needed only for the "Default" interpreter', 19 | order: 10 20 | }, 21 | 'bootTidalPath': { 22 | type: 'string', 23 | default: '', 24 | order: 20 25 | }, 26 | 'superDirt': { 27 | type: 'object', 28 | properties: { 29 | 'autostart': { 30 | description: 'Start SuperDirt at startup', 31 | type: 'boolean', 32 | default: false, 33 | order: 25 34 | }, 35 | } 36 | }, 37 | 'autocomplete': { 38 | type: 'boolean', 39 | default: true, 40 | description: 'Autocomplete code', 41 | order: 30 42 | }, 43 | 'hooglePath': { 44 | type: 'string', 45 | default: 'hoogle', 46 | description: 'Path of hoogle command, needed for documentation on autocomplete', 47 | order: 40 48 | }, 49 | 'console': { 50 | type: 'object', 51 | properties: { 52 | 'prompt': { 53 | type: 'string', 54 | default: 't', 55 | description: `Prompt. Look at the docs for available placeholders`, 56 | order: 50 57 | }, 58 | 'onlyShowLogWhenErrors': { 59 | type: 'boolean', 60 | default: false, 61 | description: 'Only show console if last message was an error.', 62 | order: 55 63 | }, 64 | 'onlyLogLastMessage': { 65 | type: 'boolean', 66 | default: false, 67 | description: 'Only log last message to the console.', 68 | order: 60 69 | }, 70 | } 71 | }, 72 | 'showErrorNotifications': { 73 | type: 'boolean', 74 | default: true, 75 | description: 'Show editor notifications on error.', 76 | order: 70 77 | }, 78 | 'oscEval': { 79 | type: 'object', 80 | title: 'OSC eval', 81 | description: 'Eval code through OSC messages', 82 | properties: { 83 | 'enable': { 84 | type: 'boolean', 85 | default: false, 86 | title: 'enable', 87 | description: `Check to enable OSC eval code server.`, 88 | order: 75 89 | }, 90 | 'ip': { 91 | type: 'string', 92 | default: '127.0.0.1', 93 | title: 'ip', 94 | description: `OSC ip address for receiving eval messages.`, 95 | order: 79 96 | }, 97 | 'port': { 98 | type: 'integer', 99 | default: 3333, 100 | title: 'port', 101 | description: `OSC port for receiving eval messages.`, 102 | order: 80 103 | }, 104 | 'address': { 105 | type: 'string', 106 | default: '/pulsar/eval', 107 | title: 'address', 108 | description: `OSC address for receiving eval messages. Expected arguments are 'line', 'multi_line' and 'whole_editor'.`, 109 | order: 82 110 | }, 111 | } 112 | }, 113 | 'soundBrowser': { 114 | type: 'object', 115 | title: 'Sound Browser', 116 | description: 'Show samples folder and permits to listen to them in advance.', 117 | properties: { 118 | 'folders': { 119 | type: 'array', 120 | default: [], 121 | description: 'Folders which must be shown in the sound browser, separed by comma. Restart the editor to apply changes', 122 | order: 90, 123 | items: { 124 | type: 'string' 125 | } 126 | } 127 | } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /lib/console-view.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | export default class ConsoleView { 4 | 5 | element = null; 6 | log = null; 7 | 8 | constructor(status) { 9 | this.status = status 10 | this.rows = [] 11 | } 12 | 13 | initUI() { 14 | if (this.element) return; 15 | 16 | this.element = document.createElement('div'); 17 | this.element.setAttribute('tabindex', -1); 18 | this.element.classList.add('tidalcycles', 'console', 'native-key-bindings'); 19 | this.element.setAttribute('style', 'overflow-y: scroll;') 20 | 21 | this.log = document.createElement('div'); 22 | this.element.appendChild(this.log); 23 | 24 | atom.workspace.open({ 25 | element: this.element, 26 | getTitle: () => 'TidalCycles', 27 | getURI: () => 'atom://tidalcycles/console-view', 28 | getDefaultLocation: () => 'bottom' 29 | }, { activatePane: false }); 30 | 31 | atom.workspace.getBottomDock().show() 32 | } 33 | 34 | prompt() { 35 | return atom.config.get('tidalcycles.console.prompt') 36 | .replace("%ec", this.status.evalCount()) 37 | .replace("%ts", this.status.timestamp()) 38 | .replace("%diff", this.status.diff()) 39 | + "> " 40 | } 41 | 42 | logPromptOut(text) { 43 | this.logStdout(this.prompt() + text); 44 | } 45 | 46 | logPromptErr(text) { 47 | this.logStderr(this.prompt() + text); 48 | } 49 | 50 | logStdout(text) { 51 | this.logText(text); 52 | } 53 | 54 | logStderr(text) { 55 | this.logText(text, true); 56 | 57 | if (atom.config.get('tidalcycles.showErrorNotifications')) { 58 | atom.notifications.addError(text) 59 | } 60 | } 61 | 62 | appendLog(text) { 63 | this.rows.push(text) 64 | } 65 | 66 | flushLog() { 67 | let text = this.rows.join('
') 68 | this.rows = [] 69 | this.logText(text) 70 | } 71 | 72 | logText(text, error) { 73 | if (!text) return; 74 | var pre = document.createElement("pre"); 75 | if (error) { 76 | pre.className = "error"; 77 | } 78 | 79 | if (atom.config.get('tidalcycles.console.onlyLogLastMessage')) { 80 | this.log.innerHTML = ""; 81 | } 82 | pre.innerHTML = text; 83 | this.log.appendChild(pre); 84 | 85 | if (!error && atom.config.get('tidalcycles.console.onlyShowLogWhenErrors')) { 86 | this.element.classList.add('hidden'); 87 | } else { 88 | this.element.classList.remove('hidden'); 89 | } 90 | 91 | this.element.scrollTop = this.element.scrollHeight; 92 | } 93 | 94 | logMutes(mutes, lastCommand) { 95 | let statusLine = Object.entries(mutes) 96 | .map(entry => entry[1] ? entry[0] : mark(entry[0])) 97 | .join(' | ') 98 | 99 | this.logPromptOut(`[${lastCommand}] - ${statusLine}`) 100 | } 101 | 102 | // it's needed for package serialization 103 | serialize() { } 104 | 105 | destroy() { 106 | this.element.remove(); 107 | } 108 | } 109 | 110 | const mark = (string) =>`${string}` 111 | -------------------------------------------------------------------------------- /lib/editors.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | const EventEmitter = require('events'); 4 | import { Point } from 'atom' 5 | 6 | export const LINE = 'line' 7 | export const MULTI_LINE = 'multi_line' 8 | export const WHOLE_EDITOR = 'whole_editor' 9 | 10 | export class Editors extends EventEmitter { 11 | 12 | constructor() { 13 | super(); 14 | 15 | atom.workspace.observeTextEditors(editor => { 16 | if (this.isTidal(editor)) { 17 | let newLineCount = editor.getLineCount(); 18 | this.decorateCodeBlocks(editor); 19 | this.lineCount = newLineCount; 20 | 21 | editor.onDidChange(() => { 22 | let newLineCount = editor.getLineCount(); 23 | if (newLineCount !== this.lineCount) { 24 | this.decorateCodeBlocks(editor); 25 | this.lineCount = newLineCount; 26 | } 27 | }) 28 | } 29 | }) 30 | } 31 | 32 | currentIsTidal() { 33 | return this.isTidal(currentEditor()) 34 | } 35 | 36 | isTidal(editor) { 37 | if (!editor) { 38 | return false 39 | } else { 40 | return editor.getGrammar().scopeName === 'source.tidalcycles' 41 | } 42 | } 43 | 44 | currentEvaluations(evalType) { 45 | let editor = currentEditor(); 46 | if (!editor) return; 47 | 48 | var selection = editor.getLastSelection(); 49 | var expression = selection.getText(); 50 | 51 | if (expression) { 52 | var range = selection.getBufferRange(); 53 | return [{ expression, range }]; 54 | } else { 55 | switch (evalType) { 56 | case LINE: 57 | return this.getLineExpression(editor); 58 | case MULTI_LINE: 59 | return this.getMultiLineExpression(editor); 60 | case WHOLE_EDITOR: 61 | return this.getWholeEditorExpressions(editor); 62 | default: 63 | return this.getWholeEditorExpressions(editor); 64 | } 65 | } 66 | } 67 | 68 | evalFlash(range) { 69 | var editor = currentEditor(); 70 | var marker = editor.markBufferRange(range, { 71 | invalidate: 'touch' 72 | }); 73 | 74 | var decoration = editor.decorateMarker( 75 | marker, { 76 | type: 'line', 77 | class: 'eval-flash' 78 | }); 79 | 80 | // return fn to flash error / success and destroy the flash 81 | return function(cssClass) { 82 | decoration.setProperties({ 83 | type: 'line', 84 | class: cssClass 85 | }); 86 | 87 | setTimeout(() => marker.destroy(), 120); 88 | }; 89 | } 90 | 91 | copyRange(range) { 92 | var editor = currentEditor(); 93 | var endRow = range.end.row; 94 | endRow++ 95 | var text = editor.getTextInBufferRange(range); 96 | text = '\n' + text + '\n'; 97 | 98 | if (endRow > editor.getLastBufferRow()) { 99 | text = '\n' + text 100 | } 101 | 102 | editor.getBuffer().insert([endRow, 0], text); 103 | } 104 | 105 | goTo(row, column) { 106 | currentEditor().setCursorBufferPosition([row, column]) 107 | } 108 | 109 | getLineExpression(editor) { 110 | var cursor = editor.getCursors()[0]; 111 | var range = cursor.getCurrentLineBufferRange(); 112 | var expression = range && editor.getTextInBufferRange(range); 113 | return [{ expression, range }]; 114 | } 115 | 116 | getMultiLineExpression(editor) { 117 | var range = this.getCurrentParagraphIncludingComments(editor); 118 | var expression = editor.getTextInBufferRange(range); 119 | return [{ expression, range }]; 120 | } 121 | 122 | getWholeEditorExpressions(editor) { 123 | let wholeEditor = { 124 | start: { row: 0, column: 0 }, 125 | end: { row: editor.getLineCount(), column: 0 } 126 | } 127 | let expression = editor.getTextInBufferRange(wholeEditor); 128 | return expression.split('\n') 129 | .reduce((blocks, item, index) => { 130 | if (item.trim().length === 0) { 131 | blocks.push({ rows: [] }) 132 | } else { 133 | let block = blocks[blocks.length - 1] 134 | if (block.start === undefined) { 135 | block.start = index 136 | } 137 | block.rows.push(item) 138 | blocks[blocks.length - 1] = block 139 | } 140 | 141 | return blocks 142 | }, [{ rows: [] }]) 143 | .filter(block => block.rows.length > 0) 144 | .map((block, index) => { 145 | return { 146 | id: `d${index}`, 147 | expression: block.rows.join('\n'), 148 | range: { 149 | start: { row: block.start, column: 0}, 150 | end: { row: block.start + block.rows.length, column: 0}, 151 | } 152 | } 153 | }) 154 | } 155 | 156 | getCurrentParagraphIncludingComments(editor) { 157 | var cursor = editor.getLastCursor(); 158 | var startRow = cursor.getBufferRow(); 159 | var endRow = startRow 160 | var lineCount = editor.getLineCount(); 161 | 162 | // lines must include non-whitespace characters 163 | // and not be outside editor bounds 164 | while (/\S/.test(editor.lineTextForBufferRow(startRow)) && startRow >= 0) { 165 | startRow--; 166 | } 167 | while (/\S/.test(editor.lineTextForBufferRow(endRow)) && endRow < lineCount) { 168 | endRow++; 169 | } 170 | return { 171 | start: { 172 | row: startRow + 1, 173 | column: 0 174 | }, 175 | end: { 176 | row: endRow, 177 | column: 0 178 | }, 179 | }; 180 | } 181 | 182 | decorateCodeBlocks(editor) { 183 | editor.getDecorations({ type: 'line-number' }) 184 | .forEach(decoration => decoration.destroy()) 185 | 186 | this.getWholeEditorExpressions(editor) 187 | .map(it => it.range) 188 | .map(range => [[range.start.row, 0], [range.end.row, 0]]) 189 | .map(range => editor.markBufferRange(range, { invalidate: 'never' })) 190 | .map(marker => editor.decorateMarker(marker, { type: 'line-number', class: 'cursor-line' })) 191 | } 192 | 193 | currentEditor() { 194 | return currentEditor() 195 | } 196 | 197 | } 198 | 199 | let currentEditor = () => atom.workspace.getActiveTextEditor() 200 | -------------------------------------------------------------------------------- /lib/ghc.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | const path = require('path') 4 | const fs = require('fs') 5 | const os = require('os') 6 | const Process = require('./process') 7 | 8 | const child_process = require('child_process'); 9 | const ghciPathProperty = 'tidalcycles.ghciPath' 10 | const interpreterProperty = 'tidalcycles.interpreter' 11 | 12 | const stackPrefix = 'stack exec --package tidal' 13 | const nixPrefix = 'nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.tidal])" --run' 14 | 15 | export default class Ghc { 16 | 17 | constructor(consoleView) { 18 | this.consoleView = consoleView; 19 | } 20 | 21 | init() { 22 | switch (atom.config.get(interpreterProperty)) { 23 | case 'stack': 24 | this.interactivePath = `${stackPrefix} ghci` 25 | this.pkgPath = `${stackPrefix} ghc-pkg` 26 | break; 27 | case 'nix': 28 | this.interactivePath = `${nixPrefix} ghci` 29 | this.pkgPath = `${nixPrefix} "ghc-pkg"` 30 | break; 31 | default: 32 | let basePath = this.ghcBasePath(); 33 | this.consoleView.flushLog() 34 | if (basePath.startsWith('stack') || basePath.startsWith('nix-shell')) { 35 | this.interactivePath = basePath + "ghci" 36 | this.pkgPath = basePath + "ghc-pkg" 37 | } else { 38 | this.interactivePath = path.join(basePath, "ghci") 39 | this.pkgPath = path.join(basePath, "ghc-pkg") 40 | } 41 | } 42 | this.consoleView 43 | .logStdout(`Ghci command: ${this.interactivePath}\nGhc-pkg command: ${this.pkgPath}`) 44 | } 45 | 46 | interactive() { 47 | return Process.ghci(this.wrappedInteractivePath()); 48 | } 49 | 50 | browseTidal(callback) { 51 | child_process.exec(`echo ":browse Sound.Tidal.Context" | ${this.wrappedInteractivePath()}`, 52 | (error, stdout) => { 53 | if (error) { 54 | this.consoleView.logStderr(`Cannot browse tidal to obtain informations for autocomplete: ${error}`) 55 | } else { 56 | callback(stdout) 57 | } 58 | 59 | }) 60 | } 61 | 62 | pkg(args) { 63 | let command = ((interpreter => { 64 | switch(interpreter) { 65 | case 'stack': return `${stackPrefix} ghc-pkg ${args}` 66 | case 'nix': return `${nixPrefix} "ghc-pkg ${args}"` 67 | default: return `"${this.pkgPath}" ${args}` 68 | } 69 | }))(atom.config.get(interpreterProperty)); 70 | 71 | return child_process 72 | .execSync(command) 73 | .toString().trim() 74 | } 75 | 76 | tidalDataDir() { 77 | let dataDir = this.pkg('field tidal data-dir').trim() 78 | 79 | return dataDir.substring(dataDir.indexOf(' ') + 1) 80 | } 81 | 82 | ghcBasePath() { 83 | let propertyValue = atom.config.get(ghciPathProperty) 84 | this.consoleView.appendLog(`Choose ghc base path`) 85 | if (propertyValue) { 86 | this.consoleView.appendLog(` * custom path configured`) 87 | let resolvedPropertyValue = propertyValue.replace('~', os.homedir()) 88 | return resolvedPropertyValue.endsWith('ghci') 89 | ? resolvedPropertyValue.substring(0, resolvedPropertyValue.length - 4) 90 | : resolvedPropertyValue 91 | } else { 92 | this.consoleView.appendLog(` > no custom path configured`) 93 | let ghcupPath = path.join(os.homedir(), ".ghcup", "bin") 94 | if (fs.existsSync(ghcupPath)) { 95 | this.consoleView.appendLog(` * use ghcup default path`) 96 | return ghcupPath 97 | } else { 98 | this.consoleView.appendLog(` > ghcup not found`) 99 | this.consoleView.appendLog(` * using default GHC system path definition`) 100 | return "" 101 | } 102 | } 103 | } 104 | 105 | wrappedInteractivePath() { 106 | return atom.config.get(interpreterProperty) === 'default' 107 | ? `"${this.interactivePath}"` 108 | : `${this.interactivePath}` 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /lib/osc-loader.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | import { EventEmitter } from 'events'; 4 | const osc = require('osc-min'); 5 | import OscServer from "./osc-server"; 6 | 7 | const oscAddressProperty = 'tidalcycles.oscEval.address'; 8 | 9 | export default class OscLoader extends EventEmitter { 10 | 11 | constructor(consoleView, tidalRepl, editors) { 12 | super(); 13 | this.address = atom.config.get(oscAddressProperty); 14 | this.consoleView = consoleView; 15 | this.tidalRepl = tidalRepl; 16 | this.editors = editors; 17 | } 18 | 19 | init() { 20 | this.server = new OscServer(this.consoleView); 21 | this.server.start(); 22 | 23 | this.server.sock.on('message', (msg) => { 24 | let resultMap = osc.fromBuffer(msg); 25 | 26 | if (resultMap.address === this.address) { 27 | const resultDict = this.asDictionary(resultMap.args) 28 | 29 | if (resultDict['tab'] !== undefined) { 30 | atom.workspace.getPanes()[0].setActiveItem(atom.workspace.getTextEditors()[resultDict['tab']]) 31 | } 32 | 33 | if (resultDict['row'] && resultDict['column']) { 34 | this.editors.goTo(resultDict['row'] - 1, resultDict['column']) 35 | } 36 | 37 | this.tidalRepl.eval(resultDict['type'], false); 38 | } 39 | }); 40 | } 41 | 42 | asDictionary (oscMap) { 43 | let dictionary = {} 44 | for (var i = 0; i < oscMap.length; i+=2) { 45 | dictionary[oscMap[i].value] = oscMap[i+1].value 46 | } 47 | return dictionary 48 | } 49 | 50 | destroy() { 51 | try { 52 | this.server.destroy(); 53 | } catch (e) { 54 | this.consoleView.logStderr(`OSC server has problems while destroying: \n${e}`); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/osc-server.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | const dgram = require('dgram'); 4 | const oscPortProperty = 'tidalcycles.oscEval.port'; 5 | const oscIpProperty = 'tidalcycles.oscEval.ip'; 6 | 7 | export default class OscServer { 8 | 9 | port = null; 10 | ip = null; 11 | sock = null; 12 | consoleView = null; 13 | 14 | constructor(consoleView) { 15 | this.port = atom.config.get(oscPortProperty); 16 | this.ip = atom.config.get(oscIpProperty); 17 | this.consoleView = consoleView; 18 | this.sock = dgram.createSocket('udp4'); 19 | } 20 | 21 | start() { 22 | this.sock.on('error', (err) => { 23 | this.consoleView.logStderr(`OSC server error: \n${err.stack}`) 24 | this.sock.close(); 25 | }); 26 | 27 | this.sock.on('listening', () => { 28 | this.consoleView.logStdout(`Listening for external osc messages on ${this.ip}:${this.port}`) 29 | }); 30 | 31 | this.sock.bind(this.port, this.ip); 32 | } 33 | 34 | stop() { 35 | if (this.sock) { 36 | this.sock.close(); 37 | } 38 | } 39 | 40 | destroy() { 41 | this.stop(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/pattern.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | import { Point } from 'atom' 4 | import { EventEmitter } from 'events' 5 | 6 | export default class Pattern extends EventEmitter { 7 | 8 | constructor(id, expression, range, editor) { 9 | super() 10 | this.id = id 11 | this.expression = expression 12 | this.range = range 13 | this.highlight = { cyclePosition: 0, ranges: [], rangesKeys: [], markers: [] } 14 | this.editor = editor 15 | 16 | this.on('cycle-position-changed', () => this.destroyHighlightMarkers()) 17 | this.on('highlight-added', event => { 18 | let translateBy = this.range.start.row 19 | let editorRange = event.range.translate(new Point(translateBy, 0)) 20 | let marker = this.editor.markBufferRange(editorRange, { invalidate: 'touch' }) 21 | this.highlight.markers.push(marker) 22 | this.editor.decorateMarker(marker, { type: 'text', class: 'highlight'}) 23 | }) 24 | } 25 | 26 | addHighlight(cyclePosition, range) { 27 | if (this.highlight.cyclePosition !== cyclePosition) { 28 | this.highlight.cyclePosition = cyclePosition 29 | this.highlight.ranges = [] 30 | this.emit('cycle-position-changed') 31 | } 32 | 33 | if (!this.highlight.ranges.find(r => r.isEqual(range))) { 34 | this.highlight.ranges.push(range) 35 | this.emit('highlight-added', { range }) 36 | } 37 | } 38 | 39 | destroyHighlightMarkers() { 40 | this.highlight.markers.forEach(marker => marker.destroy()) 41 | } 42 | 43 | destroy() { 44 | this.destroyHighlightMarkers() 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/process.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | const EventEmitter = require('events'); 4 | const child_process = require('child_process'); 5 | const path = require('path'); 6 | 7 | export default class Process extends EventEmitter { 8 | 9 | static ghci(path) { 10 | return new Process(child_process.spawn(path, [], { shell: true })) 11 | } 12 | 13 | static tidalListener() { 14 | return new Process(child_process.spawn('tidal-listener', [])) 15 | } 16 | 17 | static superDirt(filePath) { 18 | return new Process(child_process.spawn('sclang', [filePath])) 19 | } 20 | 21 | constructor(process) { 22 | super() 23 | this.stdOut = []; 24 | this.stdErr = []; 25 | 26 | this.process = process 27 | 28 | this.process.stderr.on('data', data => { 29 | this.stdErr.push(data.toString('utf8')) 30 | setTimeout(() => { 31 | if (this.stdErr.length) { 32 | let err = this.stdErr.join('') 33 | this.stdErr.length = 0; 34 | this.emit('stderr', err); 35 | } 36 | }, 50) 37 | }); 38 | 39 | this.process.stdout.on('data', data => { 40 | this.stdOut.push(data.toString('utf8')) 41 | setTimeout(() => { 42 | if (this.stdOut.length) { 43 | let out = this.stdOut.join('') 44 | this.stdOut.length = 0 45 | this.emit('stdout', out); 46 | } 47 | }, 50) 48 | }); 49 | 50 | } 51 | 52 | writeLine(command) { 53 | this.process.stdin.write(command); 54 | this.process.stdin.write('\n'); 55 | } 56 | 57 | destroy() { 58 | this.process.kill(); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /lib/repl.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | export default class REPL { 4 | 5 | ghci = null 6 | consoleView = null 7 | 8 | constructor(consoleView, ghc, bootTidal, status, editors) { 9 | this.consoleView = consoleView; 10 | this.ghc = ghc 11 | this.bootTidal = bootTidal 12 | this.status = status 13 | this.editors = editors 14 | 15 | this.mutes = [...Array(16).keys()] 16 | .reduce((acc, cur) => { 17 | acc[`${cur+1}`] = false 18 | return acc; 19 | }, {}); 20 | } 21 | 22 | start() { 23 | this.status.reset() 24 | 25 | this.ghci = this.ghc.interactive() 26 | .on('stderr', data => this.consoleView.logPromptErr(this.cleanStdErr(data))) 27 | .on('stdout', data => this.consoleView.logPromptOut(this.cleanStdOut(data))) 28 | 29 | this.initTidal(); 30 | } 31 | 32 | initTidal() { 33 | const bootPath = this.bootTidal.choosePath() 34 | this.consoleView.appendLog(` * load BootTidal.hs from ${bootPath}`) 35 | this.consoleView.flushLog() 36 | 37 | if (bootPath.indexOf(' ') === -1) { 38 | this.tidalSendLine(`:script ${bootPath}`) 39 | } else { 40 | this.bootTidal.blocks() 41 | .forEach(block => block.indexOf('\n') === -1 42 | ? this.tidalSendLine(block) 43 | : this.tidalSendExpression(block) 44 | ) 45 | } 46 | } 47 | 48 | hush() { 49 | this.tidalSendExpression('hush'); 50 | } 51 | 52 | cleanStdOut(stdout) { 53 | return stdout 54 | .trim() 55 | .replace(/tidal>.*Prelude>/g, "") 56 | .replace(/tidal>/g, "") 57 | .replace(/Prelude>/g, "") 58 | .replace(/Prelude.*\|/g, "") 59 | .replace(/GHCi.*help/g, "") 60 | } 61 | 62 | cleanStdErr(stderr) { 63 | return stderr 64 | .replace(/.*error:/g, "") 65 | .replace(/ \(bound at.*/g, "") 66 | } 67 | 68 | tidalSendExpression(expression) { 69 | this.tidalSendLine(':{'); 70 | 71 | expression.split('\n') 72 | .forEach(line => this.tidalSendLine(line)); 73 | 74 | this.tidalSendLine(':}'); 75 | } 76 | 77 | tidalSendLine(command) { 78 | this.ghci.writeLine(command); 79 | } 80 | 81 | eval(evalType, copy) { 82 | if (!this.editors.currentIsTidal()) return; 83 | 84 | if (!this.ghci) this.start(); 85 | this.editors.currentEvaluations(evalType) 86 | .filter(e => e.expression && e.range) 87 | .forEach(e => { 88 | this.status.eval({ characters: e.expression.length }) 89 | 90 | var unflash = this.editors.evalFlash(e.range); 91 | if (copy) { 92 | this.editors.copyRange(e.range); 93 | } 94 | 95 | this.tidalSendExpression(e.expression); 96 | 97 | if (unflash) { 98 | unflash('eval-success'); 99 | } 100 | }) 101 | } 102 | 103 | toggleMute(connection) { 104 | let command = this.mutes[connection] 105 | ? `unmute ${connection}` 106 | : `mute ${connection}` 107 | 108 | this.tidalSendLine(command) 109 | 110 | this.mutes[connection] = !this.mutes[connection] 111 | this.consoleView.logMutes(this.mutes, command) 112 | } 113 | 114 | unmuteAll() { 115 | let command = 'unmuteAll' 116 | 117 | this.tidalSendLine(command) 118 | for (const key in Object.keys(this.mutes)) { 119 | this.mutes[key] = false 120 | } 121 | this.consoleView.logMutes(this.mutes, command) 122 | } 123 | 124 | destroy() { 125 | if (this.ghci) { 126 | this.ghci.destroy(); 127 | } 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /lib/sound-browser.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | const dirTree = require("directory-tree") 4 | const path = require('path') 5 | let activeAudio = null; 6 | 7 | export default class SoundBrowser { 8 | 9 | constructor() { 10 | this.browser = null 11 | } 12 | 13 | init(soundFolders) { 14 | this.browser = document.createElement('div') 15 | this.browser.classList.add('atom-sound-browser') 16 | this.browser.style.overflowY = 'scroll' 17 | 18 | let trees = soundFolders 19 | .map(folder => { 20 | let tree = dirTree(folder, { 21 | extensions: /\.(wav|aiff)/, 22 | exclude: /.git/, 23 | attributes: ['type'] 24 | }) 25 | if (!tree) { 26 | atom.notifications.addError(`Sound browser: the path ${folder} is invalid`) 27 | } 28 | return tree 29 | }) 30 | .filter(tree => tree) 31 | 32 | if (trees.length > 0) { 33 | trees.forEach(tree => this.render(this.browser, tree, 0)) 34 | 35 | atom.workspace.open({ 36 | element: this.browser, 37 | getTitle: () => 'Sound Browser', 38 | getURI: () => 'atom://tidalcycles/sound-browser', 39 | getDefaultLocation: () => 'left' 40 | }, { activatePane: false }); 41 | } 42 | } 43 | 44 | render(rootElement, tree, number) { 45 | let element = document.createElement('li') 46 | 47 | element.style.cursor = 'pointer' 48 | 49 | rootElement.appendChild(element) 50 | 51 | if (tree.type === 'directory') { 52 | element.textContent = tree.name 53 | element.classList.add('icon', 'icon-open') 54 | 55 | let directoryElement = document.createElement('ul') 56 | element.onclick = _ => { 57 | this.toggleDisplay(element, directoryElement) 58 | } 59 | if (rootElement !== this.browser) { 60 | this.toggleDisplay(element, directoryElement) 61 | } 62 | rootElement.appendChild(directoryElement) 63 | 64 | tree.children 65 | .forEach((subTree, index) => this.render(directoryElement, subTree, index)) 66 | } else { 67 | let dirName = path.basename(path.dirname(tree.path)) 68 | let filename = path.basename(tree.path, path.extname(tree.path)) 69 | element.textContent = `${dirName}:${number} / ${filename}` 70 | element.classList.add('icon', 'icon-speaker') 71 | 72 | let audioIcon = document.createElement('span'); 73 | element.appendChild(audioIcon); 74 | 75 | let audio = this.audio(tree.path) 76 | audio.onplay = _ => { 77 | element.style.fontWeight = 'bold'; 78 | this.setSpeakerIcon(audioIcon, true); 79 | }; 80 | audio.onpause = _ => { 81 | element.style.fontWeight = 'normal'; 82 | this.setSpeakerIcon(audioIcon, false); 83 | }; 84 | element.onclick = _ => { 85 | 86 | if (audio.paused) { 87 | audio.play(); 88 | 89 | if (activeAudio !== null && activeAudio !== audio) { 90 | activeAudio.pause(); 91 | activeAudio.currentTime = 0; 92 | } 93 | 94 | activeAudio = audio; 95 | this.setSpeakerIcon(audioIcon, true); 96 | } else { 97 | audio.pause(); 98 | audio.currentTime = 0; 99 | this.setSpeakerIcon(audioIcon, false); 100 | } 101 | }; 102 | } 103 | } 104 | 105 | audio(filePath) { 106 | let escapedPath = filePath.replace('#', '%23') 107 | let audio = document.createElement('audio') 108 | audio.id = escapedPath 109 | audio.src = escapedPath 110 | audio.autostart = false 111 | audio.preload = 'none' 112 | return audio 113 | } 114 | 115 | setSpeakerIcon (element, played) { 116 | played ? 117 | element.classList.add('icon-speaker') : 118 | element.classList.remove('icon-speaker'); 119 | } 120 | 121 | toggleDisplay(parent, element) { 122 | parent.classList.toggle('icon-open'); 123 | parent.classList.toggle('icon-close'); 124 | 125 | if (element.style.display === 'none') { 126 | element.style.display = 'block' 127 | } else { 128 | element.style.display = 'none' 129 | } 130 | } 131 | 132 | destroy() { 133 | this.browser.remove(); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /lib/status.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | export default class Status { 4 | 5 | reset() { 6 | this.evaluationCount = 0 7 | this.difference = 0 8 | this.lastEvaluation = { characters: 0 } 9 | } 10 | 11 | diff() { 12 | return this.difference > 0 ? '+' + this.difference : this.difference 13 | } 14 | 15 | evalCount() { 16 | return this.evaluationCount 17 | } 18 | 19 | timestamp() { 20 | return Math.round(new Date() / 1000) 21 | } 22 | 23 | eval(evaluation) { 24 | this.difference = evaluation.characters - this.lastEvaluation.characters 25 | this.lastEvaluation = evaluation 26 | this.evaluationCount++ 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /lib/superdirt-startup.js: -------------------------------------------------------------------------------- 1 | 'use babel' 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | 6 | const defaultFileName = 'superdirt_startup.scd'; 7 | const defaultFilePath = __dirname + path.sep + defaultFileName; 8 | 9 | export default class SuperDirtStartup { 10 | 11 | constructor() { 12 | this.rootDirectories = atom.project.rootDirectories 13 | } 14 | 15 | choosePath() { 16 | const currentDirectoryPath = this.rootDirectories.length > 0 ? 17 | this.rootDirectories[0].path + path.sep + defaultFileName : 18 | null; 19 | 20 | if (fs.existsSync(currentDirectoryPath)) return currentDirectoryPath; 21 | 22 | return defaultFilePath 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /lib/superdirt.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | const Process = require('./process') 4 | const SuperDirtStartup = require('./superdirt-startup') 5 | 6 | export default class SuperDirt { 7 | 8 | element = null; 9 | log = null; 10 | 11 | constructor() { 12 | this.superDirtStartup = new SuperDirtStartup() 13 | } 14 | 15 | start() { 16 | if (!this.element) { 17 | this.element = document.createElement('div'); 18 | this.element.setAttribute('tabindex', -1); 19 | this.element.classList.add('tidalcycles', 'console', 'native-key-bindings'); 20 | this.element.setAttribute('style', 'overflow-y: scroll;') 21 | 22 | this.log = document.createElement('div'); 23 | this.element.appendChild(this.log); 24 | 25 | atom.workspace.open({ 26 | element: this.element, 27 | getTitle: () => 'SuperDirt', 28 | getURI: () => 'atom://tidalcycles/superdirt-console', 29 | getDefaultLocation: () => 'bottom' 30 | }, { activatePane: false }); 31 | } 32 | 33 | atom.workspace.getBottomDock().show() 34 | 35 | this.process = Process.superDirt(this.superDirtStartup.choosePath()) 36 | this.process.on('stderr', data => this.logStderr(data)); 37 | this.process.on('stdout', data => this.logStdout(data)); 38 | } 39 | 40 | logStdout(text) { 41 | this.logText(text, false); 42 | } 43 | 44 | logStderr(text) { 45 | this.logText(text, true); 46 | 47 | if (atom.config.get('tidalcycles.showErrorNotifications')) { 48 | atom.notifications.addError(text) 49 | } 50 | } 51 | 52 | logText(text, error) { 53 | if (!text) return; 54 | var pre = document.createElement("pre"); 55 | if (error) { 56 | pre.className = "error"; 57 | } 58 | 59 | pre.innerHTML = text; 60 | this.log.appendChild(pre); 61 | 62 | this.element.scrollTop = this.element.scrollHeight; 63 | } 64 | 65 | // it's needed for package serialization 66 | serialize() { } 67 | 68 | destroy() { 69 | if (this.process) { 70 | this.process.destroy() 71 | } 72 | if (this.element) { 73 | this.element.remove() 74 | this.element = undefined 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /lib/superdirt_startup.scd: -------------------------------------------------------------------------------- 1 | SuperDirt.start; 2 | -------------------------------------------------------------------------------- /lib/tidal-listener-repl.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | const dgram = require('dgram'); 4 | const osc = require('osc-min'); 5 | const Process = require('./process'); 6 | const Pattern = require('./pattern'); 7 | import { Range } from 'atom' 8 | 9 | export default class TidalListenerRepl { 10 | 11 | consoleView = null 12 | 13 | constructor(consoleView, status, editors) { 14 | this.consoleView = consoleView; 15 | this.status = status 16 | this.editors = editors 17 | this.stdOut = [] 18 | this.stdErr = [] 19 | this.highlights = {} 20 | this.patterns = {} 21 | 22 | this.mutes = [...Array(16).keys()] 23 | .reduce((acc, cur) => { 24 | acc[`${cur+1}`] = false 25 | return acc; 26 | }, {}); 27 | 28 | } 29 | 30 | start() { 31 | this.status.reset() 32 | 33 | this.listener = Process.tidalListener(); 34 | this.listener.on('stderr', data => this.consoleView.logStderr(data)); 35 | this.listener.on('stdout', data => this.consoleView.logStdlog(data)) 36 | 37 | this.udp = dgram.createSocket('udp4'); 38 | 39 | this.udp.on('message', (msg) => { 40 | let resultMap = osc.fromBuffer(msg); 41 | 42 | switch (resultMap.address) { 43 | case '/code/ok': 44 | this.consoleView.logPromptOut('') 45 | break; 46 | case '/code/error': 47 | let id = resultMap.args[0].value; 48 | let message = resultMap.args[1].value; 49 | this.consoleView.logPromptErr(message); 50 | break; 51 | case '/code/highlight': 52 | this.highlight(resultMap.args) 53 | break; 54 | case '/dirt/handshake': 55 | this.consoleView.logPromptErr(`Waiting for SuperDirt`); 56 | break; 57 | default: 58 | this.consoleView.logPromptOut(`Received an unknown message: ${resultMap.address}`) 59 | } 60 | }); 61 | 62 | this.udp.on('error', (err) => { 63 | this.consoleView.logPromptErr(`tidal-listener error: \n${err.stack}`) 64 | this.udp.close(); 65 | }); 66 | 67 | this.udp.on('listening', () => { 68 | this.consoleView.logPromptOut(`Listening for tidal-listener responses `) 69 | }); 70 | 71 | this.udp.bind(6012, this.ip); 72 | } 73 | 74 | hush() { 75 | this.tidalSendExpression('hush'); 76 | } 77 | 78 | tidalSendExpression(expression, id) { 79 | var buf = osc.toBuffer({ 80 | address: "/code", 81 | args: [id, expression] 82 | }); 83 | 84 | this.udp.send(buf, 0, buf.length, 6011, "localhost"); 85 | 86 | } 87 | 88 | eval(evalType, copy) { 89 | if (!this.editors.currentIsTidal()) return; 90 | 91 | if (!this.listener) this.start(); 92 | // TODO: it's correct that an eval with listener should eval everything? 93 | Object.values(this.patterns).forEach(pattern => pattern.destroy()) 94 | this.editors.currentEvaluations() 95 | .filter(e => e.expression && e.range) 96 | .map(e => new Pattern(e.id, e.expression, e.range, this.editors.currentEditor())) 97 | .forEach(pattern => { 98 | this.patterns[pattern.id] = pattern 99 | 100 | this.status.eval({ characters: pattern.expression.length }) 101 | 102 | var unflash = this.editors.evalFlash(pattern.range); 103 | if (copy) { 104 | this.editors.copyRange(pattern.range); 105 | } 106 | 107 | this.tidalSendExpression(pattern.expression, pattern.id); 108 | 109 | if (unflash) { 110 | unflash('eval-success'); 111 | } 112 | }) 113 | } 114 | 115 | toggleMute(connection) { 116 | let command = this.mutes[connection] 117 | ? `unmute ${connection}` 118 | : `mute ${connection}` 119 | 120 | this.tidalSendExpression(command) 121 | 122 | this.mutes[connection] = !this.mutes[connection] 123 | this.consoleView.logMutes(this.mutes, command) 124 | } 125 | 126 | unmuteAll() { 127 | let command = 'unmuteAll' 128 | 129 | this.tidalSendExpression(command) 130 | 131 | for (key of Object.keys(this.mutes)) { 132 | this.mutes[key] = false 133 | } 134 | this.consoleView.logMutes(this.mutes, command) 135 | } 136 | 137 | highlight(args) { 138 | let id = args[0].value 139 | let duration = args[1].value 140 | let cyclePosition = args[2].value 141 | let startColumn = args[3].value 142 | let startRow = args[4].value - 1 143 | let stopColumn = args[5].value 144 | let stopRow = args[6].value - 1 145 | 146 | let pattern = this.patterns[id] 147 | if (pattern) { 148 | pattern.addHighlight(cyclePosition, new Range([startRow, startColumn], [stopRow, stopColumn])) 149 | } 150 | 151 | } 152 | 153 | destroy() { 154 | if (this.listener) { 155 | this.listener.destroy(); 156 | } 157 | if (this.udp) { 158 | this.udp.close(); 159 | } 160 | this.listener = undefined; 161 | this.udp = undefined; 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /lib/tidalcycles.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | import ConsoleView from './console-view'; 4 | import Repl from './repl'; 5 | import TidalListenerRepl from './tidal-listener-repl'; 6 | import OscLoader from './osc-loader'; 7 | import AutocompleteProvider from './autocomplete-provider'; 8 | import Ghc from './ghc'; 9 | import BootTidal from './boot-tidal'; 10 | import SoundBrowser from './sound-browser'; 11 | const Status = require('./status') 12 | const SuperDirt = require('./superdirt') 13 | const { LINE, MULTI_LINE, WHOLE_EDITOR, Editors } = require('./editors') 14 | const config = require('./config') 15 | 16 | export default { 17 | consoleView: null, 18 | repl: null, 19 | config: config, 20 | status: new Status(), 21 | editors: new Editors(), 22 | superDirt: new SuperDirt(), 23 | 24 | activate() { 25 | if (atom.config.get('tidalcycles.superDirt.autostart')) { 26 | this.superDirt.start(); 27 | } 28 | 29 | this.consoleView = new ConsoleView(this.status); 30 | this.consoleView.initUI(); 31 | 32 | if (atom.config.get('tidalcycles.interpreter') === 'listener') { 33 | this.repl = new TidalListenerRepl(this.consoleView, this.status, this.editors); 34 | } else { 35 | this.ghc = new Ghc(this.consoleView); 36 | this.ghc.init(); 37 | this.bootTidal = new BootTidal(this.ghc, atom.project.rootDirectories, this.consoleView); 38 | this.repl = new Repl(this.consoleView, this.ghc, this.bootTidal, this.status, this.editors); 39 | } 40 | 41 | if (atom.config.get('tidalcycles.oscEval.enable')) { 42 | this.oscLoader = new OscLoader(this.consoleView, this.repl, this.editors); 43 | this.oscLoader.init(); 44 | } 45 | 46 | this.soundBrowser = new SoundBrowser(); 47 | this.soundBrowser.init(atom.config.get('tidalcycles.soundBrowser.folders')); 48 | 49 | atom.commands.add('atom-workspace', { 50 | 'tidalcycles:boot': () => { 51 | if (this.editors.currentIsTidal()) { 52 | this.consoleView.logStdout('Start TidalCycles plugin') 53 | this.repl.start(); 54 | } else { 55 | atom.notifications.addError('Cannot start Tidal from a non ".tidal" file') 56 | } 57 | }, 58 | 'tidalcycles:reboot': () => { 59 | this.consoleView.logStdout('Reboot TidalCycles plugin') 60 | this.repl.destroy(); 61 | this.repl.start(); 62 | }, 63 | 'tidalcycles:boot-superdirt': () => { 64 | this.consoleView.logStdout('Boot SuperDirt') 65 | this.superDirt.destroy(); 66 | this.superDirt.start(); 67 | } 68 | }); 69 | 70 | atom.commands.add('atom-text-editor', { 71 | 'tidalcycles:eval': () => this.repl.eval(LINE, false), 72 | 'tidalcycles:eval-multi-line': () => this.repl.eval(MULTI_LINE, false), 73 | 'tidalcycles:eval-whole-editor': () => this.repl.eval(WHOLE_EDITOR, false), 74 | 'tidalcycles:eval-copy': () => this.repl.eval(LINE, true), 75 | 'tidalcycles:eval-multi-line-copy': () => this.repl.eval(MULTI_LINE, true), 76 | 'tidalcycles:unmuteAll': () => this.repl.unmuteAll(), 77 | 'tidalcycles:toggle-mute-1': () => this.repl.toggleMute('1'), 78 | 'tidalcycles:toggle-mute-2': () => this.repl.toggleMute('2'), 79 | 'tidalcycles:toggle-mute-3': () => this.repl.toggleMute('3'), 80 | 'tidalcycles:toggle-mute-4': () => this.repl.toggleMute('4'), 81 | 'tidalcycles:toggle-mute-5': () => this.repl.toggleMute('5'), 82 | 'tidalcycles:toggle-mute-6': () => this.repl.toggleMute('6'), 83 | 'tidalcycles:toggle-mute-7': () => this.repl.toggleMute('7'), 84 | 'tidalcycles:toggle-mute-8': () => this.repl.toggleMute('8'), 85 | 'tidalcycles:toggle-mute-9': () => this.repl.toggleMute('9'), 86 | 'tidalcycles:toggle-mute-10': () => this.repl.toggleMute('10'), 87 | 'tidalcycles:toggle-mute-11': () => this.repl.toggleMute('11'), 88 | 'tidalcycles:toggle-mute-12': () => this.repl.toggleMute('12'), 89 | 'tidalcycles:toggle-mute-13': () => this.repl.toggleMute('13'), 90 | 'tidalcycles:toggle-mute-14': () => this.repl.toggleMute('14'), 91 | 'tidalcycles:toggle-mute-15': () => this.repl.toggleMute('15'), 92 | 'tidalcycles:toggle-mute-16': () => this.repl.toggleMute('16'), 93 | 'tidalcycles:hush': () => this.repl.hush() 94 | }); 95 | 96 | atom.workspace.onWillDestroyPaneItem(event => { 97 | if (event.item.getURI() === 'atom://tidalcycles/superdirt-console') { 98 | this.superDirt.destroy(); 99 | } 100 | }) 101 | }, 102 | 103 | deactivate() { 104 | this.consoleView.destroy(); 105 | this.superDirt.destroy(); 106 | this.repl.destroy(); 107 | this.oscLoader.destroy(); 108 | this.soundBrowser.destroy(); 109 | }, 110 | 111 | serialize() { 112 | return { 113 | consoleViewState: this.consoleView.serialize(), 114 | superdirtConsoleState: this.superDirt.serialize() 115 | }; 116 | }, 117 | 118 | autocompleteProvider() { 119 | if (this.ghc) { 120 | return new AutocompleteProvider(this.ghc) 121 | } else { 122 | return undefined 123 | } 124 | 125 | } 126 | 127 | }; 128 | -------------------------------------------------------------------------------- /menus/tidalcycles.json: -------------------------------------------------------------------------------- 1 | { 2 | "context-menu": { 3 | "atom-text-editor": [] 4 | }, 5 | "menu": [{ 6 | "label": "Packages", 7 | "submenu": [{ 8 | "label": "TidalCycles", 9 | "submenu": [{ 10 | "label": "Boot TidalCycles", 11 | "command": "tidalcycles:boot" 12 | }, { 13 | "label": "Reboot Tidalcycles", 14 | "command": "tidalcycles:reboot" 15 | }, { 16 | "label": "Eval", 17 | "command": "tidalcycles:eval" 18 | }, { 19 | "label": "Eval And Copy", 20 | "command": "tidalcycles:eval-copy" 21 | }, { 22 | "label": "Eval Multi Line", 23 | "command": "tidalcycles:eval-multi-line" 24 | }, { 25 | "label": "Eval Multi Line And Copy", 26 | "command": "tidalcycles:eval-multi-line-copy" 27 | }, { 28 | "label": "Hush", 29 | "command": "tidalcycles:hush" 30 | }] 31 | }] 32 | }] 33 | } 34 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tidalcycles", 3 | "version": "4.0.2", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "tidalcycles", 9 | "version": "3.16.46", 10 | "license": "GPL-3.0", 11 | "dependencies": { 12 | "directory-tree": "^3.5.1", 13 | "osc-min": "^1.1.1" 14 | }, 15 | "engines": { 16 | "atom": ">=1.0.0 <2.0.0" 17 | } 18 | }, 19 | "node_modules/ansi-styles": { 20 | "version": "3.2.1", 21 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 22 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 23 | "dependencies": { 24 | "color-convert": "^1.9.0" 25 | }, 26 | "engines": { 27 | "node": ">=4" 28 | } 29 | }, 30 | "node_modules/array-back": { 31 | "version": "3.1.0", 32 | "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", 33 | "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", 34 | "engines": { 35 | "node": ">=6" 36 | } 37 | }, 38 | "node_modules/binpack": { 39 | "version": "0.1.0", 40 | "resolved": "https://registry.npmjs.org/binpack/-/binpack-0.1.0.tgz", 41 | "integrity": "sha1-vT0JdMPyoERuF99PYLVacqIFqX4=" 42 | }, 43 | "node_modules/chalk": { 44 | "version": "2.4.2", 45 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 46 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 47 | "dependencies": { 48 | "ansi-styles": "^3.2.1", 49 | "escape-string-regexp": "^1.0.5", 50 | "supports-color": "^5.3.0" 51 | }, 52 | "engines": { 53 | "node": ">=4" 54 | } 55 | }, 56 | "node_modules/color-convert": { 57 | "version": "1.9.3", 58 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 59 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 60 | "dependencies": { 61 | "color-name": "1.1.3" 62 | } 63 | }, 64 | "node_modules/color-name": { 65 | "version": "1.1.3", 66 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 67 | "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" 68 | }, 69 | "node_modules/command-line-args": { 70 | "version": "5.2.1", 71 | "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", 72 | "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", 73 | "dependencies": { 74 | "array-back": "^3.1.0", 75 | "find-replace": "^3.0.0", 76 | "lodash.camelcase": "^4.3.0", 77 | "typical": "^4.0.0" 78 | }, 79 | "engines": { 80 | "node": ">=4.0.0" 81 | } 82 | }, 83 | "node_modules/command-line-usage": { 84 | "version": "6.1.3", 85 | "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", 86 | "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", 87 | "dependencies": { 88 | "array-back": "^4.0.2", 89 | "chalk": "^2.4.2", 90 | "table-layout": "^1.0.2", 91 | "typical": "^5.2.0" 92 | }, 93 | "engines": { 94 | "node": ">=8.0.0" 95 | } 96 | }, 97 | "node_modules/command-line-usage/node_modules/array-back": { 98 | "version": "4.0.2", 99 | "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", 100 | "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", 101 | "engines": { 102 | "node": ">=8" 103 | } 104 | }, 105 | "node_modules/command-line-usage/node_modules/typical": { 106 | "version": "5.2.0", 107 | "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", 108 | "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", 109 | "engines": { 110 | "node": ">=8" 111 | } 112 | }, 113 | "node_modules/deep-extend": { 114 | "version": "0.6.0", 115 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 116 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", 117 | "engines": { 118 | "node": ">=4.0.0" 119 | } 120 | }, 121 | "node_modules/directory-tree": { 122 | "version": "3.5.1", 123 | "resolved": "https://registry.npmjs.org/directory-tree/-/directory-tree-3.5.1.tgz", 124 | "integrity": "sha512-HqjZ49fDzUnKYUhHxVw9eKBqbQ+lL0v4kSBInlDlaktmLtGoV9tC54a6A0ZfYeIrkMHWTE6MwwmUXP477+UEKQ==", 125 | "dependencies": { 126 | "command-line-args": "^5.2.0", 127 | "command-line-usage": "^6.1.1" 128 | }, 129 | "bin": { 130 | "directory-tree": "bin/index.js" 131 | }, 132 | "engines": { 133 | "node": ">=10.0" 134 | } 135 | }, 136 | "node_modules/escape-string-regexp": { 137 | "version": "1.0.5", 138 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 139 | "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", 140 | "engines": { 141 | "node": ">=0.8.0" 142 | } 143 | }, 144 | "node_modules/find-replace": { 145 | "version": "3.0.0", 146 | "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", 147 | "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", 148 | "dependencies": { 149 | "array-back": "^3.0.1" 150 | }, 151 | "engines": { 152 | "node": ">=4.0.0" 153 | } 154 | }, 155 | "node_modules/has-flag": { 156 | "version": "3.0.0", 157 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 158 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", 159 | "engines": { 160 | "node": ">=4" 161 | } 162 | }, 163 | "node_modules/lodash.camelcase": { 164 | "version": "4.3.0", 165 | "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", 166 | "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" 167 | }, 168 | "node_modules/osc-min": { 169 | "version": "1.1.2", 170 | "resolved": "https://registry.npmjs.org/osc-min/-/osc-min-1.1.2.tgz", 171 | "integrity": "sha512-8DbiO8ME85R75stgNVCZtHxB9MNBBNcyy+isNBXrsFeinXGjwNAauvKVmGlfRas5VJWC/mhzIx7spR2gFvWxvg==", 172 | "dependencies": { 173 | "binpack": "~0" 174 | }, 175 | "engines": { 176 | "node": ">=0.10.0" 177 | } 178 | }, 179 | "node_modules/reduce-flatten": { 180 | "version": "2.0.0", 181 | "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", 182 | "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", 183 | "engines": { 184 | "node": ">=6" 185 | } 186 | }, 187 | "node_modules/supports-color": { 188 | "version": "5.5.0", 189 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 190 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 191 | "dependencies": { 192 | "has-flag": "^3.0.0" 193 | }, 194 | "engines": { 195 | "node": ">=4" 196 | } 197 | }, 198 | "node_modules/table-layout": { 199 | "version": "1.0.2", 200 | "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", 201 | "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", 202 | "dependencies": { 203 | "array-back": "^4.0.1", 204 | "deep-extend": "~0.6.0", 205 | "typical": "^5.2.0", 206 | "wordwrapjs": "^4.0.0" 207 | }, 208 | "engines": { 209 | "node": ">=8.0.0" 210 | } 211 | }, 212 | "node_modules/table-layout/node_modules/array-back": { 213 | "version": "4.0.2", 214 | "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", 215 | "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", 216 | "engines": { 217 | "node": ">=8" 218 | } 219 | }, 220 | "node_modules/table-layout/node_modules/typical": { 221 | "version": "5.2.0", 222 | "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", 223 | "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", 224 | "engines": { 225 | "node": ">=8" 226 | } 227 | }, 228 | "node_modules/typical": { 229 | "version": "4.0.0", 230 | "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", 231 | "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", 232 | "engines": { 233 | "node": ">=8" 234 | } 235 | }, 236 | "node_modules/wordwrapjs": { 237 | "version": "4.0.1", 238 | "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", 239 | "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", 240 | "dependencies": { 241 | "reduce-flatten": "^2.0.0", 242 | "typical": "^5.2.0" 243 | }, 244 | "engines": { 245 | "node": ">=8.0.0" 246 | } 247 | }, 248 | "node_modules/wordwrapjs/node_modules/typical": { 249 | "version": "5.2.0", 250 | "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", 251 | "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", 252 | "engines": { 253 | "node": ">=8" 254 | } 255 | } 256 | }, 257 | "dependencies": { 258 | "ansi-styles": { 259 | "version": "3.2.1", 260 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 261 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 262 | "requires": { 263 | "color-convert": "^1.9.0" 264 | } 265 | }, 266 | "array-back": { 267 | "version": "3.1.0", 268 | "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", 269 | "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==" 270 | }, 271 | "binpack": { 272 | "version": "0.1.0", 273 | "resolved": "https://registry.npmjs.org/binpack/-/binpack-0.1.0.tgz", 274 | "integrity": "sha1-vT0JdMPyoERuF99PYLVacqIFqX4=" 275 | }, 276 | "chalk": { 277 | "version": "2.4.2", 278 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 279 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 280 | "requires": { 281 | "ansi-styles": "^3.2.1", 282 | "escape-string-regexp": "^1.0.5", 283 | "supports-color": "^5.3.0" 284 | } 285 | }, 286 | "color-convert": { 287 | "version": "1.9.3", 288 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 289 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 290 | "requires": { 291 | "color-name": "1.1.3" 292 | } 293 | }, 294 | "color-name": { 295 | "version": "1.1.3", 296 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 297 | "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" 298 | }, 299 | "command-line-args": { 300 | "version": "5.2.1", 301 | "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", 302 | "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", 303 | "requires": { 304 | "array-back": "^3.1.0", 305 | "find-replace": "^3.0.0", 306 | "lodash.camelcase": "^4.3.0", 307 | "typical": "^4.0.0" 308 | } 309 | }, 310 | "command-line-usage": { 311 | "version": "6.1.3", 312 | "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", 313 | "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", 314 | "requires": { 315 | "array-back": "^4.0.2", 316 | "chalk": "^2.4.2", 317 | "table-layout": "^1.0.2", 318 | "typical": "^5.2.0" 319 | }, 320 | "dependencies": { 321 | "array-back": { 322 | "version": "4.0.2", 323 | "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", 324 | "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==" 325 | }, 326 | "typical": { 327 | "version": "5.2.0", 328 | "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", 329 | "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" 330 | } 331 | } 332 | }, 333 | "deep-extend": { 334 | "version": "0.6.0", 335 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 336 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" 337 | }, 338 | "directory-tree": { 339 | "version": "3.5.1", 340 | "resolved": "https://registry.npmjs.org/directory-tree/-/directory-tree-3.5.1.tgz", 341 | "integrity": "sha512-HqjZ49fDzUnKYUhHxVw9eKBqbQ+lL0v4kSBInlDlaktmLtGoV9tC54a6A0ZfYeIrkMHWTE6MwwmUXP477+UEKQ==", 342 | "requires": { 343 | "command-line-args": "^5.2.0", 344 | "command-line-usage": "^6.1.1" 345 | } 346 | }, 347 | "escape-string-regexp": { 348 | "version": "1.0.5", 349 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 350 | "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" 351 | }, 352 | "find-replace": { 353 | "version": "3.0.0", 354 | "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", 355 | "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", 356 | "requires": { 357 | "array-back": "^3.0.1" 358 | } 359 | }, 360 | "has-flag": { 361 | "version": "3.0.0", 362 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 363 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" 364 | }, 365 | "lodash.camelcase": { 366 | "version": "4.3.0", 367 | "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", 368 | "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" 369 | }, 370 | "osc-min": { 371 | "version": "1.1.2", 372 | "resolved": "https://registry.npmjs.org/osc-min/-/osc-min-1.1.2.tgz", 373 | "integrity": "sha512-8DbiO8ME85R75stgNVCZtHxB9MNBBNcyy+isNBXrsFeinXGjwNAauvKVmGlfRas5VJWC/mhzIx7spR2gFvWxvg==", 374 | "requires": { 375 | "binpack": "~0" 376 | } 377 | }, 378 | "reduce-flatten": { 379 | "version": "2.0.0", 380 | "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", 381 | "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==" 382 | }, 383 | "supports-color": { 384 | "version": "5.5.0", 385 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 386 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 387 | "requires": { 388 | "has-flag": "^3.0.0" 389 | } 390 | }, 391 | "table-layout": { 392 | "version": "1.0.2", 393 | "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", 394 | "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", 395 | "requires": { 396 | "array-back": "^4.0.1", 397 | "deep-extend": "~0.6.0", 398 | "typical": "^5.2.0", 399 | "wordwrapjs": "^4.0.0" 400 | }, 401 | "dependencies": { 402 | "array-back": { 403 | "version": "4.0.2", 404 | "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", 405 | "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==" 406 | }, 407 | "typical": { 408 | "version": "5.2.0", 409 | "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", 410 | "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" 411 | } 412 | } 413 | }, 414 | "typical": { 415 | "version": "4.0.0", 416 | "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", 417 | "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==" 418 | }, 419 | "wordwrapjs": { 420 | "version": "4.0.1", 421 | "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", 422 | "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", 423 | "requires": { 424 | "reduce-flatten": "^2.0.0", 425 | "typical": "^5.2.0" 426 | }, 427 | "dependencies": { 428 | "typical": { 429 | "version": "5.2.0", 430 | "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", 431 | "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" 432 | } 433 | } 434 | } 435 | } 436 | } 437 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tidalcycles", 3 | "main": "./lib/tidalcycles", 4 | "version": "4.0.2", 5 | "description": "TidalCycles, a language for live coding algorithmic patterns.", 6 | "activationCommands": { 7 | "atom-text-editor": [ 8 | "tidalcycles:eval", 9 | "tidalcycles:eval-multi-line" 10 | ], 11 | "atom-workspace": [ 12 | "tidalcycles:boot", 13 | "tidalcycles:reboot" 14 | ] 15 | }, 16 | "dependencies": { 17 | "directory-tree": "^3.5.1", 18 | "osc-min": "^1.1.1" 19 | }, 20 | "repository": "git@github.com:tidalcycles/pulsar-tidalcycles.git", 21 | "license": "GPL-3.0", 22 | "engines": { 23 | "atom": ">=1.0.0 <2.0.0" 24 | }, 25 | "providedServices": { 26 | "autocomplete.provider": { 27 | "versions": { 28 | "2.0.0": "autocompleteProvider" 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /settings/tidal.cson: -------------------------------------------------------------------------------- 1 | '.source.tidalcycles': 2 | 'editor': 3 | 'commentStart': '-- ' 4 | -------------------------------------------------------------------------------- /spec/TestBootTidal.hs: -------------------------------------------------------------------------------- 1 | :set -XOverloadedStrings 2 | :set prompt "" 3 | 4 | 5 | import Sound.Tidal.Context 6 | import System.IO (hSetEncoding, stdout, utf8) 7 | hSetEncoding stdout utf8 8 | 9 | 10 | :{ 11 | let p = streamReplace tidal 12 | hush = streamHush tidal 13 | :} 14 | -------------------------------------------------------------------------------- /spec/autocomplete-provider-spec.js: -------------------------------------------------------------------------------- 1 | const AutocompleteProvider = require('../lib/autocomplete-provider') 2 | const child_process = require('child_process') 3 | const fs = require('fs') 4 | 5 | describe('autocompleteProvider', () => { 6 | 7 | let provider = undefined 8 | 9 | beforeEach(() => { 10 | provider = new AutocompleteProvider() 11 | }) 12 | 13 | describe('parse functions', () => { 14 | it('should ignore not function rows', () => { 15 | let exportIdentifiers = 16 | 'GHCi, version 8.4.4: http://www.haskell.org/ghc/ :? for help' 17 | 18 | let suggestions = provider.parse(exportIdentifiers) 19 | 20 | expect(suggestions.length).toBe(0) 21 | }) 22 | 23 | it('should create suggestion from function', () => { 24 | let exportIdentifiers = 25 | 'Sound.Tidal.Core.listToPat :: [a] -> Sound.Tidal.Pattern.Pattern a' 26 | 27 | let suggestions = provider.parse(exportIdentifiers) 28 | 29 | expect(suggestions).toContain({ 30 | text: 'listToPat', 31 | snippet: 'listToPat ', 32 | description: '[a] -> Sound.Tidal.Pattern.Pattern a', 33 | type: 'function', 34 | rightLabel: 'Sound.Tidal.Core', 35 | }) 36 | }) 37 | 38 | it('should handle multi line function', () => { 39 | let exportIdentifiers = 40 | 'Sound.Tidal.Params.phaserdepth ::\n' + 41 | ' Sound.Tidal.Pattern.Pattern Double\n' + 42 | ' -> Sound.Tidal.Pattern.ControlPattern\n' 43 | 44 | let suggestions = provider.parse(exportIdentifiers) 45 | 46 | expect(suggestions).toContain({ 47 | text: 'phaserdepth', 48 | snippet: 'phaserdepth ', 49 | description: 'Sound.Tidal.Pattern.Pattern Double -> Sound.Tidal.Pattern.ControlPattern', 50 | type: 'function', 51 | rightLabel: 'Sound.Tidal.Params', 52 | }) 53 | }) 54 | 55 | it('should remove parenthesis from function', () => { 56 | let exportIdentifiers = 57 | '(Sound.Tidal.Core.|<|) ::' + 58 | ' (Applicative a, Sound.Tidal.Core.Unionable b) => a b -> a b -> a b' 59 | 60 | let suggestions = provider.parse(exportIdentifiers) 61 | 62 | expect(suggestions).toContain({ 63 | text: '|<|', 64 | snippet: '|<| ', 65 | description: '(Applicative a, Sound.Tidal.Core.Unionable b) => a b -> a b -> a b', 66 | type: 'function', 67 | rightLabel: 'Sound.Tidal.Core', 68 | }) 69 | }) 70 | }) 71 | 72 | describe('suggestion details on select', () => { 73 | it('should get details from hoogle', () => { 74 | spyOn(child_process, "execSync").andReturn('documentation from hoogle\n') 75 | 76 | waitsForPromise(() => provider.getSuggestionDetailsOnSelect({ 77 | text: 'functionname', 78 | description: 'original description', 79 | rightLabel: 'Function.Module', 80 | }).then(suggestion => { 81 | expect(suggestion.description).toBe('documentation from hoogle') 82 | })) 83 | }) 84 | 85 | it('should not change anything if hoogle returns error', () => { 86 | spyOn(child_process, "execSync").andCallFake(() => { 87 | throw Error('generic error') 88 | }) 89 | 90 | waitsForPromise(() => provider.getSuggestionDetailsOnSelect({ 91 | text: 'functionname', 92 | description: 'original description', 93 | rightLabel: 'Function.Module', 94 | }).then(suggestion => { 95 | expect(suggestion.description).toBe('original description') 96 | })) 97 | }) 98 | 99 | it('should not change anything if hoogle returns "No results found"', () => { 100 | spyOn(child_process, "execSync").andReturn('No results found\n') 101 | 102 | waitsForPromise(() => provider.getSuggestionDetailsOnSelect({ 103 | text: 'functionname', 104 | description: 'original description', 105 | rightLabel: 'Function.Module', 106 | }).then(suggestion => { 107 | expect(suggestion.description).toBe('original description') 108 | }) 109 | ) 110 | }) 111 | }) 112 | 113 | }) 114 | -------------------------------------------------------------------------------- /spec/boot-tidal-spec.js: -------------------------------------------------------------------------------- 1 | const BootTidal = require('../lib/boot-tidal') 2 | const fs = require('fs') 3 | const ghc = { tidalDataDir() {} } 4 | 5 | describe('boot-tidal', () => { 6 | let bootTidal = new BootTidal(ghc, [{ path: '/current/directory' }], { appendLog: () => {}}) 7 | 8 | beforeEach(() => { 9 | waitsForPromise(() => atom.packages.activate('tidalcycles')) 10 | }) 11 | 12 | describe('boot file sequence', () => { 13 | 14 | it(`should choose current directory BootTidal.hs if it exists`, () => { 15 | spyOn(fs, 'existsSync').andReturn(true) 16 | 17 | expect(bootTidal.choosePath()).toBe('/current/directory/BootTidal.hs') 18 | }) 19 | 20 | it(`should choose custom boot file when provided`, () => { 21 | atom.config.set('tidalcycles.bootTidalPath', '/custom/directory/BootTidal.hs') 22 | spyOn(fs, 'existsSync').andReturn(true) 23 | 24 | expect(bootTidal.choosePath()).toBe('/custom/directory/BootTidal.hs') 25 | }) 26 | 27 | it('should use installation boot file when it exists and no custom provided and no file in current directory', () => { 28 | spyOn(fs, 'existsSync').andCallFake(path => { 29 | switch (path) { 30 | case '/some/path/tidal/BootTidal.hs': return true; 31 | default: return false; 32 | } 33 | }); 34 | spyOn(ghc, 'tidalDataDir').andReturn('/some/path/tidal') 35 | 36 | expect(bootTidal.choosePath()).toBe('/some/path/tidal/BootTidal.hs') 37 | }) 38 | 39 | it('should choose default boot file when no custom provided, no file in current directory and platform resolved file does not exist', () => { 40 | spyOn(fs, 'existsSync').andCallFake(path => { 41 | switch (path) { 42 | case '/unexistent/path': return false; 43 | default: return false; 44 | } 45 | }); 46 | spyOn(ghc, 'tidalDataDir').andReturn('/unexistent/path') 47 | 48 | expect(bootTidal.choosePath()).toContain('/lib/BootTidal.hs') 49 | }) 50 | 51 | it('should choose default boot file when no custom provided, no file in current directory and tidalDataDir throws error', () => { 52 | spyOn(fs, 'existsSync').andCallFake(path => { 53 | switch (path) { 54 | case '/unexistent/path': return false; 55 | default: return false; 56 | } 57 | }); 58 | spyOn(ghc, 'tidalDataDir').andCallFake(() => { 59 | throw 'generic error' 60 | }) 61 | 62 | expect(bootTidal.choosePath()).toContain('/lib/BootTidal.hs') 63 | }) 64 | 65 | }) 66 | 67 | describe('blocks', () => { 68 | it('should extract code blocks from BootTidal file', () => { 69 | bootTidal.choosePath = () => 'spec/TestBootTidal.hs' 70 | 71 | let blocks = bootTidal.blocks() 72 | 73 | expect(blocks.length).toEqual(4) 74 | expect(blocks[0]).toEqual(':set -XOverloadedStrings') 75 | expect(blocks[1]).toEqual(':set prompt ""') 76 | expect(blocks[2]).toContain('import') 77 | expect(blocks[3]).toContain('let p = ') 78 | }) 79 | }) 80 | }) 81 | -------------------------------------------------------------------------------- /spec/ghc-spec.js: -------------------------------------------------------------------------------- 1 | const child_process = require('child_process') 2 | const fs = require('fs') 3 | const os = require('os') 4 | const Ghc = require('../lib/ghc') 5 | 6 | describe('ghc', () => { 7 | 8 | let ghc = new Ghc({ logStdout: () => {}, logStderr: () => {}, appendLog: () => {}, flushLog: () => {} }) 9 | 10 | beforeEach(() => { 11 | waitsForPromise(() => atom.packages.activate('tidalcycles')) 12 | }) 13 | 14 | describe('command path', () => { 15 | it(`should choose ghcup path by default`, () => { 16 | spyOn(fs, 'existsSync').andReturn(true) 17 | 18 | ghc.init() 19 | 20 | expect(ghc.interactivePath).toBe(os.homedir() + '/.ghcup/bin/ghci') 21 | expect(ghc.pkgPath).toContain(os.homedir() + '/.ghcup/bin/ghc-pkg') 22 | }) 23 | 24 | it(`should be itself if ghcup path does not exists`, () => { 25 | spyOn(fs, 'existsSync').andReturn(false) 26 | 27 | ghc.init() 28 | 29 | expect(ghc.interactivePath).toBe('ghci') 30 | expect(ghc.pkgPath).toBe('ghc-pkg') 31 | }) 32 | 33 | it(`should be consistent with ghciPath property if it exists`, () => { 34 | atom.config.set('tidalcycles.ghciPath', '/some/path/ghci') 35 | 36 | ghc.init() 37 | 38 | expect(ghc.interactivePath).toBe('/some/path/ghci') 39 | expect(ghc.pkgPath).toBe('/some/path/ghc-pkg') 40 | }) 41 | 42 | it(`should replace tilde with home path from ghciPath property if it exists`, () => { 43 | atom.config.set('tidalcycles.ghciPath', '~/path/to/ghci') 44 | 45 | ghc.init() 46 | 47 | expect(ghc.interactivePath).toBe(os.homedir() + '/path/to/ghci') 48 | expect(ghc.pkgPath).toBe(os.homedir() + '/path/to/ghc-pkg') 49 | }) 50 | 51 | it(`should append command to ghciPath property if this indicates a folder`, () => { 52 | atom.config.set('tidalcycles.ghciPath', '/some/path') 53 | 54 | ghc.init() 55 | 56 | expect(ghc.interactivePath).toBe('/some/path/ghci') 57 | expect(ghc.pkgPath).toBe('/some/path/ghc-pkg') 58 | }) 59 | 60 | it(`should handle ghciPath property terminating with path separator`, () => { 61 | atom.config.set('tidalcycles.ghciPath', '/some/path/') 62 | 63 | ghc.init() 64 | 65 | expect(ghc.interactivePath).toBe('/some/path/ghci') 66 | expect(ghc.pkgPath).toBe('/some/path/ghc-pkg') 67 | }) 68 | 69 | it(`should handle stack interpreter`, () => { 70 | atom.config.set('tidalcycles.interpreter', 'stack') 71 | 72 | ghc.init() 73 | 74 | expect(ghc.interactivePath).toBe('stack exec --package tidal ghci') 75 | expect(ghc.pkgPath).toBe('stack exec --package tidal ghc-pkg') 76 | }) 77 | 78 | it(`should handle nix interpreter`, () => { 79 | atom.config.set('tidalcycles.interpreter', 'nix') 80 | 81 | ghc.init() 82 | 83 | expect(ghc.interactivePath).toBe('nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.tidal])" --run ghci') 84 | expect(ghc.pkgPath).toBe('nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.tidal])" --run "ghc-pkg"') 85 | }) 86 | }) 87 | 88 | describe('ghc-pkg command', () => { 89 | it('should execute ghc-pkg command and trim the result', () => { 90 | spyOn(child_process, 'execSync').andReturn(' command result \n') 91 | 92 | let commandResult = ghc.pkg('command definition') 93 | 94 | expect(commandResult).toBe('command result') 95 | }) 96 | 97 | it(`should wrap ghc-pkg in double quotes for default interpreter to handle whitespaces in path`, () => { 98 | spyOn(child_process, 'execSync').andReturn('') 99 | atom.config.set('tidalcycles.interpreter', 'default') 100 | atom.config.set('tidalcycles.ghciPath', '/path with whitespace') 101 | 102 | ghc.init() 103 | ghc.pkg('command arguments') 104 | 105 | expect(child_process.execSync.calls[0].args[0]).toBe('"/path with whitespace/ghc-pkg" command arguments') 106 | }) 107 | 108 | it(`should not wrap ghc-pkg in double quotes for stack interpreter`, () => { 109 | spyOn(child_process, 'execSync').andReturn('') 110 | atom.config.set('tidalcycles.interpreter', 'stack') 111 | 112 | ghc.init() 113 | ghc.pkg('command arguments') 114 | 115 | expect(child_process.execSync.calls[0].args[0]).toBe('stack exec --package tidal ghc-pkg command arguments') 116 | }) 117 | 118 | it(`should not wrap ghc-pkg in double quotes for nix interpreter`, () => { 119 | spyOn(child_process, 'execSync').andReturn('') 120 | atom.config.set('tidalcycles.interpreter', 'nix') 121 | 122 | ghc.init() 123 | ghc.pkg('command arguments') 124 | 125 | expect(child_process.execSync.calls[0].args[0]).toBe('nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.tidal])" --run "ghc-pkg command arguments"') 126 | }) 127 | }) 128 | 129 | describe('tidal data dir', () => { 130 | it('should handle spaces in returning path', () => { 131 | spyOn(ghc, 'pkg').andReturn('data-dir: /some/pa th/tidal\n') 132 | 133 | ghc.tidalDataDir() 134 | 135 | expect(ghc.tidalDataDir()).toBe('/some/pa th/tidal') 136 | }) 137 | 138 | it(`should return what it gets when there's no path in ghc-pkg path`, () => { 139 | spyOn(ghc, 'pkg').andReturn('no-path-in-this-output\n') 140 | 141 | ghc.tidalDataDir() 142 | 143 | expect(ghc.tidalDataDir()).toBe('no-path-in-this-output') 144 | }) 145 | }) 146 | 147 | describe('browseTidal', () => { 148 | it(`should wrap ghci path with double quotes for default interpreter to handle whitespace-in-path`, () => { 149 | atom.config.set('tidalcycles.interpreter', 'default') 150 | atom.config.set('tidalcycles.ghciPath', '/path whitespace/') 151 | spyOn(child_process, 'exec') 152 | 153 | ghc.init() 154 | ghc.browseTidal(() => {}) 155 | 156 | expect(child_process.exec.calls[0].args[0]).toBe('echo ":browse Sound.Tidal.Context" | "/path whitespace/ghci"') 157 | }) 158 | 159 | it(`should not wrap ghci path with double quotes for stack interpreter`, () => { 160 | atom.config.set('tidalcycles.interpreter', 'stack') 161 | spyOn(child_process, 'exec') 162 | 163 | ghc.init() 164 | ghc.browseTidal(() => {}) 165 | 166 | expect(child_process.exec.calls[0].args[0]).toBe('echo ":browse Sound.Tidal.Context" | stack exec --package tidal ghci') 167 | }) 168 | 169 | it(`should not wrap ghci path with double quotes for nix interpreter`, () => { 170 | atom.config.set('tidalcycles.interpreter', 'nix') 171 | spyOn(child_process, 'exec') 172 | 173 | ghc.init() 174 | ghc.browseTidal(() => {}) 175 | 176 | expect(child_process.exec.calls[0].args[0]).toBe('echo ":browse Sound.Tidal.Context" | nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.tidal])" --run ghci') 177 | }) 178 | }) 179 | 180 | describe(`interactive`, () => { 181 | it(`should wrap ghci path with double quotes when interpreter is default`, () => { 182 | atom.config.set('tidalcycles.interpreter', 'default') 183 | atom.config.set('tidalcycles.ghciPath', '/path whitespace/') 184 | spyOn(child_process, 'spawn').andReturn({ stderr: { on: () => {}}, stdout: {on: () => {}}}) 185 | 186 | ghc.init() 187 | ghc.interactive() 188 | 189 | expect(child_process.spawn.calls[0].args[0]).toBe('"/path whitespace/ghci"') 190 | }) 191 | 192 | it(`should not wrap ghci path with double quotes when interpreter is stack`, () => { 193 | atom.config.set('tidalcycles.interpreter', 'stack') 194 | spyOn(child_process, 'spawn').andReturn({ stderr: { on: () => {}}, stdout: {on: () => {}}}) 195 | 196 | ghc.init() 197 | ghc.interactive() 198 | 199 | expect(child_process.spawn.calls[0].args[0]).toBe('stack exec --package tidal ghci') 200 | }) 201 | 202 | it(`should not wrap ghci path with double quotes when interpreter is nix`, () => { 203 | atom.config.set('tidalcycles.interpreter', 'nix') 204 | spyOn(child_process, 'spawn').andReturn({ stderr: { on: () => {}}, stdout: {on: () => {}}}) 205 | 206 | ghc.init() 207 | ghc.interactive() 208 | 209 | expect(child_process.spawn.calls[0].args[0]).toBe('nix-shell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.tidal])" --run ghci') 210 | }) 211 | }) 212 | 213 | }) 214 | -------------------------------------------------------------------------------- /spec/repl-spec.js: -------------------------------------------------------------------------------- 1 | const Repl = require('../lib/repl.js') 2 | 3 | describe('repl', () => { 4 | let consoleView = { 5 | logStdout: () => {}, 6 | logMutes: () => {}, 7 | appendLog: () => {}, 8 | flushLog: () => {} 9 | } 10 | let bootTidal = { choosePath: () => '', blocks: () => [] } 11 | let repl = new Repl(consoleView, {}, bootTidal) 12 | 13 | beforeEach(() => { 14 | waitsForPromise(() => atom.packages.activate('tidalcycles')) 15 | }) 16 | 17 | describe('init tidal', () => { 18 | 19 | it('should load BootTidal with :script', () => { 20 | spyOn(repl, 'tidalSendLine') 21 | bootTidal.choosePath = () => 'lib/BootTidal.hs' 22 | 23 | repl.initTidal() 24 | 25 | expect(repl.tidalSendLine.callCount).toBe(1) 26 | expect(repl.tidalSendLine.calls[0].args[0]).toBe(':script lib/BootTidal.hs') 27 | }) 28 | 29 | it('should load BootTidal sending every script block to ghci if path contains a whitespace (because ghci can\'t handle whitespaces in :script)', () => { 30 | spyOn(repl, 'tidalSendLine') 31 | spyOn(repl, 'tidalSendExpression') 32 | bootTidal.choosePath = () => 'lib whitespace/BootTidal.hs' 33 | bootTidal.blocks = () => [':set im a single expression',"im a standard\ncode block"] 34 | 35 | repl.initTidal() 36 | 37 | expect(repl.tidalSendLine.callCount).toBe(1) 38 | expect(repl.tidalSendLine.calls[0].args[0]).toBe(':set im a single expression') 39 | expect(repl.tidalSendExpression.callCount).toBe(1) 40 | expect(repl.tidalSendExpression.calls[0].args[0]).toBe('im a standard\ncode block') 41 | }) 42 | }) 43 | 44 | describe('toggle mute', () => { 45 | 46 | it('should unmute a connection already muted', () => { 47 | spyOn(repl, 'tidalSendLine') 48 | 49 | repl.toggleMute('3') 50 | repl.toggleMute('3') 51 | 52 | expect(repl.tidalSendLine.callCount).toBe(2) 53 | expect(repl.tidalSendLine.calls[0].args[0]).toBe('mute 3') 54 | expect(repl.tidalSendLine.calls[1].args[0]).toBe('unmute 3') 55 | }) 56 | }) 57 | 58 | describe('unmute all', () => { 59 | it('should unmuteAll', () => { 60 | spyOn(repl, 'tidalSendLine') 61 | 62 | repl.unmuteAll() 63 | 64 | expect(repl.tidalSendLine.callCount).toBe(1) 65 | expect(repl.tidalSendLine.calls[0].args[0]).toBe('unmuteAll') 66 | }) 67 | }) 68 | }) 69 | -------------------------------------------------------------------------------- /styles/tidal.less: -------------------------------------------------------------------------------- 1 | // The ui-variables file is provided by base themes provided by Pulsar. 2 | // 3 | // See https://github.com/pulsar-edit/pulsar/blob/master/static/variables/ui-variables.less 4 | // for a full listing of what's available. 5 | @import "ui-variables"; 6 | 7 | @soundbrowser-icon-font: 'Octicons Regular'; 8 | 9 | atom-text-editor.editor .line { 10 | transition: background-color .8s ease-out; 11 | -webkit-transition: background-color .8s ease-out; 12 | 13 | &.line-error { 14 | background-color: fadeout(@background-color-error, 95%); 15 | border: 1px solid fadeout(@background-color-error, 50%); 16 | } 17 | 18 | &.line-highlight { 19 | background-color: @background-color-highlight; 20 | } 21 | 22 | &.eval-flash { 23 | color: @text-color-selected; 24 | background-color: @background-color-selected; 25 | } 26 | 27 | &.eval-success { 28 | color: @text-color-success; 29 | background-color: fadeout(@background-color-success, 50%); 30 | } 31 | 32 | &.eval-error, 33 | &.eval-syntax-error { 34 | color: @text-color-error; 35 | background-color: @background-color-error; 36 | } 37 | } 38 | 39 | atom-pane div.tidalcycles.console { 40 | &.hidden{ 41 | display: none; 42 | } 43 | padding: 3px 10px; 44 | overflow: scroll; 45 | pre { 46 | font-family: Consolas, monospace; 47 | font-size: 14px; 48 | white-space: pre-wrap; 49 | word-break: keep-all; 50 | } 51 | .error{ 52 | color: @text-color-error; 53 | } 54 | } 55 | 56 | .atom-sound-browser { 57 | padding-left: 8px; 58 | padding-top: 5px; 59 | 60 | ul { 61 | padding-inline-start: 20px; 62 | } 63 | 64 | li { 65 | list-style-type: none; 66 | padding-top: 3px; 67 | padding-bottom: 3px; 68 | 69 | span.icon { 70 | margin-left: 2px; 71 | 72 | &-speaker:before { 73 | font-family: @soundbrowser-icon-font; 74 | content: '\f077'; 75 | position: absolute; 76 | right: 0; 77 | } 78 | } 79 | } 80 | 81 | li:hover { 82 | background-color: #292829; 83 | } 84 | 85 | li.icon { 86 | 87 | &-open:before { 88 | font-family: @soundbrowser-icon-font; 89 | content: '\f0A3'; 90 | } 91 | 92 | &-close:before { 93 | font-family: @soundbrowser-icon-font; 94 | content: '\f078'; 95 | margin-right: 7px; 96 | } 97 | } 98 | 99 | } 100 | --------------------------------------------------------------------------------