|
|||
|
Creating a .cshrc file. Assume you have put the jMusic folder in your User directory, use a text editor to create a file called .cshrc with the following (single) line in it. In OS X not all Aqua text editors can read or write files starting with a dot, as these are generally hidden. We suggest that you open a terminal and use the pico editor to create and or edit your .schrc file. Navigate to your home directory by typing cd ~. In the terminal type pico .cshrc then add the line below. setenv CLASSPATH .:${home}/jMusic/jmusic.jar:${home}/jMusic/inst/ Save the file in your user directory. e.g: /User/andrew/.cshrc |
In OS X systems that use the bash shell by default it is the ~/.bashrc file.
Creating a .bashrc file. Assume you have put the jMusic folder in your User directory, use a text editor to create a file called .cshrc with the following (single) line in it. In OS X not all Aqua text editors can read or write files starting with a dot, as these are generally hidden. We suggest that you open a terminal and use the pico editor to create and or edit your .schrc file. Navigate to your home directory by typing cd ~. In the terminal type pico .bashrc then add the line below. export CLASSPATH=.:$HOME/jMusic/jmusic.jar:$HOME/jMusic/inst/ Save the file in your
user directory. e.g: /User/andrew/.basrc Create (or edit an
existing) a .profile file inthe same directory
by typing pico
.profile. Add the following line to
the file: . .bashrc
|
4. Reshresh the teminal to utilise the changed environment variables. Open a terminal window (or quit and reopen if already open) to initiate the .cshrc file. (The terminal app is in the /Applications/Utilities/ directory.) Use the commands javac filename.java or java filename to run jMusic files.
5. (Optional) To use the MidiShare package (msjm) for MIDI input and output you will need to download and install MidiShare from Grame, including the Java developer tools with the grame.jar file. You should run msconnect to connect the various midi input/output sources that you might have. All the files need to go in the working directory. The grame.jar needs to be added as an environment variable in the classpath. For example, add :${home}/jMusic/graeme.jar to the end of the setenv CLASSPATH command above if the grame.jar file is in the jMusic folder.
Note: With Java for OS X version 1.4.2 Apple broke QTJava support, so the jMusic jmqt package does not work. If you have this version of Java installed please avoid the qtjm package within jMusic (for now at least - there is an update in the works at Apple we believe).
Install java: (Skip these steps if you have a Java runner and compiler already.)
Install jMusic:
First stage, install Java bits.
You may wish to try creating, compiling and running a simple jMusic program to test if the tools has been set up correctly. Here is a tutorial to try which will work on all flavours of Windows.
- Under Win9x or WinME, add the following command to c:\autoexec.bat and reset your computer.
- Under Win2000, NT or XP,
Open the System Properties Dialog. (By right-clicking My Computer and going to Properties OR by naviagting through Start | Settings | Control Panel | System)
Choose the Advanced tab
Click Environment Variables... Ensure that a variable called CLASSPATH exists and it contains c:\jmusic\jmusic.jar;c:\jmusic\inst
For even more information on getting going with Java try the getting started instructions from Java's homepage.
Using -classpath options directly
If
you are compiling at the command line there is a method where you can
ignore the .profile setup using the -classpath option for the Java
compiler (in fact it's what I do most of the time). Here is an overview:
1. Download the jmusic###.jar file from sourceforge and put it is a directory/folder on your hard drive.
2. Write (or download from a tutorial) a jMusic program file and save it in a directory/folder on your hard drive.
3. Open a terminal/command-line application
4.
Compile and run using the -classpath option for the javac and java
applications, and pass it the 'location' of your .jar file, then use
the complete path for the location of your .java program file.
e.g: In a Bash shell on OSX the compiling command looks like this (with a space between the two paths)
javac -classpath /Users/acid/AB_Work/Code/jMusic/src16/build/jar/jMusic1.6.4.jar /Users/acid/Desktop/Scale.java
The
execution command looks like this (with a colon between the paths for
the jmusic library and the program file, and a space before the
Java class name)
java -classpath /Users/acid/AB_Work/Code/jMusic/src16/build/jar/jMusic1.6.4.jar:/Users/acid/Desktop/ Scale
The full set of .java source files for jMusic are availible from SourceForge.
The Javadoc-generated documentation in HTML format can be downloaded from sourceforge. It can also be viewed online from this site.
Work through the online tutorials and documented example code to see how to compose with jMusic.
Visit the Digital Instrument Building web resource that features jMusic tutorials focused on music software development.
Download the jMusic tutorials as a zip archive. [15.4 MB]
We are very interested to hear your comments about jMusic, the music you write with it, and to see any additions to the classes you might make. Check previous questions or suggestions at the jMusic-dev archives or send a message by subscribing to the list.
Join the team formally by registering at
|
|