Welcoming Spring with some new features in JFugue! Public domain picture from http://www.publicdomainpictures.net/view-image.php?image=60821&picture=paper-birds-musical-notes

What’s New in JFugue 5.0.8

There are some exciting new features in JFugue 5.0.8 that I’d like to share with you!

  • Support for broken chords
  • An update to real-time player events so each note comes with its voice and instrument information
  • A new method added to Intervals that checks whether a given note is in an interval that has a root
  • A change to replacement strings: The underscore reference, $_, has been changed to $!

New feature: Support for Broken Chords

new Player().play(“Cmaj”);

Of course, this would play a C-major chord (C, E, and G) — all three notes at the same time, with the default quarter duration.

But sometimes, you might want to play a chord with a particular style. For example, you may want the notes of a C-major chord played more like a march, with the first two notes in the chord played once, followed by the third note played twice. And then, maybe you decide that march doesn’t match what you’re looking for, and you’d like to try a different arrangement.

To make this kind of musical experimentation and discovery as simple and as quick as possible to write, JFugue introduces support for broken chords. This capability uses the same “replacement strings” that are already used in chord progressions and intervals to give an index into which note of the chord you want to play at a given time.

Here’s how it works: You specify your chord, followed by a colon, then a comma-separated replacement string. Here’s the march example discussed earlier:

new Player().play(“Cmaj:$0h+$1h,$2q,$2q”);

For more examples and a deeper dive, including learning how to refer to bass or root notes regardless of their index, can be found here: Broken Chords in JFugue.

Read to the end of this post for a cool video about broken chords.

New feature: Update to Real-Time Player

The solution to this is to create an atom of music that lets you specify a voice (and, optionally, a layer), an instrument, and a note at the same time. Then you can send the atom to the RealTimePlayer, and the music is rendered correctly. An atom is a single Staccato element; it starts with a semicolon, then contains a comma-separated list of voice (and, optionally, layer), instrument, and note elements. For example, “&V1,I[Piano],Cw” is an atom that changes to Voice 1, instrument Piano, and plays a C note, whole duration, without any other voice-instrument-note settings interfering in the time that it takes to process this atom.

There is also a new method on Pattern called atomize(), which will return a new Staccato string containing atoms for each note in the pattern.

New feature: Check whether Intervals has a Note

Updated feature: Change to the replacement string $_ reference

Thanks for reading!

Dir. Engineering @charlesriverinc. Author of JFugue. API design & usability. Inspiring people to experience and appreciate the joys of programming and science!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store