Top

Archive of articles classified as "Scripts"

Back home

The following script is entirely my own, for better or for worse. It is a self-contained script that calculates the set class of a given set. Given a particular set of pcs (numbers) in a given mod, the program returns the Tn and TnI classes, and the interval vector. The program is quite powerful, in that it handles decimals, negative numbers and multisets.

To install the script, go to Terminal (in mac), and find the directory where the script is located (using cd). If you need help with that, here is a page outlining some of the basic unix commands.


Read full article »

Here is a little python script that starts up a web server in the directory where the script is run. This is not my script, though I did add a couple optional arguments.

While the script is running, the directory from which the script was run will be web-accessible at your ip address, at the default port 8080 (e.g. 192.168.0.100:8080). If you want to broadcast beyond your local network, just make sure that your router is forwarding the correct ports to your computer.

The script produces an index page equipped with an upload button, making it very handy for quick file-sharing via http.


Read full article »

This perl script takes a decimal number and converts it to a list of pitch classes, and prints the list to the screen. For example, given the decimal number 145, the corresponding set would be {0, 4, 7}, since 145 = 20 + 24 + 27.

To install, use the same method as given here. Once installed, use the script by doing:

bin2pcs 145


Read full article »

The following is a little shell script that recursively finds within a folder all the files that contains a given string and replaces all the instances of the string with another given string. This is really helpful for making sweeping changes among a collection of files, without having to edit each file individually.

There are two ways to use the script: with or without a file extension to limit the search. If no file extension is given, all files will be considered. Assuming the script is called ‘frpl’, here is the usage:

frpl searchstring replacestring [fileextension]


Read full article »