JFugue

JFugue

JFugue is an open source programming library that allows one to program music in the Java programming language without the complexities of MIDI. It was first released in 2002 by David Koelle. Brian Eubanks has described JFugue as "useful for applications that need a quick and easy way to play music or to generate MIDI files." [Eubanks, Brian D. (2005), " [http://www.wickedcooljava.com/ Wicked Cool Java] ". pp. 154–156.]

Example

Here's an example Java program that will play the C-major scale in JFugue.

Player player = new Player();player.play("C D E F G A B");

The string passed to JFugue contains a series of musical instructions that JFugue parses and turns into musical events, which by default are rendered in MIDI. These strings, called the "MusicString" ["www.jfugue.org/jfugue-chapter2.pdf"] , can represent all of the musical features of MIDI ["http://developers.sun.com/learning/javaoneonline/2007/pdf/TS-1130.pdf"] . JFugue also provides features that enable the developer to write music in a straightforward manner; for example, chords and instruments are represented in a user-centered manner.

Player player = new Player();player.play("V0 Cmaj V1 I [Flute] D#6q V2 I [Alto_Sax] F#minI GminI");

A notion of Patterns is integral to JFugue. Patterns are used to represent phrases of music that can be combined and repeated.

Pattern pattern1 = new Pattern("A B C");Pattern pattern2 = new Pattern("G F E");pattern1.add(pattern2);pattern1.repeat(3);Player player = new Player();player.play(pattern1);

Patterns can also be transformed into new phrases of music using a PatternTransformer ["http://java.dzone.com/news/interview-jfugue-goes-hip-hop"] :

Pattern pattern = new Pattern("A B C");ReversePatternTransformer rpt = new ReversePatternTransformer();Pattern reversePattern = rpt.transform(pattern);

Functionality

JFugue uses the MIDI implementation provided by the Java programming language to create audio output from the "MusicString", the series of instructions that JFugue parses.

The architecture of JFugue allows it to read and write musical information from and to a variety of formats. Currently, JFugue is capable of reading and writing its own MusicString; MIDI files; and MusicXML files [Recordare LLC, "http://www.recordare.com/xml/software.html] . Additionally, each of these readers and writers (which JFugue calls "Parsers" and "Renderers") can be mixed and matched. For example, it is possible to create an application that reads MIDI files and writes them as MusicXML through JFugue.

Advanced Features

JFugue is capable of producing microtonal music.

One can create rhythms as if programming a beat box ["JFugue Goes Hip Hop", interview at JavaLobby, "http://java.dzone.com/news/interview-jfugue-goes-hip-hop"] :

Rhythm rhythm = new Rhythm();rhythm.setLayer(1, "O..oO...O..oOO..");rhythm.setLayer(2, "..*...*...*...*.");rhythm.addSubstitution('O', " [BASS_DRUM] i");rhythm.addSubstitution('o', "Rs [BASS_DRUM] s");rhythm.addSubstitution('*', " [ACOUSTIC_SNARE] i");rhythm.addSubstitution('.', "Ri");Player player = new Player();player.play(rhythm);

JFugue provides functionality on top of Java's MIDI Transmitter and Receiver classes to reduce the amount of code that a developer would need to write to connect to external MIDI devices.

Uses in Other Applications

JFugue has been used in a number of applications, including software projects and artistic installations.
* The JFugue Music NotePad provides a user interface for composing music [JFugue Music NotePad project, "https://nbjfuguesupport.dev.java.net/"]
* JFrets is an application for teaching and training guitar tablature [JFrets project, "https://jfrets.dev.java.net/"]

JFugue has been used to play music when a software build fails or succeeds ["http://blogs.sun.com/geertjan/entry/ode_to_build_scripts"] .

JFugue is one of the few Java libraries that lets one do something interesting in as little as one or two lines of code. This distinction earned JFugue a place in the book "Groovy in Action" [Koenig, Dierk, et al (2007), "http://www.manning.com/koenig/".]

References

External links

* [http://www.jfugue.org/ JFugue.org] —Official JFugue website


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Computational musicology — is defined as the study of music with computational modelling and simulation.[1] It saw its beginning in the 1950s and originally did not utilize computers, but more of statistical and mathematical methods. Nowadays computational musicology… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”