├── Ableton+M4L ├── Live template Project │ ├── Ableton Project Info │ │ └── Project8_1.cfg │ └── Live template.als ├── Master-tempo-send.amxd └── Stream-Pitch.amxd ├── Applescripts └── Rules.scpt ├── Pd └── Soundflower-re-route.pd ├── Python └── getTempoAndKey.py ├── README.md └── TouchOSC └── Max DJ.touchosc /Ableton+M4L/Live template Project/Ableton Project Info/Project8_1.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactify/dj-spotify/df925b6e963e63b139839d30489c20e4ef348cc1/Ableton+M4L/Live template Project/Ableton Project Info/Project8_1.cfg -------------------------------------------------------------------------------- /Ableton+M4L/Live template Project/Live template.als: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactify/dj-spotify/df925b6e963e63b139839d30489c20e4ef348cc1/Ableton+M4L/Live template Project/Live template.als -------------------------------------------------------------------------------- /Ableton+M4L/Master-tempo-send.amxd: -------------------------------------------------------------------------------- 1 | ampfaaaametaptchu{ 2 | "patcher" : { 3 | "fileversion" : 1, 4 | "appversion" : { 5 | "major" : 5, 6 | "minor" : 1, 7 | "revision" : 9 8 | } 9 | , 10 | "rect" : [ 95.0, 260.0, 1050.0, 449.0 ], 11 | "bglocked" : 0, 12 | "defrect" : [ 95.0, 260.0, 1050.0, 449.0 ], 13 | "openrect" : [ 0.0, 0.0, 0.0, 169.0 ], 14 | "openinpresentation" : 1, 15 | "default_fontsize" : 10.0, 16 | "default_fontface" : 0, 17 | "default_fontname" : "Arial Bold", 18 | "gridonopen" : 0, 19 | "gridsize" : [ 8.0, 8.0 ], 20 | "gridsnaponopen" : 0, 21 | "toolbarvisible" : 1, 22 | "boxanimatetime" : 500, 23 | "imprint" : 0, 24 | "enablehscroll" : 1, 25 | "enablevscroll" : 1, 26 | "devicewidth" : 0.0, 27 | "boxes" : [ { 28 | "box" : { 29 | "maxclass" : "newobj", 30 | "text" : "del 100", 31 | "fontsize" : 10.0, 32 | "numinlets" : 2, 33 | "numoutlets" : 1, 34 | "patching_rect" : [ 808.0, 177.0, 44.0, 18.0 ], 35 | "id" : "obj-41", 36 | "fontname" : "Arial Bold", 37 | "outlettype" : [ "bang" ] 38 | } 39 | 40 | } 41 | , { 42 | "box" : { 43 | "maxclass" : "message", 44 | "text" : "$1BPM", 45 | "fontsize" : 10.0, 46 | "numinlets" : 2, 47 | "numoutlets" : 1, 48 | "patching_rect" : [ 567.0, 318.0, 44.0, 16.0 ], 49 | "id" : "obj-42", 50 | "fontname" : "Arial Bold", 51 | "outlettype" : [ "" ] 52 | } 53 | 54 | } 55 | , { 56 | "box" : { 57 | "maxclass" : "newobj", 58 | "text" : "prepend /1/label15", 59 | "fontsize" : 10.0, 60 | "numinlets" : 1, 61 | "numoutlets" : 1, 62 | "patching_rect" : [ 567.0, 342.0, 98.0, 18.0 ], 63 | "id" : "obj-80", 64 | "fontname" : "Arial Bold", 65 | "outlettype" : [ "" ] 66 | } 67 | 68 | } 69 | , { 70 | "box" : { 71 | "maxclass" : "comment", 72 | "text" : "Master tempo", 73 | "fontsize" : 10.0, 74 | "presentation_rect" : [ 196.0, 120.0, 74.0, 18.0 ], 75 | "numinlets" : 1, 76 | "numoutlets" : 0, 77 | "patching_rect" : [ 685.0, 226.0, 83.0, 18.0 ], 78 | "presentation" : 1, 79 | "id" : "obj-79", 80 | "fontname" : "Arial Bold" 81 | } 82 | 83 | } 84 | , { 85 | "box" : { 86 | "maxclass" : "message", 87 | "text" : "set $1", 88 | "fontsize" : 10.0, 89 | "numinlets" : 2, 90 | "numoutlets" : 1, 91 | "patching_rect" : [ 653.0, 209.0, 39.0, 16.0 ], 92 | "id" : "obj-75", 93 | "fontname" : "Arial Bold", 94 | "outlettype" : [ "" ] 95 | } 96 | 97 | } 98 | , { 99 | "box" : { 100 | "maxclass" : "flonum", 101 | "fontsize" : 10.0, 102 | "presentation_rect" : [ 145.0, 120.0, 50.0, 18.0 ], 103 | "numinlets" : 1, 104 | "numoutlets" : 2, 105 | "patching_rect" : [ 634.0, 226.0, 50.0, 18.0 ], 106 | "presentation" : 1, 107 | "id" : "obj-73", 108 | "fontname" : "Arial Bold", 109 | "outlettype" : [ "float", "bang" ] 110 | } 111 | 112 | } 113 | , { 114 | "box" : { 115 | "maxclass" : "newobj", 116 | "text" : "+ 0.", 117 | "fontsize" : 10.0, 118 | "numinlets" : 2, 119 | "numoutlets" : 1, 120 | "patching_rect" : [ 634.0, 251.0, 32.5, 18.0 ], 121 | "id" : "obj-68", 122 | "fontname" : "Arial Bold", 123 | "outlettype" : [ "float" ] 124 | } 125 | 126 | } 127 | , { 128 | "box" : { 129 | "maxclass" : "newobj", 130 | "text" : "loadmess 120.", 131 | "fontsize" : 10.0, 132 | "numinlets" : 1, 133 | "numoutlets" : 1, 134 | "patching_rect" : [ 580.0, 172.0, 79.0, 18.0 ], 135 | "id" : "obj-47", 136 | "fontname" : "Arial Bold", 137 | "outlettype" : [ "" ] 138 | } 139 | 140 | } 141 | , { 142 | "box" : { 143 | "maxclass" : "newobj", 144 | "text" : "t b f", 145 | "fontsize" : 10.0, 146 | "numinlets" : 1, 147 | "numoutlets" : 2, 148 | "patching_rect" : [ 690.0, 169.0, 32.5, 18.0 ], 149 | "id" : "obj-59", 150 | "fontname" : "Arial Bold", 151 | "outlettype" : [ "bang", "float" ] 152 | } 153 | 154 | } 155 | , { 156 | "box" : { 157 | "maxclass" : "message", 158 | "text" : "1", 159 | "fontsize" : 10.0, 160 | "numinlets" : 2, 161 | "numoutlets" : 1, 162 | "patching_rect" : [ 823.5, 132.0, 32.5, 16.0 ], 163 | "id" : "obj-55", 164 | "fontname" : "Arial Bold", 165 | "outlettype" : [ "" ] 166 | } 167 | 168 | } 169 | , { 170 | "box" : { 171 | "maxclass" : "message", 172 | "text" : "0.1", 173 | "fontsize" : 10.0, 174 | "numinlets" : 2, 175 | "numoutlets" : 1, 176 | "patching_rect" : [ 778.5, 132.0, 32.5, 16.0 ], 177 | "id" : "obj-54", 178 | "fontname" : "Arial Bold", 179 | "outlettype" : [ "" ] 180 | } 181 | 182 | } 183 | , { 184 | "box" : { 185 | "maxclass" : "message", 186 | "text" : "-0.1", 187 | "fontsize" : 10.0, 188 | "numinlets" : 2, 189 | "numoutlets" : 1, 190 | "patching_rect" : [ 733.5, 132.0, 32.5, 16.0 ], 191 | "id" : "obj-53", 192 | "fontname" : "Arial Bold", 193 | "outlettype" : [ "" ] 194 | } 195 | 196 | } 197 | , { 198 | "box" : { 199 | "maxclass" : "message", 200 | "text" : "-1", 201 | "fontsize" : 10.0, 202 | "numinlets" : 2, 203 | "numoutlets" : 1, 204 | "patching_rect" : [ 690.0, 132.0, 32.5, 16.0 ], 205 | "id" : "obj-52", 206 | "fontname" : "Arial Bold", 207 | "outlettype" : [ "" ] 208 | } 209 | 210 | } 211 | , { 212 | "box" : { 213 | "maxclass" : "comment", 214 | "text" : "When the patch loads, get the live_set id from the live.path object", 215 | "linecount" : 3, 216 | "fontsize" : 10.0, 217 | "numinlets" : 1, 218 | "numoutlets" : 0, 219 | "patching_rect" : [ 890.75, 196.0, 162.0, 41.0 ], 220 | "id" : "obj-34", 221 | "fontname" : "Arial Bold" 222 | } 223 | 224 | } 225 | , { 226 | "box" : { 227 | "maxclass" : "message", 228 | "text" : "path live_set", 229 | "fontsize" : 10.0, 230 | "numinlets" : 2, 231 | "numoutlets" : 1, 232 | "patching_rect" : [ 807.75, 196.0, 76.0, 16.0 ], 233 | "id" : "obj-35", 234 | "fontname" : "Arial", 235 | "outlettype" : [ "" ] 236 | } 237 | 238 | } 239 | , { 240 | "box" : { 241 | "maxclass" : "newobj", 242 | "text" : "t b l", 243 | "fontsize" : 10.0, 244 | "numinlets" : 1, 245 | "numoutlets" : 2, 246 | "patching_rect" : [ 834.75, 244.0, 38.5, 18.0 ], 247 | "id" : "obj-36", 248 | "fontname" : "Arial Bold", 249 | "outlettype" : [ "bang", "" ] 250 | } 251 | 252 | } 253 | , { 254 | "box" : { 255 | "maxclass" : "newobj", 256 | "text" : "live.path", 257 | "fontsize" : 10.0, 258 | "numinlets" : 1, 259 | "numoutlets" : 3, 260 | "patching_rect" : [ 807.75, 220.0, 73.0, 18.0 ], 261 | "id" : "obj-37", 262 | "fontname" : "Arial Bold", 263 | "outlettype" : [ "", "", "" ] 264 | } 265 | 266 | } 267 | , { 268 | "box" : { 269 | "maxclass" : "newobj", 270 | "text" : "loadbang", 271 | "fontsize" : 10.0, 272 | "numinlets" : 1, 273 | "numoutlets" : 1, 274 | "patching_rect" : [ 808.75, 158.0, 63.0, 18.0 ], 275 | "id" : "obj-38", 276 | "fontname" : "Arial Bold", 277 | "outlettype" : [ "bang" ] 278 | } 279 | 280 | } 281 | , { 282 | "box" : { 283 | "maxclass" : "newobj", 284 | "text" : "live.object", 285 | "fontsize" : 10.0, 286 | "numinlets" : 2, 287 | "numoutlets" : 1, 288 | "patching_rect" : [ 634.0, 312.0, 63.0, 18.0 ], 289 | "id" : "obj-39", 290 | "fontname" : "Arial Bold", 291 | "outlettype" : [ "" ], 292 | "saved_object_attributes" : { 293 | "_persistence" : 0 294 | } 295 | 296 | } 297 | 298 | } 299 | , { 300 | "box" : { 301 | "maxclass" : "message", 302 | "text" : "set tempo $1", 303 | "fontsize" : 10.0, 304 | "numinlets" : 2, 305 | "numoutlets" : 1, 306 | "patching_rect" : [ 634.0, 285.0, 74.0, 16.0 ], 307 | "id" : "obj-40", 308 | "fontname" : "Arial", 309 | "outlettype" : [ "" ] 310 | } 311 | 312 | } 313 | , { 314 | "box" : { 315 | "maxclass" : "live.text", 316 | "varname" : "live.text[4]", 317 | "activebgcolor" : [ 0.0, 0.529412, 0.039461, 1.0 ], 318 | "fontsize" : 14.0, 319 | "mode" : 0, 320 | "activetextcolor" : [ 0.0, 1.0, 0.116845, 1.0 ], 321 | "presentation_rect" : [ 81.5, 134.0, 54.0, 27.0 ], 322 | "text" : "-0.10", 323 | "numinlets" : 1, 324 | "numoutlets" : 2, 325 | "patching_rect" : [ 733.5, 105.0, 40.0, 20.0 ], 326 | "bordercolor" : [ 0.0, 0.317647, 0.076774, 1.0 ], 327 | "presentation" : 1, 328 | "id" : "obj-29", 329 | "parameter_enable" : 1, 330 | "outlettype" : [ "", "" ], 331 | "saved_attribute_attributes" : { 332 | "valueof" : { 333 | "parameter_mmin" : 0.0, 334 | "parameter_type" : 2, 335 | "parameter_initial_enable" : 0, 336 | "parameter_shortname" : "Stop", 337 | "parameter_modmax" : 127.0, 338 | "parameter_longname" : "Stop[6]", 339 | "parameter_modmin" : 0.0, 340 | "parameter_linknames" : 0, 341 | "parameter_modmode" : 0, 342 | "parameter_info" : "", 343 | "parameter_units" : "", 344 | "parameter_order" : 0, 345 | "parameter_defer" : 0, 346 | "parameter_speedlim" : 1.0, 347 | "parameter_invisible" : 0, 348 | "parameter_steps" : 0, 349 | "parameter_annotation_name" : "", 350 | "parameter_enum" : [ "val1", "val2" ], 351 | "parameter_exponent" : 1.0, 352 | "parameter_unitstyle" : 10, 353 | "parameter_mmax" : 1.0 354 | } 355 | 356 | } 357 | 358 | } 359 | 360 | } 361 | , { 362 | "box" : { 363 | "maxclass" : "live.text", 364 | "varname" : "live.text[5]", 365 | "activebgcolor" : [ 0.0, 0.529412, 0.039461, 1.0 ], 366 | "fontsize" : 14.0, 367 | "mode" : 0, 368 | "activetextcolor" : [ 0.0, 1.0, 0.116845, 1.0 ], 369 | "presentation_rect" : [ 81.5, 99.0, 54.0, 27.0 ], 370 | "text" : "+0.10", 371 | "numinlets" : 1, 372 | "numoutlets" : 2, 373 | "patching_rect" : [ 778.5, 105.0, 40.0, 20.0 ], 374 | "bordercolor" : [ 0.0, 0.317647, 0.076774, 1.0 ], 375 | "presentation" : 1, 376 | "id" : "obj-28", 377 | "parameter_enable" : 1, 378 | "outlettype" : [ "", "" ], 379 | "saved_attribute_attributes" : { 380 | "valueof" : { 381 | "parameter_mmin" : 0.0, 382 | "parameter_type" : 2, 383 | "parameter_initial_enable" : 0, 384 | "parameter_shortname" : "live.text", 385 | "parameter_modmax" : 127.0, 386 | "parameter_longname" : "live.text", 387 | "parameter_modmin" : 0.0, 388 | "parameter_linknames" : 0, 389 | "parameter_modmode" : 0, 390 | "parameter_info" : "", 391 | "parameter_units" : "", 392 | "parameter_order" : 0, 393 | "parameter_defer" : 0, 394 | "parameter_speedlim" : 1.0, 395 | "parameter_invisible" : 0, 396 | "parameter_steps" : 0, 397 | "parameter_annotation_name" : "", 398 | "parameter_enum" : [ "val1", "val2" ], 399 | "parameter_exponent" : 1.0, 400 | "parameter_unitstyle" : 10, 401 | "parameter_mmax" : 1.0 402 | } 403 | 404 | } 405 | 406 | } 407 | 408 | } 409 | , { 410 | "box" : { 411 | "maxclass" : "live.text", 412 | "varname" : "live.text[3]", 413 | "activebgcolor" : [ 0.604492, 0.070906, 0.0, 1.0 ], 414 | "fontsize" : 14.0, 415 | "mode" : 0, 416 | "activetextcolor" : [ 1.0, 0.047119, 0.0, 1.0 ], 417 | "presentation_rect" : [ 19.0, 134.0, 54.0, 27.0 ], 418 | "text" : "-1", 419 | "numinlets" : 1, 420 | "numoutlets" : 2, 421 | "patching_rect" : [ 689.5, 105.0, 40.0, 20.0 ], 422 | "bordercolor" : [ 0.317647, 0.0, 0.0, 1.0 ], 423 | "presentation" : 1, 424 | "id" : "obj-30", 425 | "parameter_enable" : 1, 426 | "outlettype" : [ "", "" ], 427 | "saved_attribute_attributes" : { 428 | "valueof" : { 429 | "parameter_mmin" : 0.0, 430 | "parameter_type" : 2, 431 | "parameter_initial_enable" : 0, 432 | "parameter_shortname" : "Stop", 433 | "parameter_modmax" : 127.0, 434 | "parameter_longname" : "Stop[3]", 435 | "parameter_modmin" : 0.0, 436 | "parameter_linknames" : 0, 437 | "parameter_modmode" : 0, 438 | "parameter_info" : "", 439 | "parameter_units" : "", 440 | "parameter_order" : 0, 441 | "parameter_defer" : 0, 442 | "parameter_speedlim" : 1.0, 443 | "parameter_invisible" : 0, 444 | "parameter_steps" : 0, 445 | "parameter_annotation_name" : "", 446 | "parameter_enum" : [ "val1", "val2" ], 447 | "parameter_exponent" : 1.0, 448 | "parameter_unitstyle" : 10, 449 | "parameter_mmax" : 1.0 450 | } 451 | 452 | } 453 | 454 | } 455 | 456 | } 457 | , { 458 | "box" : { 459 | "maxclass" : "live.text", 460 | "varname" : "live.text[2]", 461 | "activebgcolor" : [ 0.604492, 0.070906, 0.0, 1.0 ], 462 | "fontsize" : 14.0, 463 | "mode" : 0, 464 | "activetextcolor" : [ 1.0, 0.047119, 0.0, 1.0 ], 465 | "presentation_rect" : [ 19.0, 99.0, 54.0, 27.0 ], 466 | "text" : "+1", 467 | "numinlets" : 1, 468 | "numoutlets" : 2, 469 | "patching_rect" : [ 823.5, 105.0, 40.0, 20.0 ], 470 | "bordercolor" : [ 0.317647, 0.0, 0.0, 1.0 ], 471 | "presentation" : 1, 472 | "id" : "obj-33", 473 | "parameter_enable" : 1, 474 | "outlettype" : [ "", "" ], 475 | "saved_attribute_attributes" : { 476 | "valueof" : { 477 | "parameter_mmin" : 0.0, 478 | "parameter_type" : 2, 479 | "parameter_initial_enable" : 0, 480 | "parameter_shortname" : "Stop", 481 | "parameter_modmax" : 127.0, 482 | "parameter_longname" : "Stop[2]", 483 | "parameter_modmin" : 0.0, 484 | "parameter_linknames" : 0, 485 | "parameter_modmode" : 0, 486 | "parameter_info" : "", 487 | "parameter_units" : "", 488 | "parameter_order" : 0, 489 | "parameter_defer" : 0, 490 | "parameter_speedlim" : 1.0, 491 | "parameter_invisible" : 0, 492 | "parameter_steps" : 0, 493 | "parameter_annotation_name" : "", 494 | "parameter_enum" : [ "val1", "val2" ], 495 | "parameter_exponent" : 1.0, 496 | "parameter_unitstyle" : 10, 497 | "parameter_mmax" : 1.0 498 | } 499 | 500 | } 501 | 502 | } 503 | 504 | } 505 | , { 506 | "box" : { 507 | "maxclass" : "message", 508 | "text" : "\"Feel It All Around\"", 509 | "fontsize" : 10.0, 510 | "numinlets" : 2, 511 | "numoutlets" : 1, 512 | "patching_rect" : [ 392.0, 227.0, 109.0, 16.0 ], 513 | "id" : "obj-24", 514 | "fontname" : "Arial Bold", 515 | "outlettype" : [ "" ] 516 | } 517 | 518 | } 519 | , { 520 | "box" : { 521 | "maxclass" : "message", 522 | "text" : "\"Washed Out\"", 523 | "fontsize" : 10.0, 524 | "numinlets" : 2, 525 | "numoutlets" : 1, 526 | "patching_rect" : [ 286.0, 228.0, 95.0, 16.0 ], 527 | "id" : "obj-26", 528 | "fontname" : "Arial Bold", 529 | "outlettype" : [ "" ] 530 | } 531 | 532 | } 533 | , { 534 | "box" : { 535 | "maxclass" : "message", 536 | "text" : "\"Maputo Jam\"", 537 | "fontsize" : 10.0, 538 | "numinlets" : 2, 539 | "numoutlets" : 1, 540 | "patching_rect" : [ 363.0, 207.0, 109.0, 16.0 ], 541 | "id" : "obj-27", 542 | "fontname" : "Arial Bold", 543 | "outlettype" : [ "" ] 544 | } 545 | 546 | } 547 | , { 548 | "box" : { 549 | "maxclass" : "message", 550 | "text" : "Cuthead", 551 | "fontsize" : 10.0, 552 | "numinlets" : 2, 553 | "numoutlets" : 1, 554 | "patching_rect" : [ 257.0, 208.0, 95.0, 16.0 ], 555 | "id" : "obj-25", 556 | "fontname" : "Arial Bold", 557 | "outlettype" : [ "" ] 558 | } 559 | 560 | } 561 | , { 562 | "box" : { 563 | "maxclass" : "newobj", 564 | "text" : "prepend /1/label13", 565 | "fontsize" : 10.0, 566 | "numinlets" : 1, 567 | "numoutlets" : 1, 568 | "patching_rect" : [ 439.0, 158.0, 98.0, 18.0 ], 569 | "id" : "obj-18", 570 | "fontname" : "Arial Bold", 571 | "outlettype" : [ "" ] 572 | } 573 | 574 | } 575 | , { 576 | "box" : { 577 | "maxclass" : "newobj", 578 | "text" : "prepend /1/label11", 579 | "fontsize" : 10.0, 580 | "numinlets" : 1, 581 | "numoutlets" : 1, 582 | "patching_rect" : [ 422.0, 139.0, 97.0, 18.0 ], 583 | "id" : "obj-20", 584 | "fontname" : "Arial Bold", 585 | "outlettype" : [ "" ] 586 | } 587 | 588 | } 589 | , { 590 | "box" : { 591 | "maxclass" : "newobj", 592 | "text" : "route 0 1", 593 | "fontsize" : 10.0, 594 | "numinlets" : 1, 595 | "numoutlets" : 3, 596 | "patching_rect" : [ 422.0, 113.0, 52.0, 18.0 ], 597 | "id" : "obj-21", 598 | "fontname" : "Arial Bold", 599 | "outlettype" : [ "", "", "" ] 600 | } 601 | 602 | } 603 | , { 604 | "box" : { 605 | "maxclass" : "newobj", 606 | "text" : "r title", 607 | "fontsize" : 10.0, 608 | "numinlets" : 0, 609 | "numoutlets" : 1, 610 | "patching_rect" : [ 422.0, 90.0, 35.0, 18.0 ], 611 | "id" : "obj-22", 612 | "fontname" : "Arial Bold", 613 | "outlettype" : [ "" ] 614 | } 615 | 616 | } 617 | , { 618 | "box" : { 619 | "maxclass" : "newobj", 620 | "text" : "prepend /1/label14", 621 | "fontsize" : 10.0, 622 | "numinlets" : 1, 623 | "numoutlets" : 1, 624 | "patching_rect" : [ 320.0, 158.0, 98.0, 18.0 ], 625 | "id" : "obj-13", 626 | "fontname" : "Arial Bold", 627 | "outlettype" : [ "" ] 628 | } 629 | 630 | } 631 | , { 632 | "box" : { 633 | "maxclass" : "newobj", 634 | "text" : "prepend /1/label12", 635 | "fontsize" : 10.0, 636 | "numinlets" : 1, 637 | "numoutlets" : 1, 638 | "patching_rect" : [ 303.0, 139.0, 98.0, 18.0 ], 639 | "id" : "obj-14", 640 | "fontname" : "Arial Bold", 641 | "outlettype" : [ "" ] 642 | } 643 | 644 | } 645 | , { 646 | "box" : { 647 | "maxclass" : "newobj", 648 | "text" : "route 0 1", 649 | "fontsize" : 10.0, 650 | "numinlets" : 1, 651 | "numoutlets" : 3, 652 | "patching_rect" : [ 303.0, 113.0, 52.0, 18.0 ], 653 | "id" : "obj-15", 654 | "fontname" : "Arial Bold", 655 | "outlettype" : [ "", "", "" ] 656 | } 657 | 658 | } 659 | , { 660 | "box" : { 661 | "maxclass" : "newobj", 662 | "text" : "r artist", 663 | "fontsize" : 10.0, 664 | "numinlets" : 0, 665 | "numoutlets" : 1, 666 | "patching_rect" : [ 303.0, 90.0, 42.0, 18.0 ], 667 | "id" : "obj-16", 668 | "fontname" : "Arial Bold", 669 | "outlettype" : [ "" ] 670 | } 671 | 672 | } 673 | , { 674 | "box" : { 675 | "maxclass" : "newobj", 676 | "text" : "prepend /1/tempo-1", 677 | "fontsize" : 10.0, 678 | "numinlets" : 1, 679 | "numoutlets" : 1, 680 | "patching_rect" : [ 127.0, 152.0, 103.0, 18.0 ], 681 | "id" : "obj-8", 682 | "fontname" : "Arial Bold", 683 | "outlettype" : [ "" ] 684 | } 685 | 686 | } 687 | , { 688 | "box" : { 689 | "maxclass" : "newobj", 690 | "text" : "prepend /1/tempo-0", 691 | "fontsize" : 10.0, 692 | "numinlets" : 1, 693 | "numoutlets" : 1, 694 | "patching_rect" : [ 110.0, 133.0, 103.0, 18.0 ], 695 | "id" : "obj-7", 696 | "fontname" : "Arial Bold", 697 | "outlettype" : [ "" ] 698 | } 699 | 700 | } 701 | , { 702 | "box" : { 703 | "maxclass" : "comment", 704 | "text" : "iPad port", 705 | "fontsize" : 10.0, 706 | "presentation_rect" : [ 111.0, 29.0, 63.0, 18.0 ], 707 | "numinlets" : 1, 708 | "numoutlets" : 0, 709 | "patching_rect" : [ 327.0, 61.0, 88.0, 18.0 ], 710 | "presentation" : 1, 711 | "id" : "obj-12", 712 | "fontname" : "Arial Bold" 713 | } 714 | 715 | } 716 | , { 717 | "box" : { 718 | "maxclass" : "message", 719 | "text" : "port $1", 720 | "fontsize" : 10.0, 721 | "numinlets" : 2, 722 | "numoutlets" : 1, 723 | "patching_rect" : [ 246.0, 83.0, 44.0, 16.0 ], 724 | "id" : "obj-9", 725 | "fontname" : "Arial Bold", 726 | "outlettype" : [ "" ] 727 | } 728 | 729 | } 730 | , { 731 | "box" : { 732 | "maxclass" : "newobj", 733 | "text" : "loadmess 5001", 734 | "fontsize" : 10.0, 735 | "presentation_rect" : [ 18.0, 29.0, 82.0, 18.0 ], 736 | "numinlets" : 1, 737 | "numoutlets" : 1, 738 | "patching_rect" : [ 246.0, 61.0, 82.0, 18.0 ], 739 | "presentation" : 1, 740 | "id" : "obj-10", 741 | "fontname" : "Arial Bold", 742 | "outlettype" : [ "" ] 743 | } 744 | 745 | } 746 | , { 747 | "box" : { 748 | "maxclass" : "comment", 749 | "text" : "iPad IP", 750 | "fontsize" : 10.0, 751 | "presentation_rect" : [ 159.0, 6.0, 51.0, 18.0 ], 752 | "numinlets" : 1, 753 | "numoutlets" : 0, 754 | "patching_rect" : [ 305.0, 28.0, 43.0, 18.0 ], 755 | "presentation" : 1, 756 | "id" : "obj-23", 757 | "fontname" : "Arial Bold" 758 | } 759 | 760 | } 761 | , { 762 | "box" : { 763 | "maxclass" : "message", 764 | "text" : "host $1", 765 | "fontsize" : 10.0, 766 | "numinlets" : 2, 767 | "numoutlets" : 1, 768 | "patching_rect" : [ 166.0, 50.0, 46.0, 16.0 ], 769 | "id" : "obj-19", 770 | "fontname" : "Arial Bold", 771 | "outlettype" : [ "" ] 772 | } 773 | 774 | } 775 | , { 776 | "box" : { 777 | "maxclass" : "newobj", 778 | "text" : "loadmess 192.168.192.98", 779 | "fontsize" : 10.0, 780 | "presentation_rect" : [ 18.0, 6.0, 129.0, 18.0 ], 781 | "numinlets" : 1, 782 | "numoutlets" : 1, 783 | "patching_rect" : [ 166.0, 28.0, 129.0, 18.0 ], 784 | "presentation" : 1, 785 | "id" : "obj-17", 786 | "fontname" : "Arial Bold", 787 | "outlettype" : [ "" ] 788 | } 789 | 790 | } 791 | , { 792 | "box" : { 793 | "maxclass" : "comment", 794 | "text" : "Tempo 1", 795 | "fontsize" : 10.0, 796 | "presentation_rect" : [ 118.0, 78.0, 55.0, 18.0 ], 797 | "numinlets" : 1, 798 | "numoutlets" : 0, 799 | "patching_rect" : [ 179.0, 100.0, 60.0, 18.0 ], 800 | "presentation" : 1, 801 | "id" : "obj-32", 802 | "fontname" : "Arial Bold" 803 | } 804 | 805 | } 806 | , { 807 | "box" : { 808 | "maxclass" : "comment", 809 | "text" : "Tempo 0", 810 | "fontsize" : 10.0, 811 | "presentation_rect" : [ 118.0, 56.0, 55.0, 18.0 ], 812 | "numinlets" : 1, 813 | "numoutlets" : 0, 814 | "patching_rect" : [ 179.0, 80.0, 60.0, 18.0 ], 815 | "presentation" : 1, 816 | "id" : "obj-31", 817 | "fontname" : "Arial Bold" 818 | } 819 | 820 | } 821 | , { 822 | "box" : { 823 | "maxclass" : "newobj", 824 | "text" : "route 0 1", 825 | "fontsize" : 10.0, 826 | "numinlets" : 1, 827 | "numoutlets" : 3, 828 | "patching_rect" : [ 110.0, 51.0, 52.0, 18.0 ], 829 | "id" : "obj-5", 830 | "fontname" : "Arial Bold", 831 | "outlettype" : [ "", "", "" ] 832 | } 833 | 834 | } 835 | , { 836 | "box" : { 837 | "maxclass" : "message", 838 | "fontsize" : 10.0, 839 | "presentation_rect" : [ 18.0, 78.0, 96.0, 16.0 ], 840 | "numinlets" : 2, 841 | "numoutlets" : 1, 842 | "patching_rect" : [ 124.0, 100.0, 50.0, 16.0 ], 843 | "presentation" : 1, 844 | "id" : "obj-11", 845 | "fontname" : "Arial Bold", 846 | "outlettype" : [ "" ] 847 | } 848 | 849 | } 850 | , { 851 | "box" : { 852 | "maxclass" : "message", 853 | "text" : "119.997002", 854 | "linecount" : 2, 855 | "fontsize" : 10.0, 856 | "presentation_rect" : [ 18.0, 56.0, 96.0, 16.0 ], 857 | "numinlets" : 2, 858 | "numoutlets" : 1, 859 | "patching_rect" : [ 124.0, 80.0, 50.0, 27.0 ], 860 | "presentation" : 1, 861 | "id" : "obj-6", 862 | "fontname" : "Arial Bold", 863 | "outlettype" : [ "" ] 864 | } 865 | 866 | } 867 | , { 868 | "box" : { 869 | "maxclass" : "newobj", 870 | "text" : "udpsend localhost 5001", 871 | "fontsize" : 10.0, 872 | "numinlets" : 1, 873 | "numoutlets" : 0, 874 | "patching_rect" : [ 110.0, 173.0, 124.0, 18.0 ], 875 | "id" : "obj-4", 876 | "fontname" : "Arial Bold" 877 | } 878 | 879 | } 880 | , { 881 | "box" : { 882 | "maxclass" : "newobj", 883 | "text" : "r tempi", 884 | "fontsize" : 10.0, 885 | "numinlets" : 0, 886 | "numoutlets" : 1, 887 | "patching_rect" : [ 110.0, 28.0, 44.0, 18.0 ], 888 | "id" : "obj-3", 889 | "fontname" : "Arial Bold", 890 | "outlettype" : [ "" ] 891 | } 892 | 893 | } 894 | , { 895 | "box" : { 896 | "maxclass" : "newobj", 897 | "text" : "plugout~", 898 | "fontsize" : 10.0, 899 | "numinlets" : 2, 900 | "numoutlets" : 2, 901 | "patching_rect" : [ 48.0, 112.0, 53.0, 18.0 ], 902 | "id" : "obj-2", 903 | "fontname" : "Arial Bold", 904 | "outlettype" : [ "signal", "signal" ] 905 | } 906 | 907 | } 908 | , { 909 | "box" : { 910 | "maxclass" : "newobj", 911 | "text" : "plugin~", 912 | "fontsize" : 10.0, 913 | "numinlets" : 2, 914 | "numoutlets" : 2, 915 | "patching_rect" : [ 48.0, 32.0, 53.0, 18.0 ], 916 | "id" : "obj-1", 917 | "fontname" : "Arial Bold", 918 | "outlettype" : [ "signal", "signal" ] 919 | } 920 | 921 | } 922 | ], 923 | "lines" : [ { 924 | "patchline" : { 925 | "source" : [ "obj-17", 0 ], 926 | "destination" : [ "obj-19", 0 ], 927 | "hidden" : 0, 928 | "midpoints" : [ ] 929 | } 930 | 931 | } 932 | , { 933 | "patchline" : { 934 | "source" : [ "obj-68", 0 ], 935 | "destination" : [ "obj-42", 0 ], 936 | "hidden" : 0, 937 | "midpoints" : [ ] 938 | } 939 | 940 | } 941 | , { 942 | "patchline" : { 943 | "source" : [ "obj-42", 0 ], 944 | "destination" : [ "obj-80", 0 ], 945 | "hidden" : 0, 946 | "midpoints" : [ ] 947 | } 948 | 949 | } 950 | , { 951 | "patchline" : { 952 | "source" : [ "obj-21", 1 ], 953 | "destination" : [ "obj-24", 1 ], 954 | "hidden" : 0, 955 | "midpoints" : [ ] 956 | } 957 | 958 | } 959 | , { 960 | "patchline" : { 961 | "source" : [ "obj-15", 1 ], 962 | "destination" : [ "obj-26", 1 ], 963 | "hidden" : 0, 964 | "midpoints" : [ ] 965 | } 966 | 967 | } 968 | , { 969 | "patchline" : { 970 | "source" : [ "obj-18", 0 ], 971 | "destination" : [ "obj-4", 0 ], 972 | "hidden" : 0, 973 | "midpoints" : [ ] 974 | } 975 | 976 | } 977 | , { 978 | "patchline" : { 979 | "source" : [ "obj-20", 0 ], 980 | "destination" : [ "obj-4", 0 ], 981 | "hidden" : 0, 982 | "midpoints" : [ ] 983 | } 984 | 985 | } 986 | , { 987 | "patchline" : { 988 | "source" : [ "obj-13", 0 ], 989 | "destination" : [ "obj-4", 0 ], 990 | "hidden" : 0, 991 | "midpoints" : [ ] 992 | } 993 | 994 | } 995 | , { 996 | "patchline" : { 997 | "source" : [ "obj-14", 0 ], 998 | "destination" : [ "obj-4", 0 ], 999 | "hidden" : 0, 1000 | "midpoints" : [ ] 1001 | } 1002 | 1003 | } 1004 | , { 1005 | "patchline" : { 1006 | "source" : [ "obj-21", 1 ], 1007 | "destination" : [ "obj-18", 0 ], 1008 | "hidden" : 0, 1009 | "midpoints" : [ ] 1010 | } 1011 | 1012 | } 1013 | , { 1014 | "patchline" : { 1015 | "source" : [ "obj-15", 1 ], 1016 | "destination" : [ "obj-13", 0 ], 1017 | "hidden" : 0, 1018 | "midpoints" : [ ] 1019 | } 1020 | 1021 | } 1022 | , { 1023 | "patchline" : { 1024 | "source" : [ "obj-21", 0 ], 1025 | "destination" : [ "obj-20", 0 ], 1026 | "hidden" : 0, 1027 | "midpoints" : [ ] 1028 | } 1029 | 1030 | } 1031 | , { 1032 | "patchline" : { 1033 | "source" : [ "obj-15", 0 ], 1034 | "destination" : [ "obj-14", 0 ], 1035 | "hidden" : 0, 1036 | "midpoints" : [ ] 1037 | } 1038 | 1039 | } 1040 | , { 1041 | "patchline" : { 1042 | "source" : [ "obj-22", 0 ], 1043 | "destination" : [ "obj-21", 0 ], 1044 | "hidden" : 0, 1045 | "midpoints" : [ ] 1046 | } 1047 | 1048 | } 1049 | , { 1050 | "patchline" : { 1051 | "source" : [ "obj-16", 0 ], 1052 | "destination" : [ "obj-15", 0 ], 1053 | "hidden" : 0, 1054 | "midpoints" : [ ] 1055 | } 1056 | 1057 | } 1058 | , { 1059 | "patchline" : { 1060 | "source" : [ "obj-10", 0 ], 1061 | "destination" : [ "obj-9", 0 ], 1062 | "hidden" : 0, 1063 | "midpoints" : [ ] 1064 | } 1065 | 1066 | } 1067 | , { 1068 | "patchline" : { 1069 | "source" : [ "obj-19", 0 ], 1070 | "destination" : [ "obj-4", 0 ], 1071 | "hidden" : 0, 1072 | "midpoints" : [ ] 1073 | } 1074 | 1075 | } 1076 | , { 1077 | "patchline" : { 1078 | "source" : [ "obj-5", 1 ], 1079 | "destination" : [ "obj-11", 1 ], 1080 | "hidden" : 0, 1081 | "midpoints" : [ ] 1082 | } 1083 | 1084 | } 1085 | , { 1086 | "patchline" : { 1087 | "source" : [ "obj-5", 0 ], 1088 | "destination" : [ "obj-6", 1 ], 1089 | "hidden" : 0, 1090 | "midpoints" : [ ] 1091 | } 1092 | 1093 | } 1094 | , { 1095 | "patchline" : { 1096 | "source" : [ "obj-3", 0 ], 1097 | "destination" : [ "obj-5", 0 ], 1098 | "hidden" : 0, 1099 | "midpoints" : [ ] 1100 | } 1101 | 1102 | } 1103 | , { 1104 | "patchline" : { 1105 | "source" : [ "obj-1", 1 ], 1106 | "destination" : [ "obj-2", 1 ], 1107 | "hidden" : 0, 1108 | "midpoints" : [ ] 1109 | } 1110 | 1111 | } 1112 | , { 1113 | "patchline" : { 1114 | "source" : [ "obj-1", 0 ], 1115 | "destination" : [ "obj-2", 0 ], 1116 | "hidden" : 0, 1117 | "midpoints" : [ ] 1118 | } 1119 | 1120 | } 1121 | , { 1122 | "patchline" : { 1123 | "source" : [ "obj-9", 0 ], 1124 | "destination" : [ "obj-4", 0 ], 1125 | "hidden" : 0, 1126 | "midpoints" : [ ] 1127 | } 1128 | 1129 | } 1130 | , { 1131 | "patchline" : { 1132 | "source" : [ "obj-5", 0 ], 1133 | "destination" : [ "obj-7", 0 ], 1134 | "hidden" : 0, 1135 | "midpoints" : [ ] 1136 | } 1137 | 1138 | } 1139 | , { 1140 | "patchline" : { 1141 | "source" : [ "obj-7", 0 ], 1142 | "destination" : [ "obj-4", 0 ], 1143 | "hidden" : 0, 1144 | "midpoints" : [ ] 1145 | } 1146 | 1147 | } 1148 | , { 1149 | "patchline" : { 1150 | "source" : [ "obj-8", 0 ], 1151 | "destination" : [ "obj-4", 0 ], 1152 | "hidden" : 0, 1153 | "midpoints" : [ ] 1154 | } 1155 | 1156 | } 1157 | , { 1158 | "patchline" : { 1159 | "source" : [ "obj-5", 1 ], 1160 | "destination" : [ "obj-8", 0 ], 1161 | "hidden" : 0, 1162 | "midpoints" : [ ] 1163 | } 1164 | 1165 | } 1166 | , { 1167 | "patchline" : { 1168 | "source" : [ "obj-15", 0 ], 1169 | "destination" : [ "obj-25", 1 ], 1170 | "hidden" : 0, 1171 | "midpoints" : [ ] 1172 | } 1173 | 1174 | } 1175 | , { 1176 | "patchline" : { 1177 | "source" : [ "obj-21", 0 ], 1178 | "destination" : [ "obj-27", 1 ], 1179 | "hidden" : 0, 1180 | "midpoints" : [ ] 1181 | } 1182 | 1183 | } 1184 | , { 1185 | "patchline" : { 1186 | "source" : [ "obj-40", 0 ], 1187 | "destination" : [ "obj-39", 0 ], 1188 | "hidden" : 0, 1189 | "midpoints" : [ 643.5, 301.0, 643.5, 301.0 ] 1190 | } 1191 | 1192 | } 1193 | , { 1194 | "patchline" : { 1195 | "source" : [ "obj-35", 0 ], 1196 | "destination" : [ "obj-37", 0 ], 1197 | "hidden" : 0, 1198 | "midpoints" : [ ] 1199 | } 1200 | 1201 | } 1202 | , { 1203 | "patchline" : { 1204 | "source" : [ "obj-36", 1 ], 1205 | "destination" : [ "obj-39", 1 ], 1206 | "hidden" : 0, 1207 | "midpoints" : [ ] 1208 | } 1209 | 1210 | } 1211 | , { 1212 | "patchline" : { 1213 | "source" : [ "obj-36", 0 ], 1214 | "destination" : [ "obj-39", 0 ], 1215 | "hidden" : 0, 1216 | "midpoints" : [ ] 1217 | } 1218 | 1219 | } 1220 | , { 1221 | "patchline" : { 1222 | "source" : [ "obj-37", 1 ], 1223 | "destination" : [ "obj-36", 0 ], 1224 | "hidden" : 0, 1225 | "midpoints" : [ ] 1226 | } 1227 | 1228 | } 1229 | , { 1230 | "patchline" : { 1231 | "source" : [ "obj-30", 0 ], 1232 | "destination" : [ "obj-52", 0 ], 1233 | "hidden" : 0, 1234 | "midpoints" : [ ] 1235 | } 1236 | 1237 | } 1238 | , { 1239 | "patchline" : { 1240 | "source" : [ "obj-29", 0 ], 1241 | "destination" : [ "obj-53", 0 ], 1242 | "hidden" : 0, 1243 | "midpoints" : [ ] 1244 | } 1245 | 1246 | } 1247 | , { 1248 | "patchline" : { 1249 | "source" : [ "obj-28", 0 ], 1250 | "destination" : [ "obj-54", 0 ], 1251 | "hidden" : 0, 1252 | "midpoints" : [ ] 1253 | } 1254 | 1255 | } 1256 | , { 1257 | "patchline" : { 1258 | "source" : [ "obj-33", 0 ], 1259 | "destination" : [ "obj-55", 0 ], 1260 | "hidden" : 0, 1261 | "midpoints" : [ ] 1262 | } 1263 | 1264 | } 1265 | , { 1266 | "patchline" : { 1267 | "source" : [ "obj-52", 0 ], 1268 | "destination" : [ "obj-59", 0 ], 1269 | "hidden" : 0, 1270 | "midpoints" : [ ] 1271 | } 1272 | 1273 | } 1274 | , { 1275 | "patchline" : { 1276 | "source" : [ "obj-53", 0 ], 1277 | "destination" : [ "obj-59", 0 ], 1278 | "hidden" : 0, 1279 | "midpoints" : [ ] 1280 | } 1281 | 1282 | } 1283 | , { 1284 | "patchline" : { 1285 | "source" : [ "obj-54", 0 ], 1286 | "destination" : [ "obj-59", 0 ], 1287 | "hidden" : 0, 1288 | "midpoints" : [ ] 1289 | } 1290 | 1291 | } 1292 | , { 1293 | "patchline" : { 1294 | "source" : [ "obj-55", 0 ], 1295 | "destination" : [ "obj-59", 0 ], 1296 | "hidden" : 0, 1297 | "midpoints" : [ ] 1298 | } 1299 | 1300 | } 1301 | , { 1302 | "patchline" : { 1303 | "source" : [ "obj-73", 0 ], 1304 | "destination" : [ "obj-68", 0 ], 1305 | "hidden" : 0, 1306 | "midpoints" : [ ] 1307 | } 1308 | 1309 | } 1310 | , { 1311 | "patchline" : { 1312 | "source" : [ "obj-75", 0 ], 1313 | "destination" : [ "obj-73", 0 ], 1314 | "hidden" : 0, 1315 | "midpoints" : [ ] 1316 | } 1317 | 1318 | } 1319 | , { 1320 | "patchline" : { 1321 | "source" : [ "obj-47", 0 ], 1322 | "destination" : [ "obj-73", 0 ], 1323 | "hidden" : 0, 1324 | "midpoints" : [ ] 1325 | } 1326 | 1327 | } 1328 | , { 1329 | "patchline" : { 1330 | "source" : [ "obj-68", 0 ], 1331 | "destination" : [ "obj-75", 0 ], 1332 | "hidden" : 0, 1333 | "midpoints" : [ ] 1334 | } 1335 | 1336 | } 1337 | , { 1338 | "patchline" : { 1339 | "source" : [ "obj-59", 0 ], 1340 | "destination" : [ "obj-73", 0 ], 1341 | "hidden" : 0, 1342 | "midpoints" : [ ] 1343 | } 1344 | 1345 | } 1346 | , { 1347 | "patchline" : { 1348 | "source" : [ "obj-59", 1 ], 1349 | "destination" : [ "obj-68", 1 ], 1350 | "hidden" : 0, 1351 | "midpoints" : [ ] 1352 | } 1353 | 1354 | } 1355 | , { 1356 | "patchline" : { 1357 | "source" : [ "obj-68", 0 ], 1358 | "destination" : [ "obj-40", 0 ], 1359 | "hidden" : 0, 1360 | "midpoints" : [ ] 1361 | } 1362 | 1363 | } 1364 | , { 1365 | "patchline" : { 1366 | "source" : [ "obj-80", 0 ], 1367 | "destination" : [ "obj-4", 0 ], 1368 | "hidden" : 0, 1369 | "midpoints" : [ ] 1370 | } 1371 | 1372 | } 1373 | , { 1374 | "patchline" : { 1375 | "source" : [ "obj-38", 0 ], 1376 | "destination" : [ "obj-41", 0 ], 1377 | "hidden" : 0, 1378 | "midpoints" : [ ] 1379 | } 1380 | 1381 | } 1382 | , { 1383 | "patchline" : { 1384 | "source" : [ "obj-41", 0 ], 1385 | "destination" : [ "obj-35", 0 ], 1386 | "hidden" : 0, 1387 | "midpoints" : [ ] 1388 | } 1389 | 1390 | } 1391 | ], 1392 | "parameters" : { 1393 | "obj-30" : [ "Stop[3]", "Stop", 0 ], 1394 | "obj-33" : [ "Stop[2]", "Stop", 0 ], 1395 | "obj-29" : [ "Stop[6]", "Stop", 0 ], 1396 | "obj-28" : [ "live.text", "live.text", 0 ] 1397 | } 1398 | , 1399 | "latency" : 0 1400 | } 1401 | 1402 | } 1403 | -------------------------------------------------------------------------------- /Ableton+M4L/Stream-Pitch.amxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactify/dj-spotify/df925b6e963e63b139839d30489c20e4ef348cc1/Ableton+M4L/Stream-Pitch.amxd -------------------------------------------------------------------------------- /Applescripts/Rules.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactify/dj-spotify/df925b6e963e63b139839d30489c20e4ef348cc1/Applescripts/Rules.scpt -------------------------------------------------------------------------------- /Pd/Soundflower-re-route.pd: -------------------------------------------------------------------------------- 1 | #N canvas 1 165 391 90 10; 2 | #X obj 24 23 adc~; 3 | #X obj 24 54 dac~ 3 4; 4 | #X text 89 52 // Out to channels 3-4 of Soundflower (64ch); 5 | #X text 89 21 // In from Soundflower (2ch); 6 | #X connect 0 0 1 0; 7 | #X connect 0 1 1 1; 8 | -------------------------------------------------------------------------------- /Python/getTempoAndKey.py: -------------------------------------------------------------------------------- 1 | from appscript import * 2 | import OSC 3 | 4 | port = 8070 5 | 6 | from pyechonest import config 7 | config.ECHO_NEST_API_KEY="XKAK8BHSXTQSZ1YQKXKLLAA" 8 | 9 | title = app(u'Spotify').current_track.name.get() 10 | artist = app(u'Spotify').current_track.artist.get() 11 | 12 | print title 13 | print artist 14 | 15 | from pyechonest import song 16 | 17 | rkp_results = song.search(artist=artist, title=title) 18 | 19 | print 'tempo:',rkp_results[0].audio_summary['tempo'] 20 | print 'key:',rkp_results[0].audio_summary['key'] 21 | print 'mode:',rkp_results[0].audio_summary['mode'] 22 | print 'time_signature:',rkp_results[0].audio_summary['time_signature'] 23 | 24 | tempo = rkp_results[0].audio_summary['tempo'] 25 | key = rkp_results[0].audio_summary['key'] 26 | mode = rkp_results[0].audio_summary['mode'] 27 | timesig = rkp_results[0].audio_summary['time_signature'] 28 | 29 | client = OSC.OSCClient() 30 | msg = OSC.OSCMessage() 31 | msg.setAddress("/key") 32 | msg.append(key) 33 | client.sendto(msg, ('localhost', port)) 34 | 35 | client = OSC.OSCClient() 36 | msg = OSC.OSCMessage() 37 | msg.setAddress("/mode") 38 | msg.append(mode) 39 | client.sendto(msg, ('localhost', port)) 40 | 41 | client = OSC.OSCClient() 42 | msg = OSC.OSCMessage() 43 | msg.setAddress("/tempo") 44 | msg.append(tempo) 45 | client.sendto(msg, ('localhost', port)) 46 | 47 | client = OSC.OSCClient() 48 | msg = OSC.OSCMessage() 49 | msg.setAddress("/title") 50 | msg.append(title) 51 | client.sendto(msg, ('localhost', port)) 52 | 53 | client = OSC.OSCClient() 54 | msg = OSC.OSCMessage() 55 | msg.setAddress("/artist") 56 | msg.append(artist) 57 | client.sendto(msg, ('localhost', port)) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DJ Spotify 2 | ========== 3 | Allows you to DJ using streamed content. Hacked together at MIDEM Music Hack Day 2014. 4 | 5 | Here's the hack in action: [http://www.youtube.com/watch?v=uTgwAMZiwMw](http://www.youtube.com/watch?v=uTgwAMZiwMw) 6 | 7 | ### How it works 8 | This system relies on a virtual machine (Parallels in my hack's case) to play a second Spotify stream. The two streams are then sent into individual tracks in Ableton Live, each with a Max For Live patch which reads the Spotify streams into internal buffers which can then be sped up or slowed down at will, effectively allowing you to beat-match and, theoretically, do a whole DJ with streamed content. 9 | 10 | ### Disclaimer 11 | This hack is incredibly impractical. It requires lots of different bits of software to each perform seemingly innocuous tasks, but every singly task is critical to the system working. If anyone can think of any ways to streamline this process, please do let me know. Needless to say, this implementation is OS X only, but it would definitely be possible on Windows, as well. 12 | 13 | I do not have any intention to maintain or update this code. I am simply posting it here for prosperity and for tinkerers who are interested in how this was achieved. That said... 14 | 15 | ### Components and required software 16 | ![DJ Spotify topology](http://reactifymusic.com/wp-content/uploads/2014/02/DJ-Spotify-diagram-1.jpg) 17 | The above is a diagram of how the hack works. As you can see it's a complete spider's web of messy hacks involving most components of the OS. 18 | 19 | In order to recreate this particular set-up on your machine you will need the following software installed: 20 | - [Ableton Live](https://www.ableton.com/) 21 | - [Max For Live](https://www.ableton.com/en/live/max-for-live/) 22 | - [SoundFlower](http://cycling74.com/soundflower-landing-page/) 23 | - [Pure data](http://puredata.info/) 24 | - [Spotify](https://www.spotify.com/us/download/) 25 | - [Parallels](http://www.parallels.com/) 26 | 27 | There are alternatives for many of these programs e.g. Jack instead of Soundflower, Virtual Box instead of Parallels, and Pure data is simply used to reroute the output of Soundflower to another input of Soundflower, so really, any DAW application capable of passing audio from an input to an ouput will do... 28 | 29 | For the automatic retreival of EchoNest data for the currently playing Spotify track, you will also need: 30 | - [Growl](http://growl.info/) 31 | - [pyechonest](https://github.com/echonest/pyechonest) 32 | - [appscript](https://pypi.python.org/pypi/appscript) 33 | - [pyOSC](https://pypi.python.org/pypi/pyOSC) 34 | 35 | If you choose to use Spotify and would like to display key and BPM information alongside your playlists, you can also install and use my Key and BPM Spotify app, the code for which can be found here: 36 | - [Spotify Key BPM App](https://github.com/reactify/spotify-key-bpm) 37 | 38 | Finally, if you would like to control Ableton Live with a custom DJing template on the iPad, install TouchOSC on your iPad: 39 | - [TouchOSC](http://hexler.net/software/touchosc) 40 | 41 | ### Method 42 | #### Two audio streams 43 | 1. On your main machine, install all of the above software and start Spotify 44 | 2. On your virtual machine, install Spotify and, if desired, Growl, pyechonest, appscript and pyOSC 45 | 3. On your main machine start SoundFlower and set the system audio output to be SoundFlower (64ch) in your System Preferences 46 | 4. Set the audio output of Parallels (note: *not* the system output of your virtual machine, but of the virtual machine hosting software itself) to be SoundFlower (2ch) 47 | 5. Open Soundflower-re-route.pd and set Pd's input device to be SoundFlower (2ch) and it's output to be SoundFlower (64ch) 48 | 6. Start Live Template.als in Ableton Live and set the audio input of Live to by SoundFlower (64ch). Set the audio output to be whatever you want e.g. Built-in Output or an external soundcard. 49 | 50 | Start audio playing on your main and virtual machines, and, in Live, you should now see audio from your main machine coming in on Track 1, and audio from your virtual machine coming in on Track 2 51 | 52 | #### Automated key and BPM retreival from Echonest 53 | Unless otherwise stated, the following steps must be performed on both your main and virtual machines 54 | 55 | 1. Open Growl and place the Rules.scpt file in the following path: 56 | "/Users/[username]/Library/Application Scripts/com.Growl.GrowlHelperApp/" 57 | Growl should run this AppleScript every time it receives a notification, so we use it to automatically launch the getTempoAndKey.py Python script which, in turn, queries Spotify for it's currently playing track, retreives the Key/BPM/Mode data for that track from EchoNest, and sends that information over OSC 58 | 2. Check that Growl is running the AppleScript by uncommenting the 'say "hello"' line in the Rules.scpt. Try skipping tracks in Spotify. If your machine says 'Hello', then you're good to go 59 | 3. In Rules.scpt change the path to the getTempoAndKey.py file to wherever you have it saved 60 | 4. In getTempoAndKey.py change the EchoNest API Key on line 7 to your own one. Go [here](http://developer.echonest.com/) if you need to get an EchoNest API Key. 61 | 5. On your main machine, change the port number on line 4 of getTempoAndKey.py to 8070, and to 8090 on the virtual machine 62 | 6. In Live on your main machine, check that the key and BPM data is coming through to the Stream-Pitch Max For Live devices on tracks 1 and 2 63 | 64 | #### Extra brownie points - controlling Live 65 | Now that you've got all the audio coming in to Live, you could make MIDI mappings to any hardware controller you happen to have lying around. If you would like to use the TouchOSC layout I made for iPad, follow these steps: 66 | 67 | 1. Set-up TouchOSC to communicate with your main machine. [Instructions here](http://hexler.net/docs/touchosc-configuration) 68 | 2. Open TouchOSC Editor and sync the Max DJ.touchosc layout on to your iPad [Instructions here](http://hexler.net/docs/touchosc-editor-sync) 69 | 3. Open TouchOSC on your iPad 70 | 4. Open the Audio MIDI Setup app (Spotlight it) and open the MIDI Window (⌘+2) 71 | 5. Double-click the Network window and you should see the name of your iPad in the Directory panel on the left hand side. Click on it and click 'Connect' below the panel 72 | 6. Open the Max DJ layout on your iPad and go back into Live. With any luck, all the MIDI mappings should still be present in Live, but if they're not, remake them 73 | 74 | #### Even more extra brownie points - displaying arist, title and BPM information in TouchOSC 75 | The Live template also has the capacity to talk back to the TouchOSC layout so that it can display the aritst, title and BPM information of the currently playing tracks. To get this working: 76 | 77 | 1. In the Master track in Live, open the Master-tempo-send Max For Live device and change the IP address and port number to those of your iPad. Again, see [here](http://hexler.net/docs/touchosc-configuration) for instructions on where to find those 78 | 79 | ## Beer time! 80 | Now, go and pour yourself a tasty beverage because you deserve it for getting this far. Tweet us at [@reactify](http://www.twitter.com/reactify) if you do because I would like to personally congratulate you (on getting this far, not pouring yourself a tasty beverage...) 81 | 82 | ### Legal stuff 83 | Copyright (c) 2014 Reactify Music LLP 84 | 85 | Permission is hereby granted, free of charge, to any person obtaining a copy 86 | of this software and associated documentation files (the "Software"), to deal 87 | in the Software without restriction, including without limitation the rights 88 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 89 | copies of the Software, and to permit persons to whom the Software is 90 | furnished to do so, subject to the following conditions: 91 | 92 | The above copyright notice and this permission notice shall be included in all 93 | copies or substantial portions of the Software. 94 | 95 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 96 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 97 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 98 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 99 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 100 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 101 | SOFTWARE. -------------------------------------------------------------------------------- /TouchOSC/Max DJ.touchosc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactify/dj-spotify/df925b6e963e63b139839d30489c20e4ef348cc1/TouchOSC/Max DJ.touchosc --------------------------------------------------------------------------------