|
|
Most of the assignments will involve programming in Haskore, which is a Haskell library for computer music composition. There are several steps to getting things running on your own machine, which are described below. Although it looks complicated, it's really not so bad. Alternatively, you can use the Zoo or CS computer music lab machines.
Installing GHCWe recommend using the Glasgow Haskell Compiler (GHC) version 6.8.2 or later for this course. GHC 6.8.2 is already installed on the Zoo machines, so if you are using a Zoo computer you may skip this installation step. If you wish to run GHC on your own machine, you may download version 6.8.3 for your platform here. You can find the installation instructions here. Installing darcsYou will need darcs version 2.0.0 or later to download the version of Haskore that we will be using in this course. darcs is a version control system that will make it easy for us to provide software updates to you in a consistent manner.
Installing HaskoreFor Linux users, first make sure that the ALSA development package (both header files and libraries) is already installed, since Haskore depends on it. Open a command prompt. (On Windows, open the "Command Prompt" or execute cmd.exe; on a Mac, open the "Terminal" application.) "cd" to the directory (folder) in which you wish to place Haskore. Then do:
You might need administrator privileges to complete the last step.
For MacOS and Linux users who don't have administrator
privileges, you should instead use: Assuming that the installation succeeds, you may enter the example directory and load/run the examples, as follows:
If your MIDI device is working properly, you will hear a melody playing, otherwise please read the next section on how to set up MIDI output. Note: On MacOS X, you will have to use the "EnableGUI trick" to run GUI programs for Haskore, as follows: First compile EnableGUI.hs to binary as follows: cd Haskore/example/ Note: on some systems it is necessary to include a -framework option, like this: ghc -framework ApplicationServices -c -fffi EnableGUI.hs Then run your Haskore GUI programs in GHCi like this: ghci UIExamples.hs
EnableGUI Otherwise, GHCi will not be able to fully activate the Graphics Window. (Fully compiled GUI programs do not suffer from this anomaly.) Setting up MIDIIf you are using Mac or Linux and cannot hear anything, chances are your sound card does not have a hardware MIDI synthesizer built in. If that is the case:
Updating HaskoreOnce GHC and darcs are installed, you should not have to reinstall or update them. However, from time to time we may suggest that you update to a newer version of Haskore, which is still evolving. To do this, open a command prompt, and do the following: Darcs will prompt you to answer whether you want a
particular patch or not -- just answer Note: For this to work properly, it is important that you not modify any of the Haskore files. If you are creating a new program (for example a homework assignment), you should create a new file and import the necessary Haskore files into it. Otherwise your changes will be lost! |