Skip to content

Instantly share code, notes, and snippets.

View hendriks73's full-sized avatar

Hendrik Schreiber hendriks73

View GitHub Profile
@hendriks73
hendriks73 / download_rename.py
Created November 12, 2021 10:08
Download ISMIR 2021 papers and rename using conference metadata ("speaking" names)
#!/usr/bin/env python
# coding: utf-8
###########################################################################
# Download papers of ISMIR 2021 save them under "speaking" file names
# derived from the JSON describing the conference.
#
# NOTE: Paper will be downloaded to your _current_ dir!!
#
# author: Hendrik Schreiber (hs@tagtraum.com)
@hendriks73
hendriks73 / musicxml.js
Last active June 10, 2020 19:20
JXA-based JavaScript that creates an XML file for Music.app like iTunes used to create before macOS 10.15.
/***********************************************************************
* JXA-based JavaScript that creates an XML file for Music.app like *
* iTunes used to create before macOS 10.15. *
* *
* NOTE: The XML is not identical, but a best effort is made. *
* Missing are for example all B64-encoded smart data and the *
* protected flag as well as certain distinguished playlists *
* kinds. For a real replacement, use the ITLibrary API . *
* *
* USAGE: *
@hendriks73
hendriks73 / a.groovy
Created May 16, 2019 06:25
highly commented traktor/beaTunes import code
def boolean importInfo(StartElement element, String location) {
AudioSong song = null
try {
// read some attributes from the <INFO> element
// first read the attribute named PLAYCOUNT, i.e. <INFO PLAYCOUNT="someValue" ...>
Attribute playcount = element.getAttributeByName(new QName("PLAYCOUNT"))
// read the attribute named LAST_PLAYED, i.e. <INFO LAST_PLAYED="someValue" ...>
Attribute lastPlayed = element.getAttributeByName(new QName("LAST_PLAYED"))
// probably for historic reasons, Traktor calls comment 2 "rating"