Class HarmonicComplexity

java.lang.Object
com.softsynth.jmsl.util.HarmonicComplexity

public class HarmonicComplexity
extends java.lang.Object
Some tools for handling intervals ordered by their "harmonic complexity."
From least to most complex, I'm suggesting:
{0, 7, 5, 4, 9, 3, 10, 6, 2, 8, 11, 1 }

I came up with my ranking with a simple model: examine partials one by one up from the root. Every time you add a new partial, examine the resulting intervals between it and all lower partials. So if the partials begin C C G C E, etc ... then a Perfect 5th comes from the interval from C to G. Perfect 4th comes from the interval from the 3rd partial G to the 4th partial, C. The 5th partial, E, gives you the maj3rd above C. But it also gives you 9 semitones above G. etc etc etc

Author:
Nick Didkovsky
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int[] harmComplexArr
    An array of increasingly complex intervals.
    static java.lang.String[] harmComplexIntervalNamesArr  
  • Constructor Summary

    Constructors
    Constructor Description
    HarmonicComplexity()  
  • Method Summary

    Modifier and Type Method Description
    static int calcHCM​(double[] chord)
    Returns the harmonic complexity of a chord.
    static int calcHCM​(MusicShape chord)
    Returns the harmonic complexity of a chord.
    static int calcHCR​(double[] chord)
    Returns how wide an intervallic range the chord spans, in octaves.
    static int calcHCR​(MusicShape chord)
    Returns how wide an intervallic range the chord spans, in octaves.
    static java.lang.String getAllIntervalsUpTo​(int harmComplexity)  
    static java.lang.String getIntervalName​(int harmComplexity)  
    static int gimmeRandomHarmonicComplexity​(double center, double gaussianWidth)
    Returns some interval from {0, 7, 5, 4, 9, 3, 10, 6, 2, 8, 11, 1 } Arguments passed to Gaussian distribution
    static int gimmeRandomHarmonicComplexity​(int ceiling)
    Returns some interval from {0, 7, 5, 4, 9, 3, 10, 6, 2, 8, 11, 1 } Ceiling argument limits upper range of complexity 0..11
    static void main​(java.lang.String[] args)  
    static void print()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • harmComplexArr

      public static final int[] harmComplexArr
      An array of increasingly complex intervals. Open for debate, I suppose...
    • harmComplexIntervalNamesArr

      public static final java.lang.String[] harmComplexIntervalNamesArr
  • Constructor Details

    • HarmonicComplexity

      public HarmonicComplexity()
  • Method Details

    • print

      public static void print()
    • gimmeRandomHarmonicComplexity

      public static int gimmeRandomHarmonicComplexity​(double center, double gaussianWidth)
      Returns some interval from {0, 7, 5, 4, 9, 3, 10, 6, 2, 8, 11, 1 } Arguments passed to Gaussian distribution
    • gimmeRandomHarmonicComplexity

      public static int gimmeRandomHarmonicComplexity​(int ceiling)
      Returns some interval from {0, 7, 5, 4, 9, 3, 10, 6, 2, 8, 11, 1 } Ceiling argument limits upper range of complexity 0..11
    • getIntervalName

      public static java.lang.String getIntervalName​(int harmComplexity)
    • getAllIntervalsUpTo

      public static java.lang.String getAllIntervalsUpTo​(int harmComplexity)
    • calcHCM

      public static int calcHCM​(double[] chord)
      Returns the harmonic complexity of a chord. Assumes chord is stored in a double[], pitch numbers sorted low to high
    • calcHCM

      public static int calcHCM​(MusicShape chord)
      Returns the harmonic complexity of a chord. Assumes chord is stored in one-dimensional MusicShape, pitch numbers sorted low to high
    • calcHCR

      public static int calcHCR​(double[] chord)
      Returns how wide an intervallic range the chord spans, in octaves. Assumes chord is stored in a double[], pitch numbers sorted low to high
    • calcHCR

      public static int calcHCR​(MusicShape chord)
      Returns how wide an intervallic range the chord spans, in octaves. Assumes chord is stored in a one-dimensional MusicShape, pitch numbers sorted low to high
    • main

      public static void main​(java.lang.String[] args)