# First we sample 30 trichords surrounding the minor triad 037.
chords_near_minor <- surround_set(c(0,3,7), magnitude=1, distance=.5)
chords_near_minor
# The next two commands will plot the sampled trichords on an x-y plane as
# circles; the minor triad that they surround is marked with a "+" sign.
plot(chords_near_minor[2,], chords_near_minor[3,],
xlab="Third", ylab="Fifth", asp=1)
points(3, 7, pch="+")
# The following two commands will plot the two lines (i.e. hyperplanes) that
# demarcate the boundaries of the minor triad's color. Most but not all
# of our randomly generated points should fall in the space between the
# two lines, in the same region as the "+" representing 037.
abline(0, 2)
abline(6, 1/2)
Run the code above in your browser using DataLab