JMSL Tutorial: MusicShape


MusicShapes may contain data that is directly performable (such as pitch, amplitude, resonance, etc). But MusicShapes may contain more abstract data, such as parameters that feed an algorithm. The first MusicShape we will build will provide parameters for an Instrument that will build and perform chords at runtime. We'll play it with JavaSound MIDI.

The MusicShape will have five dimensions:
DIMENSION     MEANING
0 duration of chord
1 root of chord
2 number of intervals in chord
3 harmonic complexity of chord
4 time window within which to play all intervals

Click the Launch button in the Applet below, and play around with the MusicShapeEditor (see "crash course" below applet).
You need a Java-enabled browser to view this applet.

MusicShapeEditor crash course:
  • Click and drag the mouse around in the editor to change elements' values in the selected dimension.
  • Hold the ALT key down and drag the mouse "offscreen" to the right of the MusicShape to append new elements, or off to the left to insert new elements.
  • Click the [+] in the bottom right to zoom in vertically. Click [-] to zoom out. Click [1.0] to reset zoom.
  • Click and drag in the narrow dark gray border beneath the MusicShape to select a range of the MusicShape's elements.
  • Double click in this same border to deselect range of elements.
  • Select a range of elements and click one of the MusicShapeEditorOperator buttons, like Scramble, Retrograde, or Sort. Note the effect.
  • Select a range of elements and click the Invert button. Click on the pink colored line and drag it up and down. Click Invert again. Note that this line is used to calculate the value about which the inversion operates.
  • Select a range of elements and click the Randomize button. Click on the blue colored horizontal lines and drag them up and down. Click Randomize again. Note that these lines are used to set max and min range values for some of these algorithms. For another example, click "Fit To Range" and you will see the selected range expand or compress to fit within the high and low limits defined by these blue lines.
  • If any transformations you apply send values off screen, just click the [1.0] square to recalibrate the display.
  • Note the v1, v2, v3 text fields. You may type numbers here that are used by some of the MusicShapeEditorOperator buttons. For example, select a range of 3 or 4 elements in the duration dimension. Type 2.0 into v1. Click the "Scale sum to v1" button. The selected elements will be rescaled so that their sum is 2.0 (ie in this case it will take 2 seconds to play through the selected range). Remember to click [1.0] if your operations generate offscreen values.
  • You can define your own MusicShapeEditorOperator's and add them to a MusicShapeEditor with addMusicShapeEditorOperator()

  • Next we will look at DimensionNameSpace, which is a JMSL class that manages this notion of mapping a dimension number (0, 1, 2, 3...) to a name ("duration", "pitch", "Harmonic Complexity", etc)

    Examine the source for this applet here.

    Previous Tutorial Index Tutorial Contents Next
      (C) 1997 Phil Burk and Nick Didkovsky, All Rights Reserved
    JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.