+int
+Scale::step_count () const
+{
+ return step_tones_.size ();
+}
+
+Rational
+Scale::tones_at_step (int step, int octave) const
+{
+ int normalized_step = normalize_step (step);
+
+ octave += (step - normalized_step) / step_count ();
+
+ // There are 6 tones in an octave.
+ return step_tones_[normalized_step] + Rational (octave*6);
+}
+
+Rational
+Scale::step_size (int step) const
+{
+ int normalized_step = normalize_step (step);
+
+ // Wrap around if we are asked for the final note of the
+ // scale (6 is the number of tones of the octave above the
+ // first note).
+ if (normalized_step + 1 == step_count ())
+ return Rational(6) - step_tones_[normalized_step];
+
+ return step_tones_[normalized_step + 1] - step_tones_[normalized_step];
+}
+
+int
+Scale::normalize_step (int step) const
+{
+ int ret = step % step_count ();
+ if (ret < 0)
+ ret += step_count ();
+
+ return ret;
+}