├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── doc └── intro.md ├── project.clj ├── resources └── samples │ ├── .gitignore │ ├── bd_boom.wav │ ├── drum_bass_hard.wav │ ├── drum_bass_soft.wav │ ├── drum_cowbell.wav │ ├── drum_cymbal_closed.wav │ ├── drum_cymbal_open.wav │ ├── drum_cymbal_pedal.wav │ ├── drum_cymbal_soft.wav │ ├── drum_ride.wav │ ├── drum_ride_bell.wav │ ├── drum_rim.wav │ ├── drum_snare_hard.wav │ ├── drum_snare_soft.wav │ ├── drum_tom_hi_hard.wav │ ├── drum_tom_lo_hard.wav │ ├── drum_tom_mid_hard.wav │ ├── finger_177495.wav │ ├── kick_171104.wav │ ├── perc_clap.wav │ └── stick_82280.wav ├── src └── overtone_loops │ ├── core.clj │ ├── dph_book │ ├── pattern_03_01.clj │ ├── pattern_03_02.clj │ ├── pattern_03_03.clj │ ├── pattern_03_05.clj │ ├── pattern_03_06.clj │ ├── pattern_03_07.clj │ ├── pattern_03_10.clj │ ├── pattern_03_11.clj │ ├── pattern_03_12.clj │ ├── pattern_03_13.clj │ ├── pattern_03_14.clj │ ├── pattern_03_15.clj │ ├── pattern_04_01.clj │ ├── pattern_04_02.clj │ ├── pattern_04_03.clj │ ├── pattern_04_04.clj │ ├── pattern_04_05.clj │ ├── pattern_04_06.clj │ ├── pattern_04_07.clj │ ├── pattern_04_08.clj │ ├── pattern_04_09.clj │ ├── pattern_04_10.clj │ ├── pattern_04_11.clj │ ├── pattern_04_12.clj │ ├── pattern_04_12a.clj │ ├── pattern_04_13.clj │ ├── pattern_04_13a.clj │ ├── pattern_04_13b.clj │ ├── pattern_04_14.clj │ ├── pattern_04_15.clj │ ├── pattern_04_16.clj │ ├── pattern_04_16_swing.clj │ ├── pattern_04_17.clj │ ├── pattern_04_18.clj │ ├── pattern_04_21.clj │ └── pattern_04_21a.clj │ ├── examples │ ├── alternate.clj │ ├── compound.clj │ ├── cowbell1.clj │ ├── heart_beat.clj │ ├── heart_beat2.clj │ ├── kick_kick_snare.clj │ ├── old_style_loop.clj │ ├── readme.clj │ ├── timing1.clj │ └── timing2.clj │ ├── freesound_samples.clj │ ├── loops.clj │ ├── music │ ├── alter1.clj │ ├── amen1.clj │ ├── drums1.clj │ ├── kick_snare1.clj │ ├── pirates.clj │ ├── rap1.clj │ ├── rap2.clj │ ├── static1.clj │ ├── sticks1.clj │ └── walk1.clj │ ├── proto │ ├── beats.clj │ ├── beats88.clj │ ├── control-samples.clj │ ├── control.clj │ ├── loop_fns.clj │ ├── mar19_2019.clj │ ├── mar19_2019b.clj │ ├── melody_loops1.clj │ ├── play_sample.clj │ ├── sample_from_file.clj │ ├── sample_from_file2.clj │ ├── schedule_tests.clj │ ├── schedule_tests_overtone.clj │ ├── schedule_tests_overtone2.clj │ ├── schedule_tests_overtone3.clj │ ├── scratch1.clj │ ├── semiquavers.clj │ ├── simple.clj │ └── triplets.clj │ ├── samples.clj │ └── utils.clj └── test └── overtone_loops ├── core_test.clj ├── loops_human_test.clj ├── loops_test.clj └── utils_test.clj /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /classes 3 | /checkouts 4 | pom.xml 5 | pom.xml.asc 6 | *.jar 7 | *.class 8 | /.lein-* 9 | /.nrepl-port 10 | .hgignore 11 | .hg/ 12 | .DS_Store 13 | .lsp/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). 3 | 4 | ## [Unreleased] 5 | ### Changed 6 | - Add a new arity to `make-widget-async` to provide a different widget shape. 7 | 8 | ## [0.1.1] - 2018-12-11 9 | ### Changed 10 | - Documentation on how to make the widgets. 11 | 12 | ### Removed 13 | - `make-widget-sync` - we're all async, all the time. 14 | 15 | ### Fixed 16 | - Fixed widget maker to keep working when daylight savings switches over. 17 | 18 | ## 0.1.0 - 2018-12-11 19 | ### Added 20 | - Files from the new template. 21 | - Widget maker public API - `make-widget-sync`. 22 | 23 | [Unreleased]: https://github.com/your-name/overtone-loops/compare/0.1.1...HEAD 24 | [0.1.1]: https://github.com/your-name/overtone-loops/compare/0.1.0...0.1.1 25 | -------------------------------------------------------------------------------- /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 | # Overtone Loops 2 | 3 | A simple, yet flexible, loop syntax for Overtone, to make drum patterns or other repeating phrases. Have a look at a quick demo video: https://youtu.be/4Tj7AIRwK9w 4 | 5 | Currently this work is highly experimental. Feel free to leave suggestions on the Issues page. I should point out that I'm not a talented drummer! 6 | 7 | ## How do you program loops? 8 | 9 | First load in Overtone Live and Loops namespaces `loops` and `samples`: 10 | 11 | ``` 12 | (use 'overtone.live 13 | 'overtone-loops.loops 14 | 'overtone-loops.samples) 15 | ``` 16 | 17 | Then create loop players with an instrument and a list of beats. Each value in the list is an amplitude. 18 | 19 | ``` 20 | ;; clear any previous patterns 21 | (set-up) 22 | 23 | ;; beat 1 2 3 4 5 6 7 8 24 | (def hats 25 | (loop-player 1 cymbal-closed [_ 5 _ 5 _ 5 _ 5])) 26 | (def kicks 27 | (loop-player 1 bass-hard [7 _ 2 _ 7 6 2 _])) 28 | (def claps 29 | (loop-player 1 clap [_ _ 4 _])) 30 | ``` 31 | 32 | The parameters to `loop-player` are: beat-fraction where 1 is whole beats, 1/2 is half beats and so on; the instrument to play; and a list of amplitudes to pass to the instrument on each beat, where `_` is equivalent to `0`, a muted beat. For ease of coding the scale of amplitudes are 0 (silence) to 9 (full), these are converted to a number between 0 and 1, which is what the instrument expects. 33 | 34 | To play these loops just call the loop-name function with a timer from `(metro)`, do set the `bpm` first to ensure the correct playback speed. 35 | 36 | ``` 37 | (bpm 200) 38 | (hats (metro)) 39 | (kicks (metro)) 40 | (claps (metro)) 41 | ;; To stop 42 | (stop) 43 | ``` 44 | 45 | Usually you'll want some sort of scheduling, use `at-bar` to set the appropriate time, replacing the above code with: 46 | 47 | ``` 48 | (beats-in-bar 4) 49 | (bpm 200) 50 | (at-bar 1 (hats) (kicks)) 51 | (at-bar 3 (claps)) 52 | ``` 53 | 54 | Now, when a loop is playing you can give it an alternative beat pattern, like so: 55 | 56 | ``` 57 | (beats-in-bar 4) 58 | (at-bar 1 (hats) (kicks)) 59 | (at-bar 3 (claps)) 60 | 61 | (at-bar 5 (hats [9 3 9 3 9 5 6 7]) 62 | (kicks [_ _ 2 _ _ 2 _ _])) 63 | 64 | ;; return to previous patterns 65 | (at-bar 7 (hats :pop) 66 | (kicks :pop)) 67 | ``` 68 | 69 | Here's an example with half and third beats: 70 | 71 | ``` 72 | ;; beat 1 & 2 & 3 & 4 & 73 | (def hats 74 | (loop-player 1/2 cymbal-closed [_ 5 _ 5 _ 5 _ 5 ])) 75 | (def kicks 76 | (loop-player 1/2 bass-hard [7 _ 2 _ 7 6 2 _ ])) 77 | (def claps 78 | (loop-player 1 clap [_ _ 7 _ ])) 79 | (def bells 80 | (loop-player 1/3 cowbell [_ _ _ 5 _ 1 5 1 _ _ 1 5])) 81 | ``` 82 | 83 | Then run with: 84 | 85 | ``` 86 | (bpm 120) 87 | (at-bar 1 (hats) (kicks) (claps) (bells)) 88 | ``` 89 | 90 | Check out the documentation for `at-bar` and `on-next-bar` to find out more about scheduling. E.g. `(odoc at-bar)`. 91 | 92 | ## More than amplitude 93 | 94 | If you want to send your instrument more than just an amplitude you can use a nested loop syntax. For example, here's how we can program a note and amplitude with a helper function `k`: 95 | 96 | ``` 97 | (use 'overtone.inst.piano) 98 | 99 | (defn k [[anote amp]] 100 | (piano (note anote) :vel (* amp 10))) 101 | 102 | (def melody1 103 | (loop-player 1 k [[:g4 8] [:a4 4] [:b4 6] [:c5 7]])) 104 | 105 | (melody1 (metro)) 106 | ``` 107 | 108 | ## More examples 109 | 110 | See code in [examples](src/overtone_loops/examples) or [music](src/overtone_loops/music). 111 | 112 | ## The Drum Programming Handbook 113 | 114 | I'm working through the exercises in The Drum Programming Handbook and you can see them in the [dph_book folder](src/overtone_loops/dph_book). 115 | 116 | ## License 117 | 118 | Copyright © 2018-2019 Eric Clack 119 | 120 | Samples copyright various authors on freesound.org 121 | 122 | Distributed under the GNU General Public License v3.0 123 | -------------------------------------------------------------------------------- /doc/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction to overtone-loops 2 | 3 | TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) 4 | -------------------------------------------------------------------------------- /project.clj: -------------------------------------------------------------------------------- 1 | (require '[leiningen.core.utils :refer [get-os]]) 2 | 3 | (def JVMOPTS 4 | "Per os jvm options. Options common to all cases go under 5 | `:any`. Options specific to one OS go under the key returned by 6 | `leiningen.core.eval/get-os` for that system. Temporarily disabled 7 | options can be kept under `:disabled`." 8 | {:any 9 | ["-Xms512m" "-Xmx1g" ; Minimum and maximum sizes of the heap 10 | "-XX:+UseParNewGC" ; Use the new parallel GC in conjunction with 11 | "-XX:+UseConcMarkSweepGC" ; the concurrent garbage collector 12 | "-XX:+CMSConcurrentMTEnabled" ; Enable multi-threaded concurrent gc work (ParNewGC) 13 | "-XX:MaxGCPauseMillis=20" ; Specify a target of 20ms for max gc pauses 14 | "-XX:MaxNewSize=257m" ; Specify the max and min size of the new 15 | "-XX:NewSize=256m" ; generation to be small 16 | "-XX:+UseTLAB" ; Uses thread-local object allocation blocks. This 17 | ; improves concurrency by reducing contention on 18 | ; the shared heap lock. 19 | "-XX:MaxTenuringThreshold=0"] ; Makes the full NewSize available to every NewGC 20 | ; cycle, and reduces the pause time by not 21 | ; evaluating tenured objects. Technically, this 22 | ; setting promotes all live objects to the older 23 | ; generation, rather than copying them. 24 | :macosx 25 | ["-Xdock:name=Overtone"] 26 | :disabled 27 | ["-XX:ConcGCThreads=2" ; Use 2 threads with concurrent gc collections 28 | "-XX:TieredCompilation" ; JVM7 - combine both client and server compilation 29 | ; strategies 30 | "-XX:CompileThreshold=1" ; JIT each function after one execution 31 | "-XX:+PrintGC" ; Print GC info to stdout 32 | "-XX:+PrintGCDetails" ; - with details 33 | "-XX:+PrintGCTimeStamps"]}) ; - and timestamps 34 | 35 | (defn jvm-opts 36 | "Return a complete vector of jvm-opts for the current os." 37 | [] (let [os (get-os)] 38 | (vec (set (concat (get JVMOPTS :any) 39 | (get JVMOPTS os)))))) 40 | 41 | (defproject overtone-loops "0.1.0-SNAPSHOT" 42 | :description "FIXME: write description" 43 | :url "http://example.com/FIXME" 44 | :license {:name "Eclipse Public License" 45 | :url "http://www.eclipse.org/legal/epl-v10.html"} 46 | :dependencies [[org.clojure/clojure "1.9.0"] 47 | [overtone "0.10.6"] 48 | ] 49 | :jvm-opts ^:replace ~(jvm-opts)) 50 | -------------------------------------------------------------------------------- /resources/samples/.gitignore: -------------------------------------------------------------------------------- 1 | *.flac -------------------------------------------------------------------------------- /resources/samples/bd_boom.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/bd_boom.wav -------------------------------------------------------------------------------- /resources/samples/drum_bass_hard.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_bass_hard.wav -------------------------------------------------------------------------------- /resources/samples/drum_bass_soft.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_bass_soft.wav -------------------------------------------------------------------------------- /resources/samples/drum_cowbell.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_cowbell.wav -------------------------------------------------------------------------------- /resources/samples/drum_cymbal_closed.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_cymbal_closed.wav -------------------------------------------------------------------------------- /resources/samples/drum_cymbal_open.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_cymbal_open.wav -------------------------------------------------------------------------------- /resources/samples/drum_cymbal_pedal.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_cymbal_pedal.wav -------------------------------------------------------------------------------- /resources/samples/drum_cymbal_soft.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_cymbal_soft.wav -------------------------------------------------------------------------------- /resources/samples/drum_ride.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_ride.wav -------------------------------------------------------------------------------- /resources/samples/drum_ride_bell.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_ride_bell.wav -------------------------------------------------------------------------------- /resources/samples/drum_rim.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_rim.wav -------------------------------------------------------------------------------- /resources/samples/drum_snare_hard.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_snare_hard.wav -------------------------------------------------------------------------------- /resources/samples/drum_snare_soft.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_snare_soft.wav -------------------------------------------------------------------------------- /resources/samples/drum_tom_hi_hard.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_tom_hi_hard.wav -------------------------------------------------------------------------------- /resources/samples/drum_tom_lo_hard.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_tom_lo_hard.wav -------------------------------------------------------------------------------- /resources/samples/drum_tom_mid_hard.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/drum_tom_mid_hard.wav -------------------------------------------------------------------------------- /resources/samples/finger_177495.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/finger_177495.wav -------------------------------------------------------------------------------- /resources/samples/kick_171104.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/kick_171104.wav -------------------------------------------------------------------------------- /resources/samples/perc_clap.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/perc_clap.wav -------------------------------------------------------------------------------- /resources/samples/stick_82280.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/resources/samples/stick_82280.wav -------------------------------------------------------------------------------- /src/overtone_loops/core.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.core) 2 | 3 | (defn foo 4 | "I don't do a whole lot." 5 | [x] 6 | (println x "Hello, World!")) 7 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_01.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-01 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; 1 & 2 & 3 & 4 & 10 | (defloop closed-hhs 1/2 cymbal-closed [7 7 7 7 7 7 7 7 ]) 11 | (defloop sds 1/2 snare-hard [_ _ 8 _ _ _ 8 _ ]) 12 | (defloop kicks 1/2 bass-hard [8 _ _ _ 8 _ _ _ ]) 13 | 14 | ;; --------------------------------------------- 15 | 16 | (bpm 120) 17 | (beats-in-bar 4) 18 | 19 | (at-bar 1 20 | (closed-hhs) 21 | (sds) 22 | (kicks)) 23 | 24 | ;;(stop) 25 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_02.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-02 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR4 10 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 11 | (defloop closed-hhs 12 | 1/2 cymbal-closed [7 7 7 7 7 7 7 7 ]) 13 | (defloop sds 14 | 1/2 snare-hard [_ _ 8 _ _ _ 8 _ ]) 15 | (defloop kicks 16 | 1/2 bass-hard [8 _ _ _ 8 _ _ _ 8 _ _ _ 8 8 _ _ 8 8 _ _ _ 8 _ _ 8 8 _ 8 _ 8 _ 8]) 17 | 18 | ;; --------------------------------------------- 19 | 20 | (bpm 120) 21 | (beats-in-bar 4) 22 | 23 | (at-bar 1 24 | (closed-hhs) 25 | (sds) 26 | (kicks)) 27 | 28 | ;;(stop) 29 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_03.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-03 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR4 10 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 11 | (defloop closed-hhs 12 | 1/2 cymbal-closed [7 7 7 7 7 7 7 7 ]) 13 | (defloop sds 14 | 1/2 snare-hard [_ _ 8 _ _ _ 8 _ ]) 15 | 16 | (defloop kicks 17 | 1/2 bass-hard [8 _ _ _ 8 _ _ _ 8 _ _ _ 8 8 _ _ 8 8 _ _ _ 8 _ _ 8 8 _ 8 _ 8 _ 8 18 | _ _ 8 _ _ 4 8 _ 8 8 8 _ _ 8 _ _ 8 _ _ _ 8 8 _ _ 8 4 8 4 8 4 8 4]) 19 | 20 | ;; --------------------------------------------- 21 | 22 | (bpm 120) 23 | (beats-in-bar 4) 24 | 25 | (at-bar 1 26 | (closed-hhs) 27 | (sds) 28 | (kicks) 29 | ) 30 | 31 | ;;(stop) 32 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_05.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-05 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR4 10 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 11 | (defloop closed-hhs 12 | 1/2 cymbal-closed [7 7 7 7 7 7 7 7 ]) 13 | (defloop sds 14 | 1/2 snare [_ _ 8 _ _ 8 _ 8 _ _ 8 _ 8 _ 8 _ _ 8 _ _ _ _ 8 _ _ 8 _ _ 8 _ 8 _ ]) 15 | 16 | (defloop kicks 17 | 1/2 kick [8 _ _ 8 8 _ _ _ 8 _ _ 8 _ 8 _ _ 8 _ _ 8 8 _ _ 8 8 _ 8 8 _ 8 _ _ ]) 18 | 19 | (bpm 96) 20 | (beats-in-bar 4) 21 | 22 | (at-bar 1 23 | (closed-hhs) 24 | (sds) 25 | (kicks) 26 | ) 27 | 28 | ;;(stop) 29 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_06.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-06 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR4 10 | 11 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 12 | (defloop closed-hhs 13 | 1/2 cymbal-closed [7 5 7 4 6 3 8 4 ]) 14 | 15 | (defloop sds 1/2 snare [_ _ 8 _ _ _ 8 _ ]) 16 | (defloop kicks 1/2 kick [8 _ _ _ 8 _ _ _ 8 _ _ _ 8 8 _ _ 8 8 _ _ _ 8 _ _ 8 8 _ 8 _ 8 _ 8]) 17 | 18 | ;; Variations 19 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 20 | (def kicks02 [8 _ _ _ 8 _ _ _ 8 _ _ _ 8 8 _ _]) 21 | (def kicks03 [8 _ _ _ 8 _ _ _ 8 _ _ _ 8 8 _ _ 8 8 _ _ _ 8 _ _]) 22 | 23 | (def sds1 [_ _ 8 _ _ 8 _ 8]) 24 | (def kicks1 [8 _ _ 8 8 _ _ _]) 25 | 26 | (def sds2 [_ _ 8 _ 8 _ 8 _]) 27 | (def kicks2 [8 _ _ 8 _ 8 _ _]) 28 | 29 | (def sds3 [_ 8 _ _ _ _ 8 _]) 30 | (def kicks3 [8 _ _ 8 8 _ _ 8]) 31 | 32 | (def sds4 [_ 8 _ _ 8 _ 8 _]) 33 | (def kicks4 [8 _ 8 8 _ 8 _ _]) 34 | 35 | (bpm 160) 36 | (beats-in-bar 4) 37 | 38 | ;; We use at-bar to schedule the loops 39 | 40 | (at-bar 1 41 | ;; same HH pattern all the way through 42 | (closed-hhs) 43 | 44 | (sds) 45 | (kicks) 46 | ) 47 | 48 | ;; Now mix it up: 49 | ;; Bars 5-8 50 | 51 | (at-bar 5 52 | (kicks kicks03) ;; 3 bar 53 | ) 54 | 55 | (at-bar 8 56 | (sds sds1) 57 | (kicks kicks1) 58 | ) 59 | 60 | (at-bar 9 61 | (kicks kicks02) ;; 2 bar 62 | ) 63 | 64 | (at-bar 11 65 | (sds sds3) 66 | (kicks kicks3) 67 | ) 68 | 69 | (at-bar 12 70 | (sds sds4) 71 | (kicks kicks4) 72 | ) 73 | 74 | (at-bar 13 75 | ;; Bars 13-16 76 | (sds :first) 77 | (kicks kicks02) 78 | ) 79 | 80 | (at-bar 15 81 | (sds sds2) 82 | (kicks kicks2) 83 | ) 84 | 85 | (at-bar 16 86 | (sds sds1) 87 | (kicks kicks1) 88 | ) 89 | 90 | ;; Back to usual 17-20 91 | (at-bar 17 92 | (sds :first) 93 | (kicks :first) 94 | ) 95 | 96 | (at-bar 21 97 | (sds []) 98 | (kicks []) 99 | ) 100 | 101 | (at-bar 22 102 | (closed-hhs [])) 103 | 104 | ;;(stop) 105 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_07.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-07 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR4 10 | 11 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 12 | (defloop closed-hhs 1/2 cymbal-closed [7 3 7 3 7 3 7 6 ]) 13 | (defloop sds 1/2 snare [_ _ 7 _ _ _ 7 _ ]) 14 | (defloop kicks 1/2 kick [7 7 _ _ _ 7 _ _ ]) 15 | 16 | (bpm 110) 17 | (beats-in-bar 4) 18 | 19 | (at-bar 1 20 | (closed-hhs ) 21 | (sds ) 22 | (kicks ) 23 | ) 24 | 25 | ;;(stop) 26 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_10.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-10 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 10 | (defloop closed-hhs 1/4 cymbal-closed 11 | [7 _ 5 _ 7 _ 4 _ 8 _ 5 _ 8 _ 6 _ ]) 12 | (defloop sds 1/4 snare [_ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ ]) 13 | 14 | (defloop kicks 1/4 kick [6 _ _ 6 _ _ _ 6 _ _ _ 7 _ _ _ _ 15 | 7 _ _ _ _ _ _ 6 7 _ 7 _ _ _ 6 _ 16 | 7 _ 6 7 _ _ _ 6 _ _ 7 _ _ 6 _ _ 17 | 7 _ 6 _ _ 6 _ 6 7 _ 7 8 _ 7 _ 7]) 18 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 19 | 20 | (bpm 100) 21 | (beats-in-bar 4) 22 | 23 | (at-bar 1 24 | (closed-hhs) 25 | (sds) 26 | (kicks) 27 | ) 28 | 29 | ;;(stop) 30 | 31 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_11.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-11 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Quarter beats 10 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 11 | ;; | | | | | | | | | | | | | | | | 12 | (defloop closed-hhs 1/4 cymbal-closed 13 | [7 _ 5 _ 7 _ 4 _ 8 _ 5 _ 8 _ 6 _ ]) 14 | (defloop sds 1/4 snare 15 | [_ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ 5 _ 5 _ _ 7 _ 6 _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ ]) 16 | (defloop kicks 1/4 kick 17 | [6 _ _ 6 _ _ _ 6 _ _ 7 _ _ _ _ _ 6 _ _ _ _ _ _ 5 6 _ 7 _ _ _ 7 _ 7 _ 6 7 _ _ _ 7 _ _ 7 _ _ 7 _ _ 8 _ 7 _ _ 7 _ 7 8 _ 7 8 _ 7 _ 6 ]) 18 | ;; | | | | | | | | | | | | | | | | 19 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 20 | 21 | (bpm 100) 22 | (beats-in-bar 4) 23 | 24 | (at-bar 1 25 | (closed-hhs) 26 | (sds) 27 | (kicks) 28 | ) 29 | 30 | ;;(stop) 31 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_12.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-12 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Quarter beats 10 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 11 | (defloop closed-hhs 1/4 cymbal-closed 12 | [7 _ _ _ 7 _ _ _ 7 _ _ 1 7 _ _ _ ]) 13 | (defloop open-hhs 1/4 cymbal-open 14 | [3 _ _ _ 3 _ _ _ 3 _ _ 1 3 _ _ _ ]) 15 | 16 | (defloop sds 1/4 snare 17 | [_ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ 5 _ 5 _ _ 7 _ 6 _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ ]) 18 | (defloop kicks 1/4 kick 19 | [6 _ _ 6 _ _ _ 6 _ _ 7 _ _ _ _ _ 6 _ _ _ _ _ _ 5 6 _ 7 _ _ _ 7 _ 7 _ 6 7 _ _ _ 7 _ _ 7 _ _ 7 _ _ 8 _ 7 _ _ 7 _ 7 8 _ 7 8 _ 7 _ 6 ]) 20 | ;; | | | | | | | | | | | | | | | | 21 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 22 | 23 | (bpm 120) 24 | (beats-in-bar 4) 25 | 26 | (at-bar 1 27 | (closed-hhs) 28 | (sds) ;; 4 bar phrases, twice 29 | (kicks) 30 | ) 31 | 32 | (at-bar 5 33 | (closed-hhs []) 34 | (open-hhs)) 35 | 36 | ;;(stop) 37 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_13.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-13 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 10 | (defloop closed-hhs 1/4 cymbal-closed [_ _ 7 _ _ _ 7 _ _ _ 7 _ _ 1 7 _ ]) 11 | (defloop open-hhs 1/4 cymbal-open [_ _ 7 _ _ _ 7 _ _ _ 7 _ _ 1 7 _ ]) 12 | 13 | (defloop sds 1/4 snare [_ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ 5 _ 5 _ _ 7 _ 6 _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ ]) 14 | (defloop kicks 1/4 kick [6 _ _ 6 _ _ _ 6 _ _ 7 _ _ _ _ _ 6 _ _ _ _ _ _ 5 6 _ 7 _ _ _ 7 _ 7 _ 6 7 _ _ _ 7 _ _ 7 _ _ 7 _ _ 8 _ 7 _ _ 7 _ 7 8 _ 7 8 _ 7 _ 6 ]) 15 | ;; | | | | | | | | | | | | | | | | 16 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 17 | 18 | (bpm 120) 19 | (beats-in-bar 4) 20 | 21 | (at-bar 1 22 | (closed-hhs) 23 | (sds) 24 | (kicks) 25 | ) 26 | 27 | (at-bar 5 28 | (open-hhs)) 29 | 30 | ;;(stop) 31 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_14.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-14 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 10 | (defloop rides 1/4 ride-bell [_ _ 5 _ _ _ 5 _ _ _ 5 _ _ _ 5 _ _ _ 5 _ _ _ 5 1 _ _ 5 _ _ 1 5 _ ]) 11 | 12 | (defloop sds 1/4 snare [_ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ 5 _ 5 _ _ 7 _ 6 _ _ _ _ _ 7 _ _ _ _ _ _ _ 7 _ _ _ _ 5 _ _ 7 _ _ _ ]) 13 | (defloop kicks 1/4 kick [6 _ _ 6 _ _ _ 6 _ _ 7 _ _ _ _ _ 6 _ _ _ _ _ _ 5 6 _ 7 _ _ _ 7 _ 7 _ 6 7 _ _ _ 7 _ _ 7 _ _ 7 _ _ 8 _ 7 _ _ 7 _ 7 8 _ 7 8 _ 7 _ 6 ]) 14 | ;; | | | | | | | | | | | | | | | | 15 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 16 | 17 | (bpm 120) 18 | (beats-in-bar 4) 19 | 20 | (at-bar 1 21 | (rides) 22 | (sds) 23 | (kicks) 24 | ) 25 | 26 | ;;(stop) 27 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_03_15.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-03-15 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def open-hh (freesound2 404893)) 8 | (def ride-bell (freesound2 171482)) 9 | (def pedal-hh (freesound2 93910)) 10 | (def snare (freesound2 404859)) 11 | (def kick (freesound2 171104)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 17 | ;; | | | | | | | | | | | | | | | | 18 | (defloop rides (8 1/4) ride-bell [- - 5 - - - 5 - - - 5 - - - 5 - - - 5 - - 1 5 - - - 5 1 3 - 5 - ]) 19 | (defloop hats (8 1/4) pedal-hh [7 - - - 7 - - - 7 - - - 7 - - - 7 1 - - 7 - 5 - 7 1 - - 7 - - - ]) 20 | 21 | (defloop sds (16 1/4) snare [- - - - 7 - - - - 5 - - 7 - - - - - - - 7 - - - - - - - 7 - - 5 - 5 - - 7 - 6 - - - - - 7 - - - - - - - 7 - - - - 5 - - 7 - - - ]) 22 | (defloop kicks (16 1/4) kick [6 - - 6 - - - 6 - - 7 - - - - - 6 - - - - - - 5 6 - 7 - - - 7 - 7 - 6 7 - - - 7 - - 7 - - 7 - - 8 - 7 - - 7 - 7 8 - 7 8 - 7 - 6 ]) 23 | ;; | | | | | | | | | | | | | | | | 24 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 25 | 26 | (bpm 120) 27 | (beats-in-bar 4) 28 | 29 | (at-bar 1 30 | (rides 4) 31 | (hats 4) 32 | (sds 2) ;; 4 bar phrases, twice 33 | (kicks 2) 34 | ) 35 | 36 | ;;(stop) 37 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_01.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-01 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 404859)) 8 | (def kick (freesound2 171104)) 9 | 10 | ;; We want to use amps between 0 and 9 in our lists 11 | (amp-scale 1/9) 12 | 13 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 14 | ;; | | | | | | | | | | | | | | | | 15 | (defloop closed-hhs (8 1/4) closed-hh [5 3 7 5 5 4 8 4 5 4 7 6 4 4 8 4 4 3 8 5 5 6 7 6 5 4 7 6 5 4 8 7 ]) 16 | 17 | (defloop sds (8 1/4) snare [- - - - 7 - - - - 5 - - 7 - - - - - - - 7 - - - - - - - 7 - - 5 ]) 18 | (defloop kicks (8 1/4) kick [6 - - 6 - - - 6 - - 7 - - - - - 6 - - - - - - 5 6 - 7 - - - 7 - ]) 19 | ;; | | | | | | | | | | | | | | | | 20 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 21 | 22 | (bpm 86) 23 | (beats-in-bar 4) 24 | 25 | (at-bar 1 26 | (closed-hhs) 27 | (sds) 28 | (kicks) 29 | ) 30 | 31 | ;;(stop) 32 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_02.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-02 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 404859)) 8 | (def kick (freesound2 171104)) 9 | 10 | ;; We want to use amps between 0 and 9 in our lists 11 | (amp-scale 1/9) 12 | 13 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 14 | ;; | | | | | | | | | | | | | | | | 15 | (defloop closed-hhs (8 1/4) closed-hh [8 2 4 7 - 2 4 5 8 - 7 3 - 6 3 8 9 2 6 4 - 8 4 8 9 3 5 7 - 4 8 - ]) 16 | 17 | (defloop sds (8 1/4) snare [- - - - 7 - - - - 5 - - 7 - - - - - - - 7 - - - - - - - 7 - - 5 ]) 18 | (defloop kicks (8 1/4) kick [6 - - 6 - - - 6 - - 7 - - - - - 6 - - - - - - 5 6 - 7 - - - 7 - ]) 19 | ;; | | | | | | | | | | | | | | | | 20 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 21 | 22 | (bpm 116) 23 | (beats-in-bar 4) 24 | 25 | (at-bar 1 26 | (closed-hhs) 27 | (sds) 28 | (kicks) 29 | ) 30 | 31 | ;;(stop) 32 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_03.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-03 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 270156)) 8 | (def kick (freesound2 171104)) 9 | 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 17 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 18 | (defloop closed-hhs 19 | (12 1/4) closed-hh [8 3 4 6 7 2 6 7 8 1 2 3 4 8 2 1 20 | 2 4 8 3 2 3 2 3 8 2 8 5 3 4 8 8 21 | 2 - 7 - 3 - 7 - - 2 - 7 - 2 - 7]) 22 | 23 | ;; BAR1 BAR2 BAR3 BAR4 24 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 25 | (defloop sds 26 | (4 1/2) snare [- - 6 - - - 6 - ]) 27 | (defloop kicks 28 | (4 1/2) kick [7 - - - 7 6 - 1 ]) 29 | 30 | ;; --------------------------------------------- 31 | 32 | (bpm 120) 33 | (beats-in-bar 4) 34 | 35 | (at-bar 1 36 | (closed-hhs ) 37 | (sds ) 38 | (kicks ) 39 | ) 40 | 41 | ;;(stop) 42 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_04.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-04 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 270156)) 8 | (def kick (freesound2 171104)) 9 | 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 17 | ;; 1 t t 2 t t 3 t t 4 t t 18 | (defloop closed-hhs 19 | (4 1/3) closed-hh [8 3 5 8 3 5 8 3 5 8 3 5 ]) 20 | (defloop sds 21 | (4 1/3) snare [- - - 6 - - - - - 6 - - ]) 22 | (defloop kicks 23 | (4 1/3) kick [7 - - - - - 6 - - - - - ]) 24 | 25 | ;; --------------------------------------------- 26 | 27 | (bpm 90) 28 | (beats-in-bar 4) 29 | 30 | (at-bar 1 31 | (closed-hhs ) 32 | (sds ) 33 | (kicks ) 34 | ) 35 | 36 | ;;(stop) 37 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_05.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-05 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 270156)) 8 | (def kick (freesound2 171104)) 9 | 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 17 | ;; 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 18 | (defloop closed-hhs 19 | (4 1/3) closed-hh [8 3 5 8 3 5 8 3 5 8 3 5 8 3 5 8 3 5 8 3 5 8 3 5 ]) 20 | (defloop sds 21 | (8 1/3) snare [- - - 6 - - - - - 6 - - - - 6 - - - - - - 6 - - ]) 22 | (defloop kicks 23 | (8 1/3) kick [7 - 6 - 7 - 7 - - - - 7 8 7 - - 5 6 - 7 8 - - - ]) 24 | 25 | ;; --------------------------------------------- 26 | 27 | (bpm 90) 28 | (beats-in-bar 4) 29 | 30 | (at-bar 1 31 | (closed-hhs ) 32 | (sds ) 33 | (kicks ) 34 | ) 35 | 36 | ;;(stop) 37 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_06.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-06 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 270156)) 8 | (def kick (freesound2 171104)) 9 | 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 17 | ;; 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 18 | (defloop closed-hhs 19 | (8 1/3) closed-hh [8 - 4 8 - 4 8 - 3 8 - 4 8 - 3 8 - 4 8 - 6 8 2 8 ]) 20 | (defloop sds 21 | (8 1/3) snare [- - - 6 - - - - - 6 - - - - 6 - - - - - - 6 - - ]) 22 | (defloop kicks 23 | (8 1/3) kick [7 - 6 - 7 - 7 - - - - 7 8 7 - - 5 6 - 7 8 - - - ]) 24 | 25 | ;; --------------------------------------------- 26 | 27 | (bpm 115) 28 | (beats-in-bar 4) 29 | 30 | (at-bar 1 31 | (closed-hhs ) 32 | (sds ) 33 | (kicks ) 34 | ) 35 | 36 | ;;(stop) 37 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_07.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-07 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 270156)) 8 | (def kick (freesound2 171104)) 9 | 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 17 | ;; 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 18 | (defloop closed-hhs 19 | (16 1/3) closed-hh [8 - 4 8 - 4 8 - 3 8 - 4 8 - 3 8 - 4 8 - 6 8 - 2 8 - 4 8 - 4 8 - 3 8 - 4 8 - 3 8 - 4 8 - 6 8 2 8 ]) 20 | (defloop sds 21 | (16 1/3) snare [- - - 6 - - - - - 6 - - - - - 6 - - - - - 6 - - - - - 6 - - - - - 6 - - - - 6 - - - - - - 6 - 5 ]) 22 | (defloop kicks 23 | (16 1/3) kick [7 - - - - 6 7 - 6 - - - - - 8 - - 7 - - - - - - - - 8 - - - 8 - - - - 6 8 - 6 - - 7 - - - - - - ]) 24 | 25 | ;; --------------------------------------------- 26 | 27 | (bpm 150) 28 | (beats-in-bar 4) 29 | 30 | (at-bar 1 31 | (closed-hhs ) 32 | (sds ) 33 | (kicks ) 34 | ) 35 | 36 | ;;(stop) 37 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_08.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-08 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 404859)) 8 | (def kick (freesound2 171104)) 9 | (def ride-bell (freesound2 171482)) 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 17 | ;; 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 1 t t 2 t t 3 t t 4 t t 18 | (defloop closed-hhs 19 | (16 1/3) closed-hh [8 - 4 8 - 4 8 - 3 8 - 4 8 - 3 8 - 4 8 - 6 8 - 2 8 - 4 8 - 4 8 - 3 8 - 4 8 - 3 8 - 4 8 - 6 8 2 8 ]) 20 | (defloop rides 21 | (4 1/3) ride-bell [4 - - 3 - - 4 - - 3 - 1 ]) 22 | (defloop sds 23 | (16 1/3) snare [- - - 6 - - - - - 6 - - - - - 6 - - - - - 6 - - - - - 6 - - - - - 6 - - - - 6 - - - - - - 6 - 5 ]) 24 | (defloop kicks 25 | (16 1/3) kick [7 - - - - 6 7 - 6 - - - - - 8 - - 7 - - - - - - - - 8 - - - 8 - - - - 6 8 - 6 - - 7 - - - - - - ]) 26 | 27 | ;; --------------------------------------------- 28 | 29 | (bpm 150) 30 | (beats-in-bar 4) 31 | 32 | (at-bar 1 33 | (closed-hhs) 34 | (sds) 35 | (kicks) 36 | (rides) 37 | ) 38 | 39 | ;;(stop) 40 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_09.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-09 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 404859)) 8 | (def kick (freesound2 171104)) 9 | (def ride-bell (freesound2 171482)) 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; Stop any currently playing music and clear any patterns 14 | (set-up) 15 | 16 | ;; BAR1 17 | ;; 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 18 | (defloop closed-hhs 1/6 19 | closed-hh [8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 20 | 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 4 3 _ 6 _ 8 _ 3 _ 6 _ 8 4 3 _ 6 _ 8 4 6 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ 8 _ 3 _ 6 _ ]) 21 | (defloop sds 1/6 22 | snare [_ _ _ _ _ _ 7 _ _ _ _ _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ _ _ _ _ 6 _ _ _ _ _ _ _ _ _ _ _ 6 _ 3 _ _ _ _ _ _ _ _ _ 6 _ _ _ 5 _ 23 | _ _ _ _ _ _ 7 _ _ _ _ _ _ _ _ 3 _ _ 7 _ _ _ _ _ _ _ _ _ _ _ 7 _ _ _ _ _ _ _ _ 3 _ _ 7 _ _ _ 5 _ _ _ _ 3 _ _ 7 _ _ _ _ _ _ _ _ _ _ _ 6 _ _ 4 _ _ _ _ _ _ _ 7 4 _ _ _ _ _ _ _ 3 _ _ _ 7 _ 4 _ 3 _ ]) 24 | 25 | (defloop kicks 1/6 26 | kick [8 _ _ _ _ _ _ _ _ _ _ _ 8 _ _ 4 6 _ _ _ _ 5 _ _ 8 _ _ _ _ _ _ _ _ _ 6 _ 8 _ _ 7 _ _ _ _ _ _ _ _ 8 _ _ _ 7 _ _ _ _ 4 5 _ 8 _ 7 8 _ _ _ _ _ _ _ _ 8 _ _ 5 6 _ _ _ _ _ 5 _ 7 _ _ _ _ _ _ _ _ _ _ _ 27 | 8 _ _ _ _ _ _ _ _ 6 8 _ _ _ _ _ 7 8 _ _ _ _ 6 _ 8 _ _ _ 7 _ _ _ _ _ 6 _ _ _ _ _ 7 _ _ _ _ 5 _ _ 8 _ _ _ 7 _ _ _ 7 _ _ _ 8 _ _ 7 _ 8 _ _ _ _ 8 _ 8 _ 7 _ _ _ _ 3 5 _ 8 _ _ _ _ 6 _ 8 _ _ _ _ _ _ ]) 28 | 29 | (defplayblock fade-out 30 | 0 (inst-volume! stereo-sample-player 0.8) 31 | 1 (inst-volume! stereo-sample-player 0.7) 32 | 2 (inst-volume! stereo-sample-player 0.6) 33 | 3 (inst-volume! stereo-sample-player 0.5) 34 | 4 (inst-volume! stereo-sample-player 0.4) 35 | 5 (inst-volume! stereo-sample-player 0.3) 36 | 6 (inst-volume! stereo-sample-player 0.1) 37 | 7 (inst-volume! stereo-sample-player 0) 38 | ) 39 | 40 | ;; --------------------------------------------- 41 | 42 | (bpm 98) 43 | (beats-in-bar 4) 44 | (inst-volume! stereo-sample-player 1) 45 | 46 | (at-bar 1 47 | (closed-hhs) 48 | (sds) 49 | (kicks)) 50 | 51 | (at-bar 9 52 | (fade-out)) 53 | 54 | ;;(stop) 55 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_10.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-10 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def open-hh (freesound2 404893)) 8 | (def pedal-hh (freesound2 93910)) 9 | (def snare (freesound2 404859)) 10 | (def kick (freesound2 171104)) 11 | (def ride-bell (freesound2 171482)) 12 | (def crash (freesound2 439789)) 13 | (def clap (freesound2 24787)) 14 | 15 | ;; Stop any currently playing music and clear any patterns 16 | (set-up) 17 | 18 | ;; BAR1 19 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 20 | ;; v v v v 21 | (defloop open-hhs 22 | 1/4 open-hh [_ _ 6 _ _ _ 6 _ _ _ 6 _ _ _ 6 _ ]) 23 | (defloop closed-hhs 24 | 1/4 closed-hh [_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ]) 25 | (defloop ped-hhs 26 | 1/4 pedal-hh [3 _ _ _ 3 _ _ _ 3 _ _ _ 3 _ _ _ ]) 27 | (defloop sds 28 | 1/4 snare [_ _ _ _ 8 _ _ _ _ _ _ _ 8 _ _ _ ]) 29 | (defloop kicks 30 | 1/4 kick [8 _ _ _ _ _ _ _ 7 _ 7 _ _ _ _ _ ]) 31 | 32 | (defplayblock fade-out 33 | 0 (inst-volume! stereo-sample-player 0.8) 34 | 1 (inst-volume! stereo-sample-player 0.7) 35 | 2 (inst-volume! stereo-sample-player 0.6) 36 | 3 (inst-volume! stereo-sample-player 0.5) 37 | 4 (inst-volume! stereo-sample-player 0.4) 38 | 5 (inst-volume! stereo-sample-player 0.3) 39 | 6 (inst-volume! stereo-sample-player 0.1) 40 | 7 (inst-volume! stereo-sample-player 0) 41 | 8 (stop) 42 | ) 43 | 44 | ;; --------------------------------------------- 45 | 46 | (bpm 100) 47 | (beats-in-bar 4) 48 | (inst-volume! stereo-sample-player 1) 49 | 50 | (at-bar 1 51 | (open-hhs) 52 | (ped-hhs) 53 | (sds) 54 | (kicks) 55 | ) 56 | 57 | (comment 58 | (fade-out (metro)) 59 | ) 60 | 61 | ;;(stop) 62 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_11.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-11 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def open-hh (freesound2 404893)) 8 | (def pedal-hh (freesound2 93910)) 9 | (def snare (freesound2 404859)) 10 | (def kick (freesound2 171104)) 11 | (def ride-bell (freesound2 171482)) 12 | (def crash (freesound2 439789)) 13 | (def clap (freesound2 24787)) 14 | 15 | ;; Stop any currently playing music and clear any patterns 16 | (set-up) 17 | 18 | ;; BAR1 19 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 20 | ;; v v v v 21 | (defloop open-hhs 22 | 1/4 open-hh [_ _ 6 _ _ _ 6 _ _ _ 6 _ _ _ 6 _ ]) 23 | (defloop ped-hhs 24 | 1/4 pedal-hh [3 _ _ _ 3 _ _ _ 3 _ _ _ 3 _ _ _ ]) 25 | 26 | (defloop sds 27 | 1/4 snare [_ _ _ _ 8 _ _ _ _ _ _ _ 8 _ _ _ _ _ _ _ 8 _ _ _ _ 5 _ _ 8 _ _ _ ]) 28 | (defloop kicks 29 | 1/4 kick [8 _ _ 8 _ _ 8 _ _ 6 8 _ _ _ _ 7 8 _ _ _ _ _ 5 7 _ _ 8 _ _ _ _ 8 ]) 30 | 31 | (defplayblock fade-out 32 | 0 (inst-volume! stereo-sample-player 0.8) 33 | 1 (inst-volume! stereo-sample-player 0.7) 34 | 2 (inst-volume! stereo-sample-player 0.6) 35 | 3 (inst-volume! stereo-sample-player 0.5) 36 | 4 (inst-volume! stereo-sample-player 0.4) 37 | 5 (inst-volume! stereo-sample-player 0.3) 38 | 6 (inst-volume! stereo-sample-player 0.1) 39 | 7 (inst-volume! stereo-sample-player 0) 40 | ) 41 | 42 | ;; --------------------------------------------- 43 | 44 | (bpm 100) 45 | (beats-in-bar 4) 46 | (inst-volume! stereo-sample-player 1) 47 | 48 | (at-bar 1 49 | (open-hhs) 50 | (ped-hhs) 51 | (sds) 52 | (kicks) 53 | ) 54 | 55 | (comment 56 | (fade-out (metro)) 57 | (stop) 58 | ) 59 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_12.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-12 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 404859)) 8 | (def kick (freesound2 171104)) 9 | 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 BAR2 BAR3 BAR4 17 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 18 | (defloop sds 19 | (4 1/2) snare [- - 8 - - - 8 - ]) 20 | (defloop kicks 21 | (16 1/2) kick [8 - - 8 - - - - - 8 - 8 - - - - 8 - - 8 8 - - 8 8 8 - 8 - - - 8 ]) 22 | 23 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 24 | (defloop closed-hhs 25 | (16 1/4) closed-hh [8 - 3 4 8 - 3 4 8 - 3 4 8 - 3 4 26 | 8 - 5 3 8 - 3 4 8 - 3 4 8 - 3 4 27 | 8 - 3 4 8 - 5 3 8 - 3 4 8 - 3 4 28 | 8 - 4 4 8 - 3 3 8 - 2 3 8 - 3 4 29 | ]) 30 | 31 | 32 | ;; --------------------------------------------- 33 | 34 | (bpm 100) 35 | (beats-in-bar 4) 36 | 37 | (at-bar 1 38 | (closed-hhs ) 39 | (sds ) 40 | (kicks ) 41 | ) 42 | 43 | ;;(stop) 44 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_12a.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-12a 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 404859)) 8 | (def kick (freesound2 171104)) 9 | 10 | (def crash (freesound2 439789)) 11 | (def clap (freesound2 24787)) 12 | 13 | ;; We want to use amps between 0 and 9 in our lists 14 | (amp-scale 1/9) 15 | 16 | ;; BAR1 BAR2 BAR3 BAR4 17 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 18 | (defloop sds 19 | (16 1/2) snare [- - 8 - - - 8 - - - 8 - - - 8 - - 3 8 - - - 8 - - - 8 - - 3 8 4 ]) 20 | (defloop kicks 21 | (16 1/2) kick [8 - - 8 - - - - - 8 - 8 - - - - 8 - - 8 5 - - 8 5 8 - 8 - - - 8 ]) 22 | 23 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 24 | (defloop closed-hhs 25 | (16 1/4) closed-hh [8 - 3 4 8 - 1 4 8 1 - 8 - 3 4 8 26 | - 1 4 8 1 - 8 - 3 4 8 - 1 4 8 1 27 | - 8 - 3 4 8 - 1 4 8 1 - 8 - 3 4 28 | 8 - 1 4 8 1 - 8 - 3 4 8 - 1 4 8 ]) 29 | 30 | ;; --------------------------------------------- 31 | 32 | (bpm 120) 33 | (beats-in-bar 4) 34 | 35 | (at-bar 1 36 | (closed-hhs ) 37 | (sds ) 38 | (kicks ) 39 | ) 40 | 41 | ;;(stop) 42 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_13.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-13 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def ride-bell (freesound2 171482)) ;; (ride-bell) 8 | (def ride (freesound2 162311)) 9 | (def snare (freesound2 404859)) 10 | (def kick (freesound2 171104)) 11 | 12 | ;; We want to use amps between 0 and 9 in our lists 13 | (amp-scale 1/9) 14 | 15 | ;; BAR1 BAR2 BAR3 BAR4 16 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 17 | (defloop sds 18 | (4 1/2) snare [- - 8 - - - 8 - ]) 19 | (defloop kicks 20 | (16 1/2) kick [8 - - 8 - - - - - 8 - 8 - - - - 8 - - 8 8 - - 8 8 8 - 8 - - - 8 ]) 21 | 22 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 23 | (defloop ride-bells 24 | (4 1/4) ride-bell [- - 5 - - - 5 - - - 5 - - - 5 - ]) 25 | 26 | (defloop rides 27 | (4 1/4) ride [4 5 - - 4 5 - - 5 4 - - 4 3 - - ]) 28 | 29 | ;; --------------------------------------------- 30 | 31 | (bpm 100) 32 | (beats-in-bar 4) 33 | 34 | (at-bar 1 35 | (ride-bells ) 36 | (rides) 37 | (sds ) 38 | (kicks ) 39 | ) 40 | 41 | ;;(stop) 42 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_13a.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-13a 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; We want to use amps between 0 and 9 in our lists 7 | (amp-scale 1/9) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR4 10 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 11 | (defloop sds 12 | (16 1/2) snare-hard [- - 5 - - - 5 - - - 5 - 2 4 - 6 - - 5 - - - 5 - - - 5 - - - 5 - ]) 13 | (defloop kicks 14 | (16 1/2) bass-hard [8 - - 8 - - - 5 - 8 - 8 - - - - 8 - - 8 8 - - 8 8 3 - 8 - - - 8 ]) 15 | 16 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 17 | (defloop ride-bells 18 | (4 1/4) ride-bell [- - 5 - - - 5 - - - 5 - - - 5 - ]) 19 | 20 | (defloop rides 21 | (4 1/4) ride [4 5 - - 4 5 - - 5 4 - - 4 3 - - ]) 22 | 23 | ;; --------------------------------------------- 24 | 25 | (bpm 100) 26 | (beats-in-bar 4) 27 | 28 | (at-bar 1 29 | (ride-bells) 30 | (rides) 31 | (sds) 32 | (kicks) 33 | ) 34 | 35 | ;;(stop) 36 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_13b.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-13b 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; We want to use amps between 0 and 9 in our lists 7 | (amp-scale 1/9) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR4 10 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 11 | (defloop sds 12 | (16 1/2) snare-hard [- - 5 - - - 5 - - - 5 - 2 4 - 6 - - 5 - - - 5 - - - 5 - - - 5 - ]) 13 | (defloop kicks 14 | (16 1/2) bass-hard [8 - - 8 - - - 5 - 8 - 8 - - - - 8 - - 8 8 - - 8 8 3 - 8 - - - 8 ]) 15 | 16 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 17 | (defloop ride-bells 18 | (4 1/4) ride-bell [- - 5 - - - 4 - - - 2 - - - 5 - ]) 19 | 20 | (defloop rides 21 | (4 1/4) ride [4 5 - - 4 5 - - - 4 - 3 4 3 - 3 ]) 22 | 23 | 24 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 25 | (defloop fill1 26 | (4 1/4) tom-mid-hard [- - - - - - - - 4 - 5 - - 5 - 8]) 27 | (defloop fill2 28 | (4 1/4) tom-lo-hard [- - - - - - - - - 1 - 3 - - 3 -]) 29 | 30 | 31 | ;; --------------------------------------------- 32 | 33 | (bpm 105) 34 | (beats-in-bar 4) 35 | 36 | (defn swing [b] 37 | (if (quarter-beat? b) (+ b 1/16) 38 | b)) 39 | 40 | (at-bar 1 41 | (ride-bells swing) 42 | (rides swing) 43 | (sds) 44 | (kicks) 45 | ) 46 | 47 | (comment 48 | (do 49 | (fill1 (on-next-bar) 1) 50 | (fill2 (on-next-bar) 1) 51 | ) 52 | ) 53 | 54 | ;;(stop) 55 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_14.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-14 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def open-hh (freesound2 404893)) 8 | (def snare (freesound2 404859)) 9 | (def kick (freesound2 171104)) 10 | 11 | ;; We want to use amps between 0 and 9 in our lists 12 | (amp-scale 1/9) 13 | 14 | ;; BAR1 BAR2 BAR3 BAR4 15 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 16 | (defloop open-hhs 17 | (16 1/2) open-hh [- - - - - 7 - - - - - - - 7 - - - 7 - - - 7 - - - 7 - - 7 - 7 - ]) 18 | (defloop closed-hhs 19 | (16 1/2) closed-hh [7 7 7 7 7 - 7 7 7 7 7 7 7 - 7 7 7 - 7 7 7 - 7 7 7 - 7 7 - 7 - 7 ]) 20 | 21 | (defloop sds 22 | (4 1/2) snare [- - 8 - - - 8 - ]) 23 | (defloop kicks 24 | (4 1/2) kick [8 - - - 8 - - - ]) 25 | 26 | ;; --------------------------------------------- 27 | 28 | (bpm 112) 29 | (beats-in-bar 4) 30 | 31 | (at-bar 1 32 | (sds) 33 | (kicks) 34 | (closed-hhs) 35 | (open-hhs (metro)) 36 | ) 37 | 38 | ;;(stop) 39 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_15.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-15 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def open-hh (freesound2 404893)) 8 | (def snare (freesound2 404859)) 9 | (def kick (freesound2 171104)) 10 | 11 | ;; We want to use amps between 0 and 9 in our lists 12 | (amp-scale 1/9) 13 | 14 | ;; BAR1 BAR2 BAR3 BAR4 15 | ;; 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & 16 | (defloop open-hhs 17 | (16 1/2) open-hh [- - - - - 7 - - - - - - - 7 - - - 7 - - - 7 - - - 7 - - 7 - 7 - ]) 18 | (defloop closed-hhs 19 | (16 1/2) closed-hh [7 7 7 7 7 - 7 7 7 7 7 7 - - - 7 - - - 7 7 - 7 7 7 - - 7 - 7 - 7 ]) 20 | 21 | (defloop sds 22 | (16 1/2) snare [- - 8 - - - 8 - - - 8 - - - 8 - - - 8 - - - 8 3 - - 8 - 6 - 8 - ]) 23 | (defloop kicks 24 | (16 1/2) kick [8 - - - 8 - - - 8 2 - - 8 - - - 8 - - - 8 2 - - 8 - - - - 4 - 4 ]) 25 | 26 | ;; --------------------------------------------- 27 | 28 | (bpm 130) 29 | (beats-in-bar 4) 30 | 31 | (at-bar 1 32 | (sds) 33 | (kicks) 34 | (closed-hhs) 35 | (open-hhs (metro)) 36 | ) 37 | 38 | ;;(stop) 39 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_16.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-16 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; We want to use amps between 0 and 9 in our lists 7 | (amp-scale 1/9) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR3 10 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 11 | (defloop open-hhs 12 | (16 1/4) cymbal-open [- - - - - - - 7 - - - - - - - - - - 7 - - - - - - - - - - 7 - - - - - 7 - - - - - - 7 - - - - - - - 7 - - - - 7 - - - - - - - - ]) 13 | (defloop closed-hhs 14 | (16 1/4) cymbal-closed [5 3 7 5 5 4 8 - 5 3 6 5 4 4 8 5 4 3 - - 4 5 6 5 4 4 8 6 4 - 8 6 5 3 8 - 5 4 8 4 6 4 - - 4 3 8 6 5 4 - - 5 7 8 - 6 5 8 7 4 4 6 5 ]) 15 | 16 | (defloop sds 17 | (16 1/4) snare-hard [- - - - 8 - - - - 6 - - 8 - - - - - - - 8 - - - - - - - 8 - - 6 - - - - 8 - - - - 6 - - 8 - - - - - - - 8 - - - - - - - 8 - - 6 ]) 18 | (defloop kicks 19 | (16 1/4) bass-hard [7 - - 7 - - - 7 - - 8 - - - - - 7 - - - - - - 7 8 - 8 - - - 7 - 7 - - 6 - - - 7 - - 7 - - - - - 7 - - - - - - 6 7 - 7 - - - 7 - ]) 20 | 21 | ;; --------------------------------------------- 22 | 23 | (bpm 86) 24 | (beats-in-bar 4) 25 | 26 | (at-bar 1 27 | (sds) 28 | (kicks) 29 | (closed-hhs) 30 | (open-hhs) 31 | ) 32 | 33 | ;;(stop) 34 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_16_swing.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-16-swing 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; We want to use amps between 0 and 9 in our lists 7 | (amp-scale 1/9) 8 | 9 | ;; BAR1 BAR2 BAR3 BAR3 10 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 11 | (defloop open-hhs 12 | (16 1/4) cymbal-pedal [- - - - - - - 3 - - - - - - - - - - 3 - - - - - - - - - - 3 - - - - - 3 - - - - - - 3 - - - - - - - 3 - - - - 3 - - - - - - - - ]) 13 | (defloop closed-hhs 14 | (16 1/4) cymbal-closed [5 3 7 5 5 4 8 - 5 3 6 5 4 4 8 5 4 3 - - 4 5 6 5 4 4 8 6 4 - 8 6 5 3 8 - 5 4 8 4 6 - - - 4 3 8 6 5 4 - - 5 7 8 - - - 8 7 4 4 6 5 ]) 15 | 16 | (defloop sds 17 | (16 1/4) snare-hard [- - - - 8 - - - - 6 - - 8 - - - - - - - 8 - - - - - - - 8 - - 6 - - - - 8 - - - - 6 - - 8 - - - - - - - 8 - - - - - - - 8 - - 6 ]) 18 | (defloop kicks 19 | (16 1/4) bass-hard [7 - - 7 - - - 7 - - 8 - - - - - 7 - - - - - - 7 8 - 8 - - - 7 - 7 - - 6 - - - 7 - - 7 - - - - - 7 - - - - - - 6 7 - 7 - - - 7 - ]) 20 | 21 | ;; --------------------------------------------- 22 | 23 | (bpm 86) 24 | (beats-in-bar 4) 25 | 26 | (defn swing [b] 27 | (if (quarter-beat? b) (+ b 1/12) 28 | b)) 29 | 30 | (at-bar 1 31 | (sds swing) 32 | (kicks swing) 33 | (closed-hhs swing) 34 | (open-hhs swing) 35 | ) 36 | 37 | ;;(stop) 38 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_17.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-17 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def open-hh (freesound2 404893)) 8 | (def snare (freesound2 404859)) 9 | (def kick (freesound2 171104)) 10 | 11 | (def ride (freesound2 162311)) ;; (ride) 12 | (def ride-bell (freesound2 171482)) ;; (ride-bell) 13 | 14 | ;; We want to use amps between 0 and 9 in our lists 15 | (amp-scale 1/9) 16 | 17 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 18 | (defloop ridebells (16 1/4) ride-bell [5 - - - 5 - - - - - - - - - - - 5 - - - 5 - - 3 6 5 - - 7 4 2 - 5 - - - 5 - - - - - - - - - - - - - 5 - - - 5 - - - 5 - - - 5 - ]) 19 | (defloop rides (16 1/4) ride [- - 4 - - - 5 - - - 4 - - - 3 - - - 4 - - - 3 - - - 4 - - - 7 6 - - 4 - - - 3 - 7 3 4 - 6 3 4 - 4 5 - - 4 5 - - 4 5 - - 4 5 - - ]) 20 | 21 | (defloop sds (16 1/4) snare [- - - - 7 - - - - 5 - - 7 - - - - 5 - - 7 - 6 - - - - - 7 - - - - - - - 7 - - 5 - - - - 7 - - - - - - - 7 - - - - 5 - - 7 - - - ]) 22 | (defloop kicks (16 1/4) kick [6 - - 6 - - - 6 - - 7 - - - - - 7 - 6 7 - - - 7 6 - - - - - - 5 6 - 7 - - - 7 - - - 7 - - 7 - - 8 - 7 - - 7 - 7 8 - 7 8 - 7 - 6 ]) 23 | ;; | | | | | | | | | | | | | | | | 24 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 25 | 26 | (bpm 120) 27 | (beats-in-bar 4) 28 | 29 | (at-bar 1 30 | (ridebells) 31 | (rides) 32 | ) 33 | 34 | (at-bar 5 35 | (sds) 36 | (kicks) 37 | ) 38 | 39 | ;;(stop) 40 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_18.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-18 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def open-hh (freesound2 404893)) 8 | (def snare (freesound2 404859)) 9 | (def kick (freesound2 171104)) 10 | 11 | (def ride (freesound2 162311)) ;; (ride) 12 | (def ride-bell (freesound2 171482)) ;; (ride-bell) 13 | 14 | ;; We want to use amps between 0 and 9 in our lists 15 | (amp-scale 1/9) 16 | 17 | ;; 12 / 8 beats 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 18 | (defloop ridebells (16 1/6) open-hh [7 - - - - - 7 - - - - - 7 - - - - - - - 7 - - - 7 - - - - - 6 - - - - - 7 - - - - - - - 4 - 6 - - - - - - - - - - - - - - - 3 - 5 - 7 - - - - - 7 - - - 5 - - - - - 5 - - - - - - 7 - - - - - - ]) 19 | (defloop rides (16 1/6) closed-hh [- - 3 - 5 - - - 4 - 5 - - - 1 4 5 - - 5 - - 4 6 - - 4 - 5 - - - 4 - 6 - - 2 3 - 5 - 7 - - - - - 8 - 3 - 5 - 8 - 4 - 5 - 8 - - - - - - - - - - - - - 4 - - - 8 - 4 - - - 8 5 4 - 5 - 8 - 4 - 5 - ]) 20 | 21 | (defloop sds (16 1/6) snare [- - - - - - 8 - - - - - - - - - - - 8 - - - 6 - - - - - - - 8 - - - - - - - - 3 - - 8 - - - - - - - - - - - 8 - - 3 - - - - - - - - 8 - - - 6 - - - - - - - 8 - - - - - - - - 3 - - 8 - - - - - ]) 22 | (defloop kicks (16 1/6) kick [7 - - - 7 - - - - - 5 - 8 - - - - - - - - - 2 3 8 - - - 4 - - - - - 7 - 8 - - - - - - - - - 6 - 7 - - 5 7 - - - - - 5 - 8 - - - - - - - - - - - 8 - - - - - - - - 5 7 - - - - - 7 8 - - - - 6 - ]) 23 | ;; 12 / 8 beats 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 1 . t . t . 2 . t . t . 3 . t . t . 4 . t . t . 24 | 25 | (bpm 98 ) 26 | (beats-in-bar 4) 27 | 28 | (at-bar 1 29 | (ridebells) 30 | (rides) 31 | (sds) 32 | (kicks) 33 | ) 34 | 35 | ;;(stop) 36 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_21.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-21 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def closed-hh (freesound2 404890)) 7 | (def snare (freesound2 404859)) 8 | (def kick (freesound2 171104)) 9 | 10 | ;; We want to use amps between 0 and 9 in our lists 11 | (amp-scale 1/9) 12 | 13 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 14 | ;; | | | | | | | | | | | | | | | | 15 | (defloop closed-hhs (4 1/4) closed-hh [7 - 5 - 7 - 4 - 8 - 5 - 8 - 6 - ]) 16 | ;; . . . . . . . . . . . . 17 | (defloop sds (16 1/4) snare [- 2 - - 7 1 - - - 5 - - 7 1 - 1 - 1 - - 7 1 - - - - - - 7 - - 5 - 5 - - 7 1 6 1 - - - - 7 1 - - - - - - 7 1 - 1 - 5 - - 7 1 - - ]) 18 | (defloop kicks (16 1/4) kick [6 - - 6 - - - 6 - - 7 - - - - - 6 - - - - - - 5 6 - 7 - - - 7 - 7 - 6 7 - - - 7 - - 7 - - 7 - - 8 - 7 - - 7 - 7 8 - 7 8 - 7 - 6 ]) 19 | ;; | | | | | | | | | | | | | | | | 20 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 21 | 22 | (bpm 116) 23 | (beats-in-bar 4) 24 | 25 | (at-bar 1 26 | (closed-hhs) 27 | (sds) 28 | (kicks) 29 | ) 30 | 31 | ;;(stop) 32 | -------------------------------------------------------------------------------- /src/overtone_loops/dph_book/pattern_04_21a.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.dph-book.pattern-04-21a 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; We want to use amps between 0 and 9 in our lists 7 | (amp-scale 1/9) 8 | 9 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 10 | ;; | | | | | | | | | | | | | | | | 11 | (defloop closed-hhs (4 1/4) cymbal-closed [7 - 5 - 7 - 4 - 8 - 5 - 8 - 6 - ]) 12 | (defloop ride-bells (16 1/4) ride-bell [- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - 3 6 4 - - - - - - - - - 3 - 4 - 6 - 8 ]) 13 | (defloop sds (16 1/4) snare-soft [- 2 - - 7 1 - - - 5 - - 7 1 - 1 - 1 - - 7 1 - - - - - - 7 - - 5 - 5 - - 7 1 6 1 - - - - 7 1 - - - - - - 7 1 - 1 - 5 - - 7 1 - - ]) 14 | (defloop kicks (16 1/4) bass-soft [6 - - 6 - - - 6 - - 7 - - - - - 6 - - - - - - 5 6 - 7 - - - 7 - 7 - 6 7 - - - 7 - - - - 3 7 - - - - 7 - 3 7 - - - 7 - 8 - 6 - 5 ]) 15 | ;; | | | | | | | | | | | | | | | | 16 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 1 e & a 2 e & a 3 e & a 4 e & a 17 | 18 | (bpm 116) 19 | (beats-in-bar 4) 20 | 21 | (at-bar 1 22 | (closed-hhs) 23 | (ride-bells) 24 | (sds) 25 | (kicks) 26 | ) 27 | 28 | ;;(stop) 29 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/alternate.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.alternate 2 | "Simple example heartbeat pattern" 3 | (:use [overtone.live] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | (set-up) 8 | (bpm 120) 9 | (beats-in-bar 4) 10 | 11 | ;; Our patterns A and B - both 4 beats to the bar 12 | (def pat-a [5 _ 5 _ 5 _ 5 _]) 13 | (def pat-b [5 _ _ 5 _ 4 _ 5]) 14 | 15 | ;; Our loop 16 | (defloop beats 1/2 kick pat-a) 17 | 18 | ;; Schedule first few bars 19 | (at-bar 1 20 | (beats)) 21 | 22 | (at-bar 3 23 | (beats pat-b)) 24 | 25 | (at-bar 5 26 | (beats pat-a)) 27 | 28 | ;; 29 | (comment 30 | ;; Control the switch live with Ctrl-x Ctrl-e in Emacs 31 | (beats (metro) pat-a) 32 | (beats (metro) pat-b) 33 | ) 34 | 35 | ;;(stop) 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/compound.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.compound 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples]) 5 | (:require [clojure.pprint :refer [pp pprint]])) 6 | 7 | ;; Model compound time 12/8 with bass playing every beat 8 | ;; and snares playing off-beats 9 | 10 | ;; Stop any currently playing music and clear any patterns 11 | (set-up) 12 | 13 | ;; Define players with start patterns 1 . . 2 . . 3 . . 4 . . 14 | (def ticks (loop-player 1 bass-soft [6 _ _ 6 _ _ 6 _ _ 6 _ _ ])) 15 | (def snares (loop-player 1 snare-soft [3 _ 3 _ 3 _ 3 _ 3 _ 3 2 ])) 16 | 17 | ;; --------------------------------------------- 18 | 19 | (bpm 300) 20 | (beats-in-bar 12) 21 | 22 | ;; Calling a player starts it, passing a new pattern (list) 23 | ;; changes the pattern 24 | 25 | ;; Start playing each loop 26 | (at-bar 1 27 | (ticks)) 28 | 29 | (at-bar 3 30 | (snares)) 31 | 32 | (at-bar 8 33 | (snares [3 1 3 1 3 1 3 _ 3 _ 3 1 ])) 34 | 35 | (at-bar 9 36 | (snares [3 1 3 1 3 1 3 _ 3 1 3 1 ])) 37 | 38 | (at-bar 10 39 | (snares [3 1 3 1 3 1 3 _ 3 _ 3 1 ])) 40 | 41 | (at-bar 11 42 | (snares [3 _ _ _ _ _ _ _ _ _ _ 3 ])) 43 | 44 | (at-bar 12 45 | (snares [3 _ _ _ _ _ _ _ _ _ _ _ ])) 46 | 47 | (at-bar 13 48 | (snares :first)) 49 | 50 | 51 | ;;(stop) 52 | 53 | (comment 54 | (cymbal-closed) 55 | (silence (metro) ticks snares) 56 | ) 57 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/cowbell1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.cowbell1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) 7 | 8 | ;; 1 & 2 & 3 & 4 & 9 | (def hats 10 | (loop-player 1/2 hat [_ 5 _ 5 _ 5 _ 5 ])) 11 | 12 | (def kicks 13 | (loop-player 1/2 kick [7 _ 2 _ 7 _ 2 _ 7 _ 2 _ 7 _ 2 _ 7 _ 2 _ 7 6 2 _ 7 _ 2 _ 7 6 2 _ ])) 14 | 15 | (def claps 16 | (loop-player 1/2 clap [_ _ _ _ 3 _ _ _ _ _ _ _ 3 _ _ _ _ _ _ _ 4 _ _ _ _ _ _ _ _ 4 _ 6 ])) 17 | 18 | ;; Thirds 1 and 2 and 3 and 4 and 19 | (def bells 20 | (loop-player 1/3 cowbell [4 _ _ 4 _ _ 4 _ _ 4 6 4 21 | 4 _ _ _ _ 4 _ 6 _ _ 5 7 22 | 4 _ _ _ _ 4 _ 6 _ _ 5 7 23 | 4 _ _ _ _ 4 _ 6 _ _ 5 7 ])) 24 | 25 | ;; --------------------------------------------- 26 | 27 | (bpm 110) 28 | (beats-in-bar 4) 29 | 30 | (at-bar 1 31 | (hats ) 32 | (kicks ) 33 | (claps ) 34 | ) 35 | 36 | (at-bar 5 37 | (bells) 38 | ) 39 | 40 | ;;(stop) 41 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/heart_beat.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.heart-beat 2 | "Simple example heartbeat pattern" 3 | (:use [overtone.live] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | (set-up) 8 | (bpm 240) 9 | (beats-in-bar 4) 10 | 11 | ;; Our loops - both 4 beats to the bar 12 | (def heart 13 | (loop-player 1 kick [ _ 8 6 _ ])) 14 | 15 | (def ticks 16 | (loop-player 1/2 hat [ 4 _ 3 _ 4 _ 4 _ ])) 17 | 18 | ;; Schedule 19 | (at-bar 1 20 | (heart) 21 | (ticks)) 22 | 23 | ;; 24 | 25 | ;;(stop) 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/heart_beat2.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.heart-beat2 2 | "Heart beat pattern" 3 | (:use [overtone.live] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | 8 | (set-up) 9 | 10 | (def heart ;; 1 2 3 4 11 | (loop-player 1/4 kick [8 _ _ _ 8 _ _ _ _ _ 3 5 6 _ _ _])) 12 | 13 | (def ticks ;; 1 2 3 4 14 | (loop-player 1/9 hat [8 _ _ _ _ _ _ _ _ 8 _ _ _ 4 _ _ 3 _ 8 _ _ _ _ _ _ _ _ 8 _ _ _ _ 5 _ _ _ ])) 15 | 16 | (bpm 200) 17 | (heart (metro)) 18 | (ticks (metro)) 19 | 20 | ;;(stop) 21 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/kick_kick_snare.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.kick-kick-snare 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | (set-up) 6 | 7 | ;; Define some samples from Freesound.org 8 | (def kick (freesound2 250547)) 9 | (def snare (freesound2 270156)) 10 | (def hat (freesound2 96140)) 11 | 12 | (bpm 140) 13 | (beats-in-bar 4) 14 | 15 | ;; 1 & 2 & 3 & 4 & 16 | (defloop kicks 1/2 kick [8 _ 7 _ _ _ _ _]) 17 | (defloop snares 1/2 snare [_ _ _ _ 8 _ _ _]) 18 | (defloop hats 1/2 hat [_ 5 _ 5 _ 5 _ 5]) 19 | 20 | (kicks (metro)) 21 | (snares (metro)) 22 | (hats (metro)) 23 | 24 | ;;(stop) 25 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/old_style_loop.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.old-style-loop 2 | "Using regular Overtone `at` notation to make loops" 3 | (:use [overtone.live])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def kick (freesound 250547)) 7 | (def snare (freesound 270156)) 8 | (def hat (freesound 96140)) 9 | 10 | ;; 11 | (def metro (metronome 128)) 12 | 13 | ;; 14 | (defn player [beat] 15 | (at (metro beat) (kick)) 16 | (at (metro (+ 0.5 beat)) (hat)) 17 | 18 | (at (metro (+ 1 beat)) (kick)) 19 | (at (metro (+ 1.5 beat)) (hat)) 20 | 21 | (at (metro (+ 2 beat)) (snare)) 22 | (at (metro (+ 2.5 beat)) (hat)) 23 | 24 | (at (metro (+ 3.5 beat)) (hat)) 25 | 26 | (apply-by (metro (+ 4 beat)) #'player (+ 4 beat) [])) 27 | 28 | (metro-bpm metro 120) 29 | (player (metro)) 30 | 31 | ;; 32 | ;(stop) 33 | 34 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/readme.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.readme 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) ;; clear any previous patterns 7 | 8 | ;; beat 1 2 3 4 5 6 7 8 9 | (def hats 10 | (loop-player 1 cymbal-closed [_ 5 _ 5 _ 5 _ 5])) 11 | (def kicks 12 | (loop-player 1 bass-hard [7 _ 2 _ 7 6 2 _])) 13 | (def claps 14 | (loop-player 1 clap [_ _ 4 _])) 15 | 16 | (beats-in-bar 4) 17 | (bpm 220) 18 | 19 | (at-bar 1 (hats) (kicks)) 20 | (at-bar 3 (claps)) 21 | 22 | (at-bar 5 23 | (hats [9 3 9 3 9 5 6 7]) 24 | (kicks [_ _ 2 _ _ 2 _ _])) 25 | 26 | ;; return to previous patterns 27 | (at-bar 7 28 | (hats :pop) 29 | (kicks :pop)) 30 | 31 | ;; (stop) 32 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/timing1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.timing 2 | "Timing tests" 3 | (:use [overtone.live] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | (set-up) 8 | (bpm 90) 9 | (beats-in-bar 4) 10 | 11 | (defloop hats 1 cymbal-pedal [6 6 6 6]) 12 | (defloop kicks 1 bass-hard [7 7 7 7]) 13 | 14 | (defloop double-kicks 1/3 bass-soft [7 7 _ 15 | 7 7 _ 16 | 7 7 _ 17 | 7 7 _]) 18 | (at-bar 1 19 | (hats)) 20 | 21 | (at-bar 2 22 | (kicks)) 23 | 24 | (at-bar 4 25 | (silence kicks) 26 | (double-kicks)) 27 | 28 | (at-bar 6 29 | (silence double-kicks) 30 | (kicks :first)) 31 | 32 | (at-bar 8 33 | (silence kicks hats)) 34 | 35 | ;; bar 9 36 | ;; end 37 | 38 | ;;(stop) 39 | -------------------------------------------------------------------------------- /src/overtone_loops/examples/timing2.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.timing2 2 | "Timing tests" 3 | (:use [overtone.live] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | (set-up) 8 | 9 | (defloop hats 1 cymbal-closed [7 5 5]) 10 | (defloop kicks 1 bass-soft [7 5 5]) 11 | 12 | (defloop double-kicks 1/3 bass-soft [7 7 _ 13 | 7 7 _ 14 | 7 7 _]) 15 | 16 | (bpm 90) 17 | (beats-in-bar 3) 18 | 19 | (at-bar 1 20 | (hats)) 21 | 22 | (at-bar 2 23 | (kicks)) 24 | 25 | (at-bar 4 26 | (silence kicks) 27 | (double-kicks)) 28 | 29 | (at-bar 6 30 | (kicks :first) 31 | (silence double-kicks)) 32 | 33 | (at-bar 9 34 | (silence kicks hats)) 35 | 36 | ;;(stop) 37 | -------------------------------------------------------------------------------- /src/overtone_loops/freesound_samples.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.freesound-samples 2 | (:use [overtone-loops.loops])) 3 | 4 | ;; Define some samples from Freesound.org 5 | 6 | (def bell (freesound2 382806)) ;; (bell) 7 | (def clap (freesound2 24787)) ;; (clap) 8 | (def crash (freesound2 439789)) ;; (crash) 9 | 10 | (def hatopen (freesound2 404893)) ;; (hatopen) 11 | (def hatc (freesound2 404891)) ;; closed ;; (hatc) 12 | (def hatc2 (freesound2 404890)) ;; closed ;; (hatc2) 13 | (def hatc3 (freesound2 96140)) ;; (hat3) 14 | (def hatp (freesound2 93910)) ;; pedal ;; (hatp) 15 | 16 | (def kick (freesound2 171104)) ;; (kick) 17 | (def kickelec (freesound2 250547)) ;; (kickelec) 18 | (def kicksoft (freesound2 56430)) ;; (kicksoft) 19 | 20 | (def open-hh (freesound2 404893)) ;; (open-hh) 21 | (def openhat (freesound2 317094)) ;; (openhat) 22 | (def pedal-hh (freesound2 93910)) ;; (pedal-hh) 23 | 24 | (def ride (freesound2 162311)) ;; (ride) 25 | (def ride-bell (freesound2 171482)) ;; (ride-bell) 26 | (def rim (freesound2 34831)) ;; (rim) 27 | 28 | (def snare (freesound2 151689)) ;; (snare) 29 | (def snare2 (freesound2 404859)) ;; (snare2) 30 | 31 | ;; Snaps etc 32 | (def finger (freesound2 177495)) ;; (finger) 33 | (def stick (freesound2 82280)) ;; (stick) 34 | -------------------------------------------------------------------------------- /src/overtone_loops/loops.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.loops 2 | "Simpler music loop syntax for Overtone, the programmable 3 | music toolkit." 4 | (:use [overtone.live]) 5 | (:require [overtone-loops.utils :refer :all] 6 | [clojure.pprint :refer [pp pprint]])) 7 | 8 | (def metro (metronome 128)) 9 | (def the-amp-scale (atom 1/9)) 10 | (def the-beats-in-bar (atom 4)) 11 | (def loop-fn-counter (atom 0)) 12 | (def loop-patterns (atom (hash-map))) 13 | 14 | ;; Make patterns easier to read 15 | (def _ 0) 16 | 17 | (defn bpm [b] 18 | (metro-bpm metro b)) 19 | 20 | (defn half-beat? [b] 21 | (and (ratio? b) 22 | (= (denominator b) 2))) 23 | 24 | (defn quarter-beat? [b] 25 | (and (ratio? b) 26 | (= (denominator b) 4))) 27 | 28 | (defn amp-scale [a] 29 | (reset! the-amp-scale a)) 30 | 31 | (defn scale-amps [a] 32 | "If a is just a number, scale it, otherwise preserve it." 33 | (if (number? a) 34 | (* a @the-amp-scale) 35 | a)) 36 | 37 | (defn beats-in-bar [b] 38 | (reset! the-beats-in-bar b)) 39 | 40 | ;; - 41 | 42 | (defn on-next-bar 43 | "Metro marker for the next bar, or n bars ahead" 44 | ([] (on-next-bar 1)) 45 | ([bars] 46 | (* 47 | (+ bars 48 | (quot (metro) @the-beats-in-bar)) 49 | @the-beats-in-bar))) 50 | 51 | (defn schedule-ahead 52 | "Schedule loop playback generation a bit early to avoid playback glitches. 53 | Generation is early but beats are always ontime thanks to `apply-by` and `at`" 54 | [beat] 55 | (- beat 1/16)) 56 | 57 | (defn schedule-ahead-pattern 58 | "Schedule loop pattern changes a bit before loop playback generation" 59 | [beat] 60 | (schedule-ahead (- beat 1/16))) 61 | 62 | (defn play-phrase 63 | "Play this phrase expressed as a list of amplitudes or data to 64 | pass to instrument. 65 | 66 | Examples: 67 | (play-phrase (metro) 1 kick [6 1 5 6]) 68 | (play-phrase (metro) 1/2 kick [6 _ 5 _ _ 4 6]) 69 | " 70 | [beat beat-fraction instrument params-list] 71 | (doall (map-indexed 72 | (fn [in-beats amp] 73 | (when-not (and (number? amp) (zero? amp)) 74 | (at (metro (+ beat (* in-beats beat-fraction))) 75 | (instrument (scale-amps amp))))) 76 | params-list)) 77 | nil) 78 | 79 | (defn play-pairs 80 | "Play this bar on beat, given a list of pairs (offset playable) 81 | 82 | (play-pairs (metro) [[0 kick] [1 kick] [2 snare]]) 83 | (play-pairs (metro) [[0.5 hat] [1.5 hat]]) 84 | " 85 | [beat beat-playable-pairs] 86 | (doall (map (fn [[in-beats playable]] 87 | (at (metro (+ beat in-beats)) 88 | (playable))) 89 | beat-playable-pairs))) 90 | 91 | (defn play-block 92 | "Play this combination of beats and playables. Easier to use than 93 | play-schedule-pairs, which does the work. 94 | 95 | (play-schedule (metro) 0 kick 1 kick 1 snare 2 kick 3 kick 3 snare) 96 | " 97 | [beat & beats-and-playables] 98 | (play-pairs beat (pairer beats-and-playables))) 99 | 100 | 101 | ;; ---------------------------------------------------------------- 102 | 103 | (defn set-up [] 104 | (stop) 105 | (reset! loop-patterns (hash-map)) 106 | (reset! loop-fn-counter 0)) 107 | 108 | (defn loop-player 109 | "Return a function to play this loop pattern. E.g. 110 | 111 | (def a (loop-player 4 snare [4 6 7 3])) 112 | 113 | Then: 114 | (a (metro)) 115 | " 116 | [fraction instrument start-pattern] 117 | 118 | (let [loop-fn-id (swap! loop-fn-counter inc)] 119 | 120 | ;; Each function ID maps to a pattern 121 | (swap! loop-patterns 122 | assoc loop-fn-id [start-pattern]) 123 | 124 | ;; Play this loop pattern on beat, or if specified change 125 | ;; this pattern on beat 126 | (with-meta 127 | (fn player 128 | [beat & rest] 129 | (let [new-pattern (when (some? rest) (first rest))] 130 | (if (some? new-pattern) 131 | ;; Just before beat, and just before next loop iteration, change the pattern 132 | (apply-by (metro (schedule-ahead-pattern beat)) 133 | (fn [] 134 | (condp = new-pattern 135 | ;; Drop the most recent pattern 136 | :pop (swap! loop-patterns 137 | update-in [loop-fn-id] pop) 138 | ;; Back to the first pattern 139 | :first (swap! loop-patterns 140 | update-in [loop-fn-id] #(vector (first %))) 141 | ;; Put this new pattern at the head of the pattern list 142 | (swap! loop-patterns 143 | update-in [loop-fn-id] conj new-pattern)))) 144 | (do 145 | ;; On beat get the pattern and play it 146 | (apply-by (metro (schedule-ahead beat)) 147 | (fn [] 148 | (let [pattern (last (get @loop-patterns loop-fn-id)) 149 | beats-in-phrase (* (count pattern) fraction)] 150 | (when (seq pattern) 151 | (play-phrase beat fraction instrument pattern)) 152 | ;; Schedule the next loop and handle special case 153 | ;; of empty pattern 154 | (player 155 | (if (empty? pattern) 156 | (+ @the-beats-in-bar beat) 157 | (+ beats-in-phrase beat)))))) 158 | )))) 159 | {:doc (str "Player " loop-fn-id " for instrument " (:doc (meta instrument)) " with fraction " fraction)}) 160 | )) 161 | 162 | (defn silence 163 | "Send each loop player an empty list to silence it" 164 | [beat & fns] 165 | (doall (map #(% beat []) fns))) 166 | 167 | ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 168 | 169 | (defmacro defloop 170 | "Define a loop from a list of amplitudes." 171 | [name fraction instrument amps-list] 172 | `(def ~name 173 | (loop-player ~fraction ~instrument ~amps-list))) 174 | 175 | (defmacro defplayblock 176 | "Define a ready to play block beats and playables. Using a macro ensures 177 | the playables don't play immediately. 178 | 179 | (defschedule part1 180 | 0 (piano :c3) 181 | 2 (piano :e3) 182 | 3 (piano :g3)) 183 | 184 | ;; Then to play: 185 | (part1 (metro)) 186 | 187 | ;; Or 188 | (at-bar 1 (part1)) 189 | " 190 | [name & beats-and-sexps] 191 | (defn- make-thunk [s-exp] 192 | `(thunk ~s-exp)) 193 | (let [thunked-pairs (map-evens make-thunk beats-and-sexps) 194 | beat-sym (gensym "beat")] 195 | `(defn ~name 196 | [~beat-sym] 197 | (play-block ~beat-sym ~@thunked-pairs)))) 198 | 199 | ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 200 | 201 | (defmacro at-bar 202 | "Schedule a list of loops to start on this bar by inserting the 203 | correct metro marker as the first argument to each loop function. 204 | 205 | E.g. 206 | (at-bar 11 207 | (snares 2) 208 | (kicks 2)) 209 | Results in: 210 | (snares (on-next-bar 11) 2) 211 | (kicks (on-next-bar 11) 2) 212 | " 213 | [bar & loop-fns] 214 | (let [metro-marker (on-next-bar bar)] 215 | (defn- insert-metro [loop-s-exp] 216 | (let [fn (first loop-s-exp) 217 | rest (rest loop-s-exp)] 218 | `(~fn ~metro-marker ~@rest))) 219 | (let [timed-loop-fns (map insert-metro loop-fns)] 220 | `(do ~@timed-loop-fns)))) 221 | 222 | ;; --------------------------------------------------------------- 223 | ;; Click-free sample players 224 | 225 | (definst mono-sample-player 226 | "Play a mono sample" 227 | [buf-id 0 duration 1 amp 1 rate 1 release 0.01] 228 | (let [dur (/ duration rate) 229 | env (env-gen (lin 0.01 230 | (- dur release 0.01) 231 | release) 232 | :action FREE) 233 | rate2 (* (buf-rate-scale buf-id) rate) 234 | snd (play-buf 1 buf-id rate2)] 235 | (* amp env snd))) 236 | 237 | (definst stereo-sample-player 238 | "Play a stereo sample, a separate synth because of 239 | limitations of passing ints through to play-buf" 240 | [buf-id 0 duration 1 amp 1 rate 1 release 0.01] 241 | (let [dur (/ duration rate) 242 | env (env-gen (lin 0.01 243 | (- dur release 0.01) 244 | release) 245 | :action FREE) 246 | rate2 (* (buf-rate-scale buf-id) rate) 247 | snd (play-buf 2 buf-id rate2)] 248 | (* amp env snd))) 249 | 250 | (defn freesound2 251 | "Load and return a player for this freesound sample 252 | which takes arguments: amp rate release. 253 | 254 | A simpler form of the overtone freesound function, without 255 | clicks and loops." 256 | [id] 257 | (let [sample-buf (load-sample (freesound-path id)) 258 | buf-id (:id sample-buf) 259 | dur (:duration sample-buf) 260 | channels (:n-channels sample-buf)] 261 | (fn [ & args ] 262 | (cond 263 | (= 1 channels) (apply mono-sample-player buf-id dur args) 264 | (= 2 channels) (apply stereo-sample-player buf-id dur args))))) 265 | 266 | ;; (def f (freesound2 213904)) 267 | ;; (f) 268 | ;; (f :amp 0.5) 269 | ;; (f :rate 2) 270 | 271 | (defn sample2 272 | "Load and return a player for the sample in a local file. 273 | Plays click free." 274 | [path] 275 | (let [sample-buf (load-sample path) 276 | buf-id (:id sample-buf) 277 | dur (:duration sample-buf) 278 | channels (:n-channels sample-buf)] 279 | (with-meta 280 | (fn [ & args ] 281 | (cond 282 | (= 1 channels) (apply mono-sample-player buf-id dur args) 283 | (= 2 channels) (apply stereo-sample-player buf-id dur args))) 284 | {:doc (str "Sample player for " path)}))) 285 | 286 | ;;(stop) 287 | -------------------------------------------------------------------------------- /src/overtone_loops/music/alter1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.alter1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) 7 | 8 | ;; 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 | (def hats 10 | (loop-player 1/2 cymbal-closed [_ 5 _ 5 _ 5 _ 5 _ _ _ _ 5 9 5 9 ])) 11 | (def crashes 12 | (loop-player 1/2 cymbal-open [_ _ _ _ 4 _ _ _ _ _ _ _ _ _ _ _ ])) 13 | (def claps 14 | (loop-player 1 clap [_ 6 _ 8 _ 6 _ 8 ])) 15 | (def kicks 16 | (loop-player 1/2 bass-soft [7 _ _ _ 2 _ _ _ 7 _ _ _ 2 _ _ _ ])) 17 | 18 | (def exkicks [7 _ _ _ 2 _ _ _ 7 4 _ 4 2 _ _ _ ]) 19 | 20 | (def extra-snares ;; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 21 | (loop-player 1/10 snare [_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 8 _ _ _ _ 5 _ _ _ _ 2 _ _ _ _ ;; 0-3 22 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 8 _ _ _ _ 5 _ _ _ _ 2 _ _ _ _ ;; 4-7 23 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ;; 8-11 24 | _ _ _ _ _ _ 4 5 6 _ 8 _ _ 4 4 _ _ _ _ _ 7 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ])) ;; 12-15 25 | 26 | ;; --------------------------------------------- 27 | 28 | (bpm 130) 29 | (beats-in-bar 4) 30 | 31 | (at-bar 1 32 | (hats ) 33 | (claps ) 34 | (kicks ) 35 | (crashes ) 36 | ) 37 | 38 | (at-bar 3 39 | (kicks exkicks)) 40 | 41 | (at-bar 7 42 | (kicks :pop)) 43 | 44 | (comment ; all play for only a few phrases 45 | ;; Play these with Ctrl-X Ctrl-E 46 | (kicks (on-next-bar) exkicks) 47 | (extra-snares (on-next-bar)) 48 | ) 49 | 50 | ;;(stop) 51 | -------------------------------------------------------------------------------- /src/overtone_loops/music/amen1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.amen1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) 7 | 8 | (def hats1 9 | (loop-player 1 cymbal-closed [2 2 2 2])) 10 | 11 | (def hats2 12 | (loop-player 1 cymbal-open [3 3 3 3])) 13 | 14 | (def kicks1 15 | (loop-player 1/2 bass-soft [7 _ 7 _ _ _ _ _ _ _ 3 4 _ _ _ _])) 16 | 17 | (def snares1 18 | (loop-player 1/2 snare [_ _ _ _ 7 _ _ 3 _ 3 _ _ 3 _ _ 7])) 19 | 20 | ;; --------------------------------------------- 21 | 22 | (bpm 220) 23 | (beats-in-bar 8) 24 | 25 | (at-bar 1 26 | (hats1 ) 27 | (kicks1 ) 28 | (snares1 ) 29 | ) 30 | 31 | ;;(stop) 32 | -------------------------------------------------------------------------------- /src/overtone_loops/music/drums1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.drums1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) 7 | 8 | ;; 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 | (defloop ticks 1 cymbal-pedal [4 3 4 3 ]) 10 | (defloop hats 1/2 cymbal-closed [_ 5 _ 7 _ 7 _ 7]) 11 | (defloop crashes 1 cymbal-open [_ _ 3 _ _ _ _ _ ]) 12 | 13 | (defloop kicks 1/2 bass-hard [6 _ 4 _ _ _ 4 _ 6 _ 4 _ _ _ 4 _]) 14 | (defloop snares 1/2 snare-hard [_ _ _ _ 6 _ _ 3 _ _ _ 1 6 1 _ 3]) 15 | 16 | ;; --------------------------------------------- 17 | 18 | (bpm 130) 19 | (beats-in-bar 4) 20 | 21 | (at-bar 1 22 | (ticks) 23 | (hats) 24 | (kicks) 25 | ) 26 | 27 | (at-bar 3 28 | (crashes) 29 | ) 30 | 31 | (at-bar 5 32 | (snares) 33 | ) 34 | 35 | (comment 36 | (silence (on-next-bar) ticks hats kicks crashes snares) 37 | (stop) 38 | ) 39 | -------------------------------------------------------------------------------- /src/overtone_loops/music/kick_snare1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.kick-snare1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) 7 | 8 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 9 | (defloop kicks 1/4 bass-hard [6 _ _ _ 6 _ _ _ 6 1 _ 4 6 _ _ _ ]) 10 | 11 | (defloop hats1 1/4 cymbal-closed [_ _ 9 _ _ _ 9 _ _ _ 9 _ _ _ 9 _ ]) 12 | (defloop hats2 1/4 cymbal-pedal [_ _ _ _ _ 3 _ _ _ _ _ _ _ 3 _ _ ]) 13 | (defloop hats3 1/4 ride-bell [_ _ _ _ _ _ _ 2 _ _ _ _ _ _ _ 3 14 | _ _ _ _ _ _ _ _ 3 _ 5 _ 3 _ 5 2 ]) 15 | 16 | (defloop snares 1/4 snare-hard [_ _ _ _ _ _ 7 _ 17 | _ _ _ _ _ _ 7 _ 18 | _ _ _ _ _ _ 7 _ 19 | _ _ _ _ 1 3 7 3]) 20 | 21 | (bpm 105) 22 | (beats-in-bar 4) 23 | 24 | (at-bar 1 25 | (hats1)) 26 | 27 | (at-bar 2 28 | (kicks) 29 | (hats2) 30 | (hats3)) 31 | 32 | (at-bar 4 33 | (snares)) 34 | 35 | (comment 36 | (silence (on-next-bar) hats1 hats2 hats3 kicks snares) 37 | (stop) 38 | ) 39 | 40 | -------------------------------------------------------------------------------- /src/overtone_loops/music/pirates.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.pirates 2 | (:use [overtone.live] 3 | [overtone.inst.piano] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples]) 6 | (:require [clojure.pprint :refer [pp pprint]])) 7 | 8 | ;; Stop any currently playing music and clear any patterns 9 | (set-up) 10 | 11 | ;; Function to play piano notes 12 | (defn fpiano 13 | [anote] 14 | (piano :note (note anote) 15 | :vel 50 16 | :sustain 0.2 17 | :decay 0.1)) 18 | ;; (fpiano :c4) 19 | ;; (stop) 20 | 21 | ;; Define loop players with default patterns 22 | ;; 1 . . 2 . . 3 . . 4 . . 23 | (defloop ticks 1 bass-soft 24 | [6 _ _ 6 _ _ 6 _ _ 6 _ _ ]) 25 | (defloop piano-loop 1 fpiano 26 | [:d4 _ :d4 _ :d4 _ :d4 _ :d4 _ :d4 :c4]) 27 | 28 | 29 | ;; --------------------------------------------- 30 | 31 | (bpm 300) 32 | (beats-in-bar 12) 33 | 34 | (at-bar 1 35 | (ticks)) 36 | 37 | (at-bar 3 38 | (piano-loop)) 39 | 40 | (at-bar 8 41 | (silence piano-loop) 42 | (play-phrase 1 fpiano 43 | [:d4 :c4 :d4 :c4 :d4 :c4 :d4 _ :d4 _ :d4 :c4 ])) 44 | 45 | (at-bar 9 46 | (play-phrase 1 fpiano 47 | [:d4 :c4 :d4 :c4 :d4 :c4 :d4 _ :d4 :c4 :d4 :c4 ])) 48 | 49 | (at-bar 10 50 | (play-phrase 1 fpiano 51 | [:d4 :c4 :d4 :c4 :d4 :c4 :f4 _ :e4 _ :d4 :c4 ])) 52 | 53 | (at-bar 11 54 | (play-phrase 1 fpiano 55 | [:d4 _ _ _ _ _ _ _ _ _ _ :d4 ])) 56 | 57 | (at-bar 12 58 | (play-phrase 1 fpiano 59 | [:d4 _ _ _ _ _ _ _ _ _ _ _ ])) 60 | 61 | (comment 62 | (silence (metro) ticks) 63 | (stop) 64 | ) 65 | -------------------------------------------------------------------------------- /src/overtone_loops/music/rap1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.rap1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; 1 & 2 & 3 & 4 & 10 | (def ticks (loop-player 1/2 cymbal-closed [7 5 6 5 7 5 _ 3 ])) 11 | (def hats (loop-player 1/2 cymbal-pedal [_ _ _ _ _ _ 6 _ ])) 12 | 13 | (def kicks (loop-player 1/2 bass-hard [6 6 _ _ 6 _ _ _ ])) 14 | (def snares (loop-player 1/2 snare-hard [_ _ 7 _ _ _ 9 _ ])) 15 | 16 | (def extra-kicks [6 6 _ _ 6 5 _ 6 ]) 17 | (def extra-snares [_ 2 7 7 _ _ 9 3 ]) 18 | 19 | ;; TO DO... 20 | (defn late-halves 21 | "Play half beats a bit late" 22 | [b] 23 | (if (half-beat? b) (+ b 1/3) 24 | b)) 25 | 26 | ;; --------------------------------------------- 27 | 28 | (bpm 140) 29 | (beats-in-bar 4) 30 | 31 | (at-bar 1 32 | (ticks) 33 | (hats )) 34 | 35 | (at-bar 3 36 | (kicks) 37 | (snares)) 38 | 39 | (comment ; all play for only 2-3 phrases 40 | (kicks (metro) extra-kicks) 41 | (kicks (metro) [6 _ _ 3 6 _ _ 3 ]) 42 | (kicks (metro) :first) 43 | 44 | (snares (metro) extra-snares) 45 | (snares (metro) :first) 46 | ) 47 | 48 | (comment 49 | (silence (metro) ticks hats kicks snares) 50 | (stop) 51 | ) 52 | -------------------------------------------------------------------------------- /src/overtone_loops/music/rap2.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.rap2 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples]) 5 | (:require [clojure.pprint :refer [pp pprint]])) 6 | 7 | ;; Stop any currently playing music and clear any patterns 8 | (set-up) 9 | 10 | ;; Half beats 1 & 2 & 3 & 4 & 11 | (def ticks 12 | (loop-player 1/2 cymbal-closed [7 5 6 5 7 5 _ 3 ])) 13 | (def hats 14 | (loop-player 1/2 cymbal-pedal [_ _ _ _ _ _ 6 _ ])) 15 | 16 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 17 | (def snares 18 | (loop-player 1/4 snare-soft [_ _ _ _ 7 _ _ _ _ _ _ _ 9 _ _ _ 19 | _ _ 5 _ 7 _ _ _ 7 _ _ _ 9 _ _ 5 20 | _ _ _ _ 7 _ _ 1 _ 1 _ _ 9 _ _ _ 21 | _ _ 5 _ 7 _ _ _ 7 _ _ _ 9 1 _ 5 22 | ])) 23 | 24 | (def kicks 25 | (loop-player 1/4 bass-elec [6 _ _ 6 _ _ _ _ 6 _ _ _ _ _ _ _ 26 | 6 _ _ 6 _ _ _ _ 6 _ _ _ _ _ _ _ 27 | 6 _ _ 6 _ _ _ _ 6 _ 5 _ 4 6 _ _ 28 | 6 _ 1 6 _ 1 _ 1 6 _ 5 1 4 6 1 1 29 | ])) 30 | 31 | (defn rep [n vec] 32 | (into [] (apply concat (repeat n vec)))) 33 | 34 | ;; --------------------------------------------- 35 | 36 | (bpm 105) 37 | (beats-in-bar 4) 38 | 39 | (at-bar 1 40 | (ticks) 41 | (hats) 42 | (kicks) 43 | (snares) 44 | ) 45 | 46 | (comment 47 | ;; w off-beat 48 | (kicks (metro) (rep 4 [6 _ _ 6 _ _ _ _ 6 _ _ _ _ _ _ _])) 49 | (kicks (metro) :pop) 50 | ;; regular 51 | (kicks (metro) (rep 4 [6 _ 3 _ 5 _ _ _ 6 _ 3 _ 4 _ _ _])) 52 | ;; regular offbeat 53 | (kicks (metro) (rep 4 [_ _ 6 _ _ _ 5 _ _ _ 6 _ _ _ 4 _])) 54 | ;; back to original pattern 55 | (kicks (metro) :first) 56 | ;; tests 57 | (ticks (metro) [6 _ 6 _ 6 _ 6 _]) 58 | (ticks (metro) [_ 6 _ 6 _ 6 _ 6]) 59 | (ticks (metro) :pop) 60 | 61 | ;; snares 62 | (snares (metro) (rep 8 [_ 3 _ _ 6 _ _ 3])) 63 | (snares (metro) :pop) 64 | (snares (metro) :first) 65 | ) 66 | 67 | ;;(stop) 68 | -------------------------------------------------------------------------------- /src/overtone_loops/music/static1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.static1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Aiming for something like Eat Static - Shadow Locked 7 | 8 | (set-up) 9 | 10 | ;; Instruments --------------------------------------------------------- 11 | 12 | (defn note->hz [n] (midi->hz (note n))) 13 | 14 | (definst tone [freq 440 amp 0.7 sustain 0.5 release 0.5] 15 | "Sine tone that lasts about half a second" 16 | (let [env (env-gen (lin :sustain sustain :release release) :action FREE) 17 | src (sin-osc freq)] 18 | (* amp env src))) 19 | ;; (tone (note->hz :c3)) 20 | ;; (tone :amp 0.1) 21 | 22 | (defn atone [[anote amp]] 23 | (tone :freq (note->hz anote) 24 | :amp (/ amp 9) 25 | :sustain 0.1 26 | :release 0.05)) 27 | 28 | ;; Patterns ------------------------------------------------------------ 29 | 30 | ;; We want to use amps between 0 and 9 in our lists 31 | (amp-scale 1/9) 32 | 33 | ;; 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & 1 & 2 & 3 & 4 & 34 | (def hats 35 | (loop-player 1/2 hat [2 7 2 7 _ 7 2 7 ])) 36 | 37 | (def fingers 38 | (loop-player 1 finger [9 _ 9 _ ])) 39 | 40 | (def kicks 41 | (loop-player 1 kick [6 6 6 6 ])) 42 | 43 | (def claps 44 | (loop-player 1/2 clap [_ 6 _ _ _ 6 _ _ _ 6 _ _ _ 3 7 3 ])) 45 | 46 | (def bass1 47 | (loop-player 1/2 atone [[:f2 4] [:f2 2] [:f2 4] [:d2 2] 48 | [:f2 4] [:d2 2] [:f2 4] [:g2 2]])) 49 | 50 | (def bass2 51 | (loop-player 1/2 atone [[:c3 4] [:f3 2] _ [:c3 2] 52 | [:ab3 4] [:ab3 2] [:c3 4] [:f3 2]])) 53 | 54 | ;; --------------------------------------------- 55 | 56 | (bpm 110) ;; half beats 57 | (beats-in-bar 4) 58 | 59 | (at-bar 1 60 | (hats)) ;; forever 61 | 62 | (at-bar 5 63 | (bass1)) 64 | 65 | (at-bar 7 66 | (fingers)) ;; forever 67 | 68 | (at-bar 9 69 | (bass1 []) 70 | (kicks)) ;; forever 71 | 72 | (at-bar 13 73 | (claps)) 74 | 75 | (at-bar 15 76 | (bass2) 77 | (claps [])) 78 | 79 | (comment 80 | ;; Play these with Ctrl-X Ctrl-E in Emacs 81 | (bass1 (metro) :first) 82 | (bass2 (metro) []) 83 | ) 84 | 85 | ;;(stop) 86 | -------------------------------------------------------------------------------- /src/overtone_loops/music/sticks1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.sticks1 2 | (:use [overtone.live] 3 | [overtone.inst.synth] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | (set-up) 8 | 9 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 10 | (defloop sticks 1/4 stick [8 _ _ _ 6 _ _ 6 _ _ 6 _ _ 6 _ _ ]) 11 | (defloop kicks 1 kick [8 8 8 8 ]) 12 | (defloop clicks 1/4 finger [_ _ _ 3 _ _ 4 _ _ 3 _ _ _ _ 5 _ ]) 13 | 14 | (defn o [[n a]] 15 | (overpad (note n) :amp (/ a 9))) 16 | 17 | ;; 18 | (defloop bass-line 1/4 o [[:f2 4] _ _ _ _ _ _ _ [:g2 5] _ [:b3 3] _ _ _ [:a3 2] [:g2 2]]) 19 | 20 | (defn k [[n a]] 21 | (ks1 (note n) :amp (/ a 9))) 22 | 23 | (defloop melody1 1 k [[:g4 8] [:a4 8] [:b4 8] [:c5 8] _ _ _ _]) 24 | 25 | ;; 1 2 3 4 5 6 7 8 26 | (defloop melody2 1/2 k [_ _ _ _ _ _ _ _ _ _ _ [:c5 8] [:a4 8] [:b4 8] [:g4 8] [:f4 8]]) 27 | 28 | ;; --------------------------------------------- 29 | 30 | (bpm 85) 31 | (beats-in-bar 4) 32 | 33 | (at-bar 1 34 | (sticks ) 35 | (kicks ) 36 | ) 37 | 38 | (at-bar 3 39 | (clicks) 40 | ) 41 | 42 | (at-bar 5 43 | (bass-line ) 44 | ) 45 | 46 | (at-bar 13 47 | (melody1) 48 | ) 49 | 50 | (at-bar 17 51 | (melody2) 52 | ) 53 | 54 | (comment ; all play for only a few phrases 55 | ;; Play these with Ctrl-X Ctrl-E 56 | (melody1 (metro)) 57 | ) 58 | 59 | ;;(stop) 60 | -------------------------------------------------------------------------------- /src/overtone_loops/music/walk1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.walk1 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) 7 | 8 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 9 | (defloop kicks 1/4 bass-hard [6 _ _ _ 6 _ _ _ 6 _ _ _ 6 _ _ _ 10 | 4 _ 6 _ 4 _ 6 _ 4 _ 6 _ 4 _ _ _ 11 | 6 _ _ _ 6 _ _ _ _ _ 6 _ 6 _ _ _ 12 | 6 _ 1 1 6 _ 1 _ 6 _ 1 _ 6 _ 1 _]) 13 | (defloop hats 1/4 cymbal-closed [_ 4 6 _ _ 1 6 _ _ 4 6 _ _ 2 2 2]) 14 | (defloop rides 1/4 ride-bell [_ _ 4 _ _ _ 3 _ _ _ 3 _ 4 _ 3 _ 15 | _ _ 2 _ _ _ 2 _ _ _ 3 1 _ _ 3 4 16 | ]) 17 | 18 | (bpm 110) 19 | (beats-in-bar 4) 20 | (at-bar 1 21 | (kicks) 22 | (hats) 23 | ) 24 | 25 | (at-bar 5 26 | (rides) 27 | ) 28 | 29 | (at-bar 9 30 | (rides []) 31 | ) 32 | 33 | ;;(stop) 34 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/beats.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.beats 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; We want to use amps between 0 and 9 in our lists 7 | (amp-scale 1/9) 8 | 9 | ;; 10 | (defloop countin 1 cymbal-closed [4 4 4 4 ]) 11 | (defloop ticks 1/2 cymbal-closed [_ 4 _ 2 _ 4 _ 2 ]) 12 | (defloop kicks 1/2 bass-hard [5 _ 5 _ 4 _ 5 _ 4 2 3 4 _ 7 _ 4 ]) 13 | (defloop snares 1/2 snare-hard [_ 1 _ _ _ 4 _ _ _ 1 _ _ _ 6 _ _ ]) 14 | 15 | (defloop claps 1/2 clap [_ _ _ _ _ _ _ _ _ _ _ _ 7 1 8 _ ]) 16 | 17 | 18 | ;; --------------------------------------------- 19 | 20 | (bpm 105) 21 | (beats-in-bar 4) 22 | 23 | (defn late [b] 24 | (+ b (* (rand) 0.05))) 25 | 26 | (defn early [b] 27 | (- b (* (rand) 0.05))) 28 | 29 | 30 | (at-bar 1 31 | (countin)) 32 | 33 | (at-bar 2 34 | (ticks) 35 | (kicks) 36 | (snares) 37 | (claps) 38 | ) 39 | 40 | ;;(stop) 41 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/beats88.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.beats88 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Loop patterns 10 | (defloop kicks 1/2 bass-soft [6 _ 5 _ 5 _ _ _ _ _ _ _ _ _ _ _ ]) 11 | 12 | (defloop ticks 1/2 cymbal-closed [5 1 4 1 5 2 4 1 6 1 4 2 5 3 6 1 ]) 13 | 14 | (defloop snares 1/2 snare-hard [_ _ _ _ _ _ 5 _ _ _ _ _ _ _ 4 _ ]) 15 | 16 | (defloop bells 1/2 ride [4 _ _ _ 3 _ _ 6 _ _ _ _ 5 _ _ _ ]) 17 | 18 | ;; --------------------------------------------- 19 | 20 | (bpm 240) 21 | (beats-in-bar 8) 22 | 23 | (at-bar 1 24 | (kicks)) 25 | 26 | (at-bar 3 27 | (ticks)) 28 | 29 | (at-bar 5 30 | (snares)) 31 | 32 | (at-bar 7 33 | (bells)) 34 | 35 | (comment 36 | ;; Put live code here 37 | 38 | ;; Kicks 39 | (kicks (metro) [6 _ 5 _ 5 _ _ _ _ 4 6 2 _ _ _ 3 ]) 40 | (kicks (metro) [6 _ 5 _ 5 _ 3 _ 6 1 7 1 4 _ 6 3 ]) 41 | (kicks (metro) :first) 42 | 43 | ;; Snares 44 | (snares (metro) [_ _ _ _ _ _ 6 _ _ 1 _ _ 2 _ 5 _ ]) 45 | (snares (metro) :first) 46 | 47 | ;; Rides 48 | (bells (metro) [4 _ _ _ 3 _ _ _ 6 _ _ _ 3 _ _ _ ]) 49 | (bells (metro) :first) 50 | 51 | ;; 52 | ;; 53 | (silence (metro) kicks snares bells ticks) 54 | (stop) 55 | ) 56 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/control-samples.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.music.rap2 2 | (:use [overtone.live] 3 | [overtone-loops.loops])) 4 | 5 | ;; Define some samples from Freesound.org 6 | (def kick (freesound2 171104)) 7 | (def snare (freesound2 404859)) 8 | (def hat (freesound2 404891)) 9 | (def hat2 (freesound2 404893)) 10 | (def clap (freesound2 24787)) 11 | 12 | ;; Half beats 1 & 2 & 3 & 4 & 13 | (defloop ticks (4 1/2) hat [7 5 6 5 7 5 - 3 ]) 14 | (defloop hats (4 1/2) hat2 [- - - - - - 6 - ]) 15 | 16 | ;; Quarter beats 1 e & a 2 e & a 3 e & a 4 e & a 17 | (defloop snares (16 1/4) snare [- - - - 7 - - - - - - - 9 - - - 18 | - - 5 - 7 - - - 7 - - - 9 - - 5 19 | - - - - 7 - - 1 - 1 - - 9 - - - 20 | - - 5 - 7 - - - 7 - - - 9 1 - 5 21 | ]) 22 | 23 | (defloop kicks (16 1/4) kick [6 - - 6 - - - - 6 - - - - - - - 24 | 6 - - 6 - - - - 6 - - - - - - - 25 | 6 - - 6 - - - - 6 - 5 - 4 6 - - 26 | 6 - 1 6 - 1 - 1 6 - 5 1 4 6 1 1 27 | ]) 28 | 29 | ;; --------------------------------------------- 30 | 31 | (bpm 105) 32 | (beats-in-bar 4) 33 | 34 | (at-bar 1 35 | (ticks ) 36 | (hats ) 37 | (kicks ) 38 | (snares ) 39 | ) 40 | 41 | (comment 42 | ;; All samples in this file use stereo player 43 | (inst-pan! mono-sample-player -0.7) 44 | (inst-pan! stereo-sample-player 0) 45 | 46 | (inst-volume! mono-sample-player 1) 47 | (inst-volume! stereo-sample-player 0.5) 48 | 49 | ) 50 | 51 | ;;(stop) 52 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/control.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.examples.bass 2 | "Example of defloop0 and thunks -- use defloop instead!" 3 | (:use [overtone.live] 4 | [overtone-loops.loops] 5 | [overtone-loops.utils])) 6 | 7 | ;; Define some instruments 8 | (definst kick [freq 100 dur 0.5 width 0.5] 9 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 10 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 11 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 12 | src (sin-osc freq-env) 13 | drum (+ sqr (* env src))] 14 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 15 | 16 | (definst hat [amp 0.8 t 0.04] 17 | (let [env (env-gen (perc 0.001 t) 1 1 0 1 FREE) 18 | noise (white-noise) 19 | sqr (* (env-gen (perc 0.01 0.04)) (pulse 880 0.2)) 20 | filt (bpf (+ sqr noise) 9000 0.5)] 21 | (* amp env filt))) 22 | 23 | ;; Our loops - both 4 beats to the bar 24 | (defloop0 bass 4 25 | 0 kick 26 | 0.7 kick 27 | 1 (thunk (kick 200)) 28 | 2 kick 29 | 2.7 kick 30 | 3 (thunk (kick 300)) 31 | ) 32 | 33 | (defloop0 hats 4 34 | 0 (thunk (hat 0.4)) 35 | 0.5 hat 36 | 1 (thunk (hat 0.4)) 37 | 2 (thunk (hat 0.4)) 38 | 3 (thunk (hat 0.4)) 39 | 3.7 hat 40 | ) 41 | 42 | (metro-bpm metro 110) 43 | 44 | (at-bar 1 45 | (bass) 46 | (hats) 47 | ) 48 | 49 | (comment 50 | ;; Change panning 51 | (inst-pan! kick -0.5) 52 | (inst-pan! hat 0.5) 53 | 54 | ;; Change other params 55 | (inst-volume! kick 0.5) 56 | 57 | ;; These don't work - because they only apply 58 | ;; to currently running synths? 59 | (ctl kick :freq 200) 60 | ) 61 | 62 | ;;(stop) 63 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/loop_fns.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.loop_fns 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples]) 5 | (:require [clojure.pprint :refer [pp pprint]])) 6 | 7 | ;; Stop any currently playing music and clear any patterns 8 | (set-up) 9 | 10 | ;; We want to use amps between 0 and 9 in our lists 11 | (amp-scale 1/9) 12 | 13 | ;; Define loop players with start pattern 1 & 2 & 3 & 4 & 14 | (def ticks (loop-player 1/2 cymbal-closed [7 5 6 5 7 5 _ 3 ])) 15 | (def hats (loop-player 1/2 cymbal-pedal [_ _ _ _ _ _ 6 _ ])) 16 | 17 | (def kicks (loop-player 1/2 bass-hard [6 6 _ _ 6 _ _ _ ])) 18 | (def snares (loop-player 1/2 snare-hard [_ _ 7 _ _ _ 9 _ ])) 19 | 20 | (def alt-kicks [_ _ _ _ _ 5 _ 6 ]) 21 | (def alt-snares [_ 2 _ 7 _ _ _ 3 ]) 22 | (def silence []) 23 | 24 | ;; --------------------------------------------- 25 | 26 | (bpm 105) 27 | (beats-in-bar 4) 28 | 29 | ;; Calling a player starts it, passing a new pattern (list) 30 | ;; changes the pattern 31 | 32 | ;; Start playing each loop 33 | (at-bar 1 34 | (ticks) 35 | (hats)) 36 | 37 | (at-bar 3 38 | (kicks)) 39 | 40 | (at-bar 5 41 | (snares)) 42 | 43 | (at-bar 7 44 | ;; switch to a new pattern 45 | (kicks alt-kicks)) 46 | 47 | (at-bar 9 48 | ;; switch back to original pattern 49 | (kicks :pop)) 50 | 51 | ;;(stop) 52 | 53 | (comment 54 | ;; Run these in Emacs with Ctrl-X Ctrl-E 55 | 56 | (kicks (metro) alt-kicks) 57 | (kicks (metro) [6 6]) 58 | (kicks (on-next-bar) :first) 59 | 60 | (snares (metro) alt-snares) 61 | (snares (metro) silence) 62 | ) 63 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/mar19_2019.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.mar19-2019 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Patterns ------------------------------------------------------------ 7 | 8 | ;; 1 2 3 4 9 | (defloop kicks (4 1/5) bass-elec [7 - - - 7 1 - - - - 7 - - - - 7 - - - - ]) 10 | 11 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 12 | (defloop ticks (4 1/2) cymbal-closed [1 5 1 4 2 5 1 4 ]) 13 | (defloop clicks 4 finger [8 - 8 - ]) 14 | (defloop rides1 (4 1/2) ride [7 7 6 7 8 7 8 6 ]) 15 | 16 | (defloop hats1 (4 1/4) cymbal-closed [- - 5 - - - 5 - - - 6 - - - 3 - ]) 17 | (defloop pedals1 (4 1/4) cymbal-pedal [- - - - - - - - 3 - - - 2 - - - ]) 18 | 19 | (defloop hats2 (4 1/4) cymbal-closed [1 - 5 - 2 3 5 - 8 4 - 1 3 - 2 - ]) 20 | (defloop pedals2 (4 1/4) cymbal-pedal [- 3 - 2 - - - - - - 2 - - 5 - 4 ]) 21 | 22 | 23 | ;; --------------------------------------------------------------------- 24 | 25 | (bpm 110) 26 | (beats-in-bar 4) 27 | 28 | (at-bar 1 29 | (ticks 4) 30 | (kicks 20) 31 | ) 32 | 33 | (at-bar 5 34 | (hats1 12) 35 | (pedals1 12) 36 | ) 37 | 38 | (at-bar 13 39 | (clicks 8) 40 | ) 41 | 42 | (at-bar 17 43 | (hats2) 44 | (pedals2) 45 | ) 46 | 47 | (at-bar 25 48 | (kicks 20) 49 | ) 50 | 51 | (comment ; all play for only a few phrases 52 | ;; Play these with Ctrl-X Ctrl-E 53 | (ticks (on-next-bar)) 54 | (hats (on-next-bar)) 55 | (rides1 (on-next-bar) 4) 56 | 57 | ;; To stop any loop, redefine it as empty 58 | (emptyloop clicks 4) 59 | (emptyloop hats 4) 60 | (emptyloop pedals 4) 61 | ) 62 | 63 | ;;(stop) 64 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/mar19_2019b.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.mar19-2019b 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Patterns ------------------------------------------------------------ 7 | 8 | ;; 1 2 3 4 9 | (defloop ticks (4 1/2) cymbal-closed [1 5 1 4 2 5 1 4 ]) 10 | (defloop kicks (4 1/5) bass-elec [7 - - - 7 1 - - - - 7 - - - - 7 - - - - ]) 11 | 12 | ;; --------------------------------------------------------------------- 13 | 14 | (bpm 110) 15 | (beats-in-bar 4) 16 | 17 | (at-bar 1 18 | (ticks) 19 | (kicks) 20 | ) 21 | 22 | ;;(stop) 23 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/melody_loops1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.melody-loops1.clj 2 | (:use [overtone.live] 3 | [overtone.inst.synth] 4 | [overtone-loops.loops])) 5 | 6 | ;; Define some samples from Freesound.org 7 | (def kick (freesound2 56430)) 8 | (def stick (freesound2 82280)) 9 | 10 | ;; 1 e & a 2 e & a 3 e & a 4 e & a 11 | (defloop sticks (4 1/4) stick [8 - - - 6 - - 6 - - 6 - - 6 - - ]) 12 | (defloop kicks 4 kick [8 8 8 8 ]) 13 | 14 | (defn o [anote amp] 15 | (overpad (note anote) :amp (/ amp 9))) 16 | 17 | (defloop bass-line 4 18 | 0 (o :f2 4) 19 | 2 (o :g2 5) 20 | 2.5 (o :b3 3) 21 | 3.5 (o :a3 2) 22 | 3.82 (o :g2 2) 23 | ) 24 | 25 | ;; (emptyloop bass-line 4) 26 | 27 | (defn k [anote amp] 28 | (ks1 (note anote) :amp (/ amp 9))) 29 | 30 | (deflooplist melody1 8 k [[:g4 8] [:a4 8] [:b4 8] [:c5 8]]) 31 | ;; (emptyloop melody1 8) 32 | 33 | 34 | ;; 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 35 | (defloop melody2 (8 1/2) k [- - - - - - - - - - - [:c5 8] [:a4 8] [:b4 8] [:g4 8][:f4 8]]) 36 | ;; (emptyloop melody2 8) 37 | 38 | ;; --------------------------------------------- 39 | 40 | (bpm 85) 41 | (beats-in-bar 4) 42 | 43 | (at-bar 1 44 | (sticks ) 45 | (kicks ) 46 | ) 47 | 48 | (at-bar 5 49 | (bass-line ) 50 | ) 51 | 52 | (at-bar 13 53 | (melody1) 54 | ) 55 | 56 | (at-bar 17 57 | (melody2) 58 | ) 59 | 60 | (comment ; all play for only a few phrases 61 | ;; Play these with Ctrl-X Ctrl-E 62 | ) 63 | 64 | ;;(stop) 65 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/play_sample.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.play-sample 2 | (:use [overtone.live] 3 | [overtone.inst.synth]) 4 | (:require [overtone-loops.loops :refer [defloop metro 5 | on-next-bar 6 | freesound2]])) 7 | 8 | ;; Define some samples from Freesound.org 9 | (def kick (freesound2 56430)) 10 | (def rim (freesound2 34831)) 11 | (def chorus (freesound2 213904)) 12 | 13 | ;; (chorus :amp 1 :rate 0.5 :release 2) 14 | ;; (chorus :amp 1 :rate 0.5) 15 | 16 | ;; (chorus :amp 1 :rate 4 :release 3) 17 | ;; (chorus :rate 1.5) 18 | 19 | 20 | ;; Compare default player with our one 21 | (def stick (freesound 82280)) 22 | (def stick2 (freesound2 82280)) 23 | 24 | ;; (stick) 25 | ;; (stick2) 26 | 27 | ;; More tests 28 | (def chorus-buf (load-sample (freesound-path 213904))) 29 | 30 | ;; (stop) 31 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/sample_from_file.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.sample-from-file 2 | "Load a sample from a file and return a player function, but see simpler method with `sample` in sample-from-file2" 3 | (:use [overtone.live] 4 | [overtone.inst.synth] 5 | [overtone-loops.loops])) 6 | 7 | (defn filesample 8 | [path] 9 | (let [sample-buf (load-sample path) 10 | buf-id (:id sample-buf) 11 | dur (:duration sample-buf) 12 | channels (:n-channels sample-buf)] 13 | (fn [ & args ] 14 | (cond 15 | (= 1 channels) (apply mono-sample-player buf-id dur args) 16 | (= 2 channels) (apply stereo-sample-player buf-id dur args))))) 17 | 18 | (def boom (filesample "resources/samples/bd_boom.wav")) 19 | 20 | (boom) 21 | 22 | ;; (stop) 23 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/sample_from_file2.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.sample-from-file2 2 | (:use [overtone.live] 3 | [overtone.inst.synth] 4 | [overtone-loops.loops])) 5 | 6 | (def boom1 (sample "resources/samples/drum_bass_hard.wav")) 7 | (def boom2 (sample2 "resources/samples/drum_bass_hard.wav")) 8 | 9 | (comment 10 | ;; This clicks for some samples! 11 | (boom1) 12 | 13 | ;; This doesn't 14 | (boom2) 15 | ) 16 | 17 | ;; (stop) 18 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/schedule_tests.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.schedule-tests 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Instruments 10 | 11 | (definst ikick [freq 100 dur 0.5 width 0.5] 12 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 13 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 14 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 15 | src (sin-osc freq-env) 16 | drum (+ sqr (* env src))] 17 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 18 | ;;(ikick) 19 | 20 | (defn fkick [amp] 21 | (ikick)) 22 | ;;(fkick 4/9) 23 | 24 | (definst isnare [freq 200 dur 0.5 width 0.5] 25 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 26 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 27 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 28 | src (sin-osc freq-env) 29 | drum (+ sqr (* env src))] 30 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 31 | ;;(asnare) 32 | 33 | (defn fsnare [amp] 34 | (isnare)) 35 | 36 | ;; 1 & 2 & 3 & 4 & 37 | (def kicks (loop-player 1/2 fkick [6 6 _ 6 6 _ _ _ ])) 38 | (def snares (loop-player 1/2 fsnare [_ _ 7 _ _ 6 _ 2 ])) 39 | 40 | ;; --------------------------------------------- 41 | 42 | (bpm 150) 43 | (beats-in-bar 4) 44 | 45 | (kicks (metro)) 46 | (snares (metro)) 47 | 48 | ;;(stop) 49 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/schedule_tests_overtone.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.schedule-tests-overtone 2 | "Tests for instrument clashes, something I've seen fairly 3 | frequently: where one instrument takes the wrong rhythm. 4 | 5 | This code uses no Overtone Loops functionality. " 6 | (:use [overtone.live])) 7 | 8 | ;; Stop any currently playing music and clear any patterns 9 | (set-up) 10 | 11 | ;; Instruments 12 | 13 | (definst ikick [freq 100 dur 0.5 width 0.5] 14 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 15 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 16 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 17 | src (sin-osc freq-env) 18 | drum (+ sqr (* env src))] 19 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 20 | ;;(ikick) 21 | 22 | (definst isnare [freq 200 dur 0.5 width 0.5] 23 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 24 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 25 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 26 | src (sin-osc freq-env) 27 | drum (+ sqr (* env src))] 28 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 29 | ;;(asnare) 30 | 31 | ;; --------------------------------------------- 32 | 33 | (bpm 300) 34 | 35 | (defn kicks [beat] 36 | (apply-by (metro beat) 37 | (fn [] 38 | ;; This seems to work with no problems 39 | (at (metro (+ beat 0)) (ikick)) 40 | (at (metro (+ beat 1)) (ikick)) 41 | (at (metro (+ beat 3)) (ikick)) 42 | (at (metro (+ beat 4)) (ikick)) 43 | (kicks (+ beat 8))))) 44 | 45 | (defn snares [beat] 46 | (apply-by (metro beat) 47 | (fn [] 48 | (at (metro (+ beat 2)) (isnare)) 49 | (at (metro (+ beat 5)) (isnare)) 50 | (at (metro (+ beat 7)) (isnare)) 51 | (snares (+ beat 8))))) 52 | 53 | (kicks (metro)) 54 | (snares (metro)) 55 | 56 | 57 | ;;(stop) 58 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/schedule_tests_overtone2.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.schedule-tests-overtone2 2 | "Tests for instrument clashes, something I've seen fairly 3 | frequently: where one instrument takes the wrong rhythm. 4 | 5 | This code uses no Overtone Loops functionality. " 6 | (:use [overtone.live])) 7 | 8 | ;; Stop any currently playing music and clear any patterns 9 | (set-up) 10 | 11 | ;; Instruments 12 | 13 | (definst ikick [freq 100 dur 0.5 width 0.5] 14 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 15 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 16 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 17 | src (sin-osc freq-env) 18 | drum (+ sqr (* env src))] 19 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 20 | ;;(ikick) 21 | 22 | (definst isnare [freq 200 dur 0.5 width 0.5] 23 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 24 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 25 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 26 | src (sin-osc freq-env) 27 | drum (+ sqr (* env src))] 28 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 29 | ;;(asnare) 30 | 31 | ;; --------------------------------------------- 32 | 33 | (stop) 34 | (bpm 500) 35 | 36 | (defn kicks [beat] 37 | (apply-by (metro beat) 38 | (fn [] 39 | (Thread/sleep 100) 40 | (doall (map 41 | ;; This format seems to play well 42 | (fn [b] 43 | (at (metro (+ beat b)) (ikick))) 44 | [0 1 3 4])) 45 | (kicks (+ beat 8))))) 46 | 47 | (defn snares [beat] 48 | (apply-by (metro beat) 49 | (fn [] 50 | (Thread/sleep 100) 51 | (doall (map 52 | (fn [b] 53 | (at (metro (+ beat b)) (isnare))) 54 | [2 5 7])) 55 | (snares (+ beat 8))))) 56 | 57 | 58 | (kicks (metro)) 59 | (snares (metro)) 60 | 61 | ;;(stop) 62 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/schedule_tests_overtone3.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.schedule-tests-overtone3 2 | "Tests for instrument clashes, something I've seen fairly 3 | frequently: where one instrument takes the wrong rhythm. 4 | 5 | This code uses no Overtone Loops functionality. " 6 | (:use [overtone.live])) 7 | 8 | ;; Stop any currently playing music and clear any patterns 9 | (set-up) 10 | 11 | ;; Instruments 12 | 13 | (definst ikick [freq 100 dur 0.5 width 0.5] 14 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 15 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 16 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 17 | src (sin-osc freq-env) 18 | drum (+ sqr (* env src))] 19 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 20 | ;;(ikick) 21 | 22 | (definst isnare [freq 200 dur 0.5 width 0.5] 23 | (let [freq-env (* freq (env-gen (perc 0 (* 0.99 dur)))) 24 | env (env-gen (perc 0.01 dur) 1 1 0 1 FREE) 25 | sqr (* (env-gen (perc 0 0.01)) (pulse (* 2 freq) width)) 26 | src (sin-osc freq-env) 27 | drum (+ sqr (* env src))] 28 | (compander drum drum 0.2 1 0.1 0.01 0.01))) 29 | ;;(isnare) 30 | 31 | ;; --------------------------------------------- 32 | 33 | (stop) 34 | (bpm 500) 35 | 36 | (defn kicks [beat] 37 | (apply-by (metro beat) 38 | (fn [] 39 | ;; This format seems to result in instrument clashes 40 | (defn- player [b] 41 | (at (metro (+ beat b)) 42 | (ikick))) 43 | (doall (map player [0 1 3 4])) 44 | (kicks (+ beat 8))))) 45 | 46 | (defn snares [beat] 47 | (apply-by (metro beat) 48 | (fn [] 49 | (defn- player [b] 50 | (at (metro (+ beat b)) 51 | (isnare))) 52 | (doall (map player [2 5 7])) 53 | (snares (+ beat 8))))) 54 | 55 | (kicks (metro)) 56 | (snares (metro)) 57 | 58 | 59 | ;;(stop) 60 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/scratch1.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.scratch1 2 | (:use [overtone.live] 3 | [overtone.inst.synth] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | (defn note->hz [n] (midi->hz (note n))) 8 | 9 | (supersaw (note :a7)) 10 | (ctl supersaw :amp 0.5) 11 | (kill supersaw) 12 | 13 | (cs80lead) 14 | (ctl cs80lead :vibrate 16 :freq (note->hz :a3)) 15 | (kill cs80lead) 16 | 17 | (simple-flute) 18 | (ctl simple-flute :freq (note->hz :e4)) 19 | 20 | (rise-fall-pad :t 4 :freq (note->hz :e5)) 21 | 22 | (odoc ctl) 23 | 24 | (defn playchord [notes] 25 | (defn- p [n] 26 | (overpad :note (note n) :attack 5 27 | :release 10 :amp 0.3)) 28 | (doall (map p notes))) 29 | 30 | (playchord '(:g2 :b2 :d3 :f#3)) 31 | (playchord '(:b2 :d3 :g3)) 32 | 33 | (do 34 | (overpad :note (note :g3) :attack 5 :release 10 :amp 0.3) 35 | (overpad :note (note :b3) :attack 5 :release 10 :amp 0.3) 36 | (overpad :note (note :d4) :attack 5 :release 10 :amp 0.3) 37 | ) 38 | 39 | (kill pad) 40 | 41 | ;;(stop) 42 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/semiquavers.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.semiquavers 2 | (:use [overtone.live] 3 | [overtone.inst.piano] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples])) 6 | 7 | (set-up) 8 | 9 | ;; Patterns ------------------------------------------------------------ 10 | ;; Instruments 11 | ;; Function to play piano notes 12 | (defn fpiano 13 | [anote] 14 | (piano :note (note anote) 15 | :vel 70 16 | :sustain 0.2 17 | :decay 0.1)) 18 | 19 | ;; Patterns ------------------------------------------------------------ 20 | ;; 1 2 3 4 21 | (defloop pat1 1 finger [6 6 6 6 ]) 22 | (defloop pat2 1/4 finger [7 _ 4 _ 7 _ 4 _ 7 _ 4 _ 7 _ 4 _]) 23 | 24 | (defloop melody 1/4 fpiano [:f4 _ _ _ 25 | :bb4 _ _ _ 26 | :a4 _ :c4 _ 27 | :bb4 _ _ _ ]) 28 | 29 | ;; (cymbal-closed) 30 | 31 | ;; --------------------------------------------------------------------- 32 | 33 | (bpm 130) 34 | (beats-in-bar 4) 35 | 36 | (at-bar 1 37 | (pat1) 38 | (melody) 39 | ) 40 | 41 | (at-bar 5 42 | (silence pat1) 43 | (pat2) 44 | (melody [:f4 _ _ _ 45 | :bb4 _ _ _ 46 | :a4 _ _ _ 47 | :bb4 _ _ _ ])) 48 | 49 | (comment ; all play for only a few phrases 50 | ;; Play these with Ctrl-X Ctrl-E 51 | (silence (metro) pat1) 52 | (pat2 (on-next-bar)) 53 | 54 | (pat2 (metro) [3 _ 7 _ 3 _ 7 _ 3 _ 7 _ 3 _ 7 _]) 55 | (pat2 (metro) [_ _ 7 _ _ _ 7 2 4 _ 7 _ _ _ 7 _]) 56 | (pat2 (metro) [_ 7 _ _ _ 7 _ _ _ 7 _ _ _ 7 _ _]) 57 | (pat2 (metro) :first) 58 | 59 | (melody (metro) [:f4 _ :d4 :d#4 60 | :f4 _ _ _ 61 | :f4 :g4 :bb4 :g4 62 | :c4 _ _ _ ]) 63 | 64 | (melody (metro) :pop) 65 | 66 | ) 67 | 68 | ;;(stop) 69 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/simple.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.simple 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | ;; Stop any currently playing music and clear any patterns 7 | (set-up) 8 | 9 | ;; Loop patterns 10 | (defloop ticks 1 cymbal-pedal [4 2 4 2 ]) 11 | (defloop kicks 1 bass-hard [_ 5 _ 5 ]) 12 | (defloop snares 1 snare-hard [_ _ 5 _ ]) 13 | (defloop claps 1 clap [5 _ _ _ ]) 14 | 15 | ;; --------------------------------------------- 16 | 17 | (bpm 230) 18 | (beats-in-bar 4) 19 | 20 | (at-bar 1 21 | (ticks) 22 | (claps)) 23 | 24 | (at-bar 3 25 | (snares) 26 | (kicks)) 27 | 28 | (comment 29 | ;; Put live code here 30 | (claps (metro) :pop) 31 | ;; 32 | (stop) 33 | ) 34 | -------------------------------------------------------------------------------- /src/overtone_loops/proto/triplets.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.proto.triplets 2 | (:use [overtone.live] 3 | [overtone-loops.loops] 4 | [overtone-loops.samples])) 5 | 6 | (set-up) 7 | 8 | ;; Patterns ------------------------------------------------------------ 9 | ;; 1 2 3 4 10 | (defloop pat1 1 finger [6 6 6]) 11 | (defloop pat2 1/3 finger [7 _ _ 7 _ _ 7 6 8 7 _ _ ]) 12 | 13 | ;; (cymbal-closed) 14 | 15 | ;; --------------------------------------------------------------------- 16 | 17 | (bpm 110) 18 | (beats-in-bar 4) 19 | 20 | (at-bar 1 21 | (pat2) 22 | ) 23 | 24 | (comment ; all play for only a few phrases 25 | ;; Play these with Ctrl-X Ctrl-E 26 | ) 27 | 28 | ;;(stop) 29 | -------------------------------------------------------------------------------- /src/overtone_loops/samples.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.samples 2 | (:use [overtone-loops.loops])) 3 | 4 | ;; Define local samples & some freesound placeholders -- until 5 | ;; we replace them with local ones 6 | 7 | (def cowbell (sample2 "resources/samples/drum_cowbell.wav")) ;; (cowbell) 8 | (def clap (sample2 "resources/samples/perc_clap.wav")) ;; (clap) 9 | ;;(def crash (freesound2 439789)) ;; (crash) 10 | 11 | (def cymbal-open (sample2 "resources/samples/drum_cymbal_open.wav")) ;; (cymbal-open) 12 | (def cymbal-closed (sample2 "resources/samples/drum_cymbal_closed.wav")) ;; (cymbal-closed) 13 | ;;(def hatc2 (freesound2 404890)) ;; closed ;; (hatc2) 14 | ;;(def hatc3 (freesound2 96140)) ;; (hat3) 15 | (def cymbal-pedal (sample2 "resources/samples/drum_cymbal_pedal.wav")) ;; (cymbal-pedal) 16 | (def cymbal-soft (sample2 "resources/samples/drum_cymbal_soft.wav")) ;; (cymbal-soft) 17 | (def hat cymbal-closed) 18 | 19 | (def bass-hard (sample2 "resources/samples/drum_bass_hard.wav")) ;; (bass-hard) 20 | (def bass-soft (sample2 "resources/samples/drum_bass_soft.wav")) ;; (bass-soft) 21 | (def bass-elec (sample2 "resources/samples/kick_171104.wav")) ;; (bass-elec) 22 | (def kick bass-hard) 23 | 24 | (def ride (sample2 "resources/samples/drum_ride.wav")) ;; (ride) 25 | (def ride-bell (sample2 "resources/samples/drum_ride_bell.wav")) ;; (ride-bell) 26 | (def rim (sample2 "resources/samples/drum_rim.wav")) ;; (rim) 27 | 28 | (def snare-hard (sample2 "resources/samples/drum_snare_hard.wav")) ;; (snare-hard :amp 0.2) 29 | (def snare-soft (sample2 "resources/samples/drum_snare_soft.wav")) ;; (snare-soft) 30 | (def snare snare-hard) 31 | 32 | (def tom-hi-hard (sample2 "resources/samples/drum_tom_hi_hard.wav")) ;; (tom-hi-hard) 33 | (def tom-mid-hard (sample2 "resources/samples/drum_tom_mid_hard.wav")) ;; (tom-mid-hard) 34 | (def tom-lo-hard (sample2 "resources/samples/drum_tom_lo_hard.wav")) ;; (tom-lo-hard) 35 | 36 | ;; Snaps etc 37 | (def finger (sample2 "resources/samples/finger_177495.wav")) ;; (finger) 38 | (def stick (sample2 "resources/samples/stick_82280.wav")) ;; (stick) 39 | -------------------------------------------------------------------------------- /src/overtone_loops/utils.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.utils) 2 | 3 | (defmacro thunk 4 | "Wrap the body in a function, thereby delaying execution" 5 | [& body] 6 | `(fn [] ~@body)) 7 | 8 | (defn map-odds 9 | "Apply fn to odd items only: 1st, 3rd, ..." 10 | [fn seq] 11 | (cond 12 | (empty? seq) '() 13 | :else (list* (fn (first seq)) 14 | (second seq) 15 | (map-odds fn (rest (rest seq)))))) 16 | 17 | (defn map-evens 18 | "Apply fn to even items only: 2nd, 4th, ..." 19 | [fn seq] 20 | (cond 21 | (empty? seq) '() 22 | :else (list* (first seq) 23 | (fn (second seq)) 24 | (map-evens fn (rest (rest seq)))))) 25 | 26 | (defn pairer 27 | "Pair up items from a sequence, e.g. beat playable pairs 28 | 29 | (pairer '(1 2 3 4 5 6 7 8)) 30 | => ((1 2) (3 4) (5 6) (7 8)) 31 | " 32 | [seq] 33 | (cond 34 | (empty? seq) '() 35 | :else (cons (list (first seq) (second seq)) 36 | (pairer (rest (rest seq)))) 37 | )) 38 | 39 | -------------------------------------------------------------------------------- /test/overtone_loops/core_test.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.core-test 2 | (:require [clojure.test :refer :all] 3 | [overtone-loops.core :refer :all])) 4 | 5 | (deftest a-test 6 | (testing "FIXME, I fail." 7 | (is (= 0 1)))) 8 | -------------------------------------------------------------------------------- /test/overtone_loops/loops_human_test.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.loops-human-test 2 | (:use [overtone.live] 3 | [overtone.inst.piano] 4 | [overtone-loops.loops] 5 | [overtone-loops.samples]) 6 | (:require [clojure.test :refer :all])) 7 | 8 | 9 | ;; eval and listen to test with Ctrl-c Ctrl-t t 10 | 11 | (deftest play-bar-pairs-tests 12 | (testing "Two kicks and a snare" 13 | (is (some? 14 | (play-bar-pairs (metro) 15 | (list 16 | (list 0 kick) 17 | (list 1 kick) 18 | (list 2 snare))))))) 19 | 20 | (deftest play-bar-tests 21 | (testing "Two kicks and a snare" 22 | (is (some? 23 | (play-bar (metro) 24 | 0 kick 25 | 0.66 kick 26 | 1 kick 27 | 2 snare))))) 28 | 29 | 30 | ;; (stop) 31 | -------------------------------------------------------------------------------- /test/overtone_loops/loops_test.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.loops-test 2 | (:use [overtone.live] 3 | [overtone.inst.piano]) 4 | (:require [clojure.test :refer :all] 5 | [overtone-loops.loops :refer :all])) 6 | 7 | 8 | ;; None yet, see utils_test 9 | -------------------------------------------------------------------------------- /test/overtone_loops/utils_test.clj: -------------------------------------------------------------------------------- 1 | (ns overtone-loops.utils-test 2 | (:require [clojure.test :refer :all] 3 | [overtone-loops.utils :refer :all])) 4 | 5 | 6 | (deftest thunk-test 7 | (testing "Thunks" 8 | (is (fn? (thunk (+ 1 2)))) 9 | (is (= 2 ((thunk (+ 1 1))))))) 10 | 11 | 12 | (deftest pairer-test 13 | (testing "pairer works on simple lists" 14 | (is (= '((1 2) (3 4) (5 6) (7 8)) 15 | (pairer '(1 2 3 4 5 6 7 8))))) 16 | (testing "handles odd number of items" 17 | (is (= '((1 2) (3 4) (5 nil))) 18 | (pairer '(1 2 3 4 5))))) 19 | 20 | 21 | (deftest map-odds-evens-test 22 | (testing "a" 23 | (is (= '(2 2 4 4 6 6) 24 | (map-odds inc '(1 2 3 4 5 6)))) 25 | (is (= '(1 3 3 5 5 7) 26 | (map-evens inc '(1 2 3 4 5 6)))) 27 | 28 | )) 29 | 30 | --------------------------------------------------------------------------------