JMSL Tutorial: JScore
Adding measures to a score

JScore allows the user to enter and edit notes by hand, but its real strength lies in its programmability, which breaks down into two areas:
  1. Adding algorithmically generated notes to a score
  2. Transforming selected notes in a score

This tutorial demonstrates:
A new Score is created like so:
	// 2 staves, width, height
	Score score = new Score(2, 800, 400);

A score can be added to a ScoreFrame for display and editing. ScoreFrame has a powerful system of menus for score editing. Adding a score to a ScoreFrame is done like this:
	ScoreFrame scoreFrame = new ScoreFrame();
	scoreFrame.addScore(score); 

A blank measure with an arbitrary time signature can be added to a score with the addMeasure() method. For example:
	score.addMeasure(11, 16);  
	score.addMeasure(4, 4); 
	// add a measure with random time signature
	score.addMeasure(JMSLRandom.choose(3, 7), (int)Math.pow(2, JMSLRandom.choose(2, 4)));
You need a Java-enabled browser to view this applet.
View the complete source here.

Previous Tutorial Index Tutorial Contents Next

  (C) 2000 Nick Didkovsky and Phil Burk, All Rights Reserved
  JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.