Diamond:
Filter:
TuningLib/Classes (extension) | Tuning > TuningLib

Diamond
ExtensionExtension

An N-limit tonality diamond

Description

An N-limit tonaility diamond, as used by Harry Partch.

With a 9-limit diamond in base 2, one row looks like:

It also is able to generate and navigate a 2 dimentinal table:

It is possible to do chord changes by 'walking' though the table.

Class Methods

.new

Create a new instance

Arguments:

identities

An array of numbers to use for numerators in otonality. Defaults to [2, 5, 3, 7, 9, 11, 13, 15, 17, 19, 21, 23]

base

This is 2 for Octave-based systems.

Discussion:

.limit

Create a new instance

Arguments:

limit

the limit for the tuning. So 5 for 5-limit, 7-for 7-limit, etc.

base

This is 2 for Octave-based systems.

Discussion:

.adjustOctave

Adjusts the octave of a tuning ratio so that it is between 1/1 and 2/1

Arguments:

ratio

the ratio to adjust

base

The base of the tuning system. This is 2 for octave-based systems. The adjusted ratio will be between 1 and the base.

Returns:

The adjusted ratio

Instance Methods

.niad

Rfor a given numerator and denominator, return a chord of n ratios

Arguments:

numerator

The numerator for the first item in the triad. The triad will wrap around if three spaces past the integer goes beyond the limit.

denominator

The denominator for the first item in the triad. The triad will wrap around if three spaces past the integer goes beyond the limit.

orientation

Use true for utonality or false for otonailty.

the number of conitguious ratios for the N-iad;

Returns:

An array of ratios

Discussion:

.walk

Find a pivot based on a start point, describe by numerator/denominator. Finding the new pivot point means picking one of the fractions in a n-iad Finding the new start means figuring out whether the new pivot is the top, middle, or bottom member of the triad and computing a new start index based on that computation

Arguments:

numerator

The starting numerator of the n-iad which we will launch from

denominator

The starting denominator of the n-iad in which we will launch from

orientation

If true, the overtones will change in the pivot for the first step. If false, the undertones will change in the pivot for the first step. This will alternate for every step.

niad

The number of contigious ratios to return in the chord. This defaults to 3 for a triad

Returns:

An Routine which yields a stream of arrays of ratios

Discussion:

The Routine takes an inval that is either an integer which indicates the number of ratios to return (ie 3 for a triad) or an Event. If it is an Event, it looks for an item index by \niad and uses that to determine the number of ratios to return. In the case that the number of ratios is not specified with an inval, it will use the last number specified.

.getInterval

For a given x and y index, return a ratio

Arguments:

x

The index in the diamond row for o[x]/o[y] This wraps if need be.

y

The index in the diamond column for o[x]/o[y] This wraps if need be.

Returns:

a ratio

.makeIntervals

For a given x and y index, return a n-iad of ratios

Arguments:

x

The index in the diamond row for o[x]/o[y] This wraps if need be.

y

The index in the diamond column for o[x]/o[y] This wraps if need be.

orientation

Use true for utonality such that the returned triads will change in the numerator, but not the demonimator. To change the denominator, use false.

niad

The number of contigious ratios to return in the chord. This defaults to 3 for a triad

Returns:

an Array of niad ratios

Discussion:

.d1Interval

Returns the fraction at the index

Arguments:

index

The index of the overtone or undertone

orientation

true for otonality, false for utonality

Returns:

a ratio

Discussion:

.d1Pivot

Find a pivot based on a start point. Finding the new pivot point means picking one of the fractions in a n-iad. Finding the new start means figuring out wether the new pivot is the top, middle, or bottom member of the n-iad and computing a new start index based on that computation

Arguments:

start

The starting index of the n-iad, in which we wish to pivot

niad

The number of contigious ratios to return in the chord. This defaults to 3 for a triad

Returns:

An array containing the index of the new start and the index of the pivot

.d1Intervals

For a given index, return a n-iad of ratios

Arguments:

start

he index in the lattice row in which to start. This wraps if need be.

orientation

Use true for utonality or false for otonailty.

niad

The number of contigious ratios to return in the chord. This defaults to 3 for a triad

Returns:

An array of niad ratios

Discussion:

The n-iad is computed in regards to the base. ex:

.d2Pivot

Find a pivot based on a start point, describe by o[x]/o[y]. Finding the new pivot point means picking one of the fractions in a n-iad Finding the new start means figuring out whether the new pivot is the top, middle, or bottom member of the triad and computing a new start index based on that computation

Arguments:

x

The starting index of the numerator of the n-iad in which we wish to pivot

y

The starting index of the denominator of the n-iad in which we wish to pivot

orientation

If true, the overtones will change in the pivot. If false, the undertones will change in the pivot.

niad

The number of contigious ratios to return in the chord. This defaults to 3 for a triad

Returns:

An array containing the x of the first interval in the n-iad, the y of the first interval, the x of the pivot, and the y of the pivot

.d2WalkXY

Find a pivot based on a start point, describe by o[x]/o[y]. Finding the new pivot point means picking one of the fractions in a n-iad Finding the new start means figuring out whether the new pivot is the top, middle, or bottom member of the triad and computing a new start index based on that computation

Arguments:

x

The starting index of the numerator of the n-iad which we will launch from

y

The starting index of the denominator of the n-iad in which we will launch from

orientation

If true, the overtones will change in the pivot for the first step. If false, the undertones will change in the pivot for the first step. This will alternate for every step.

niad

The number of contigious ratios to return in the chord. This defaults to 3 for a triad

Returns:

An Routine which yields a stream of arrays of ratios

.postln

Prints out the tonality diamond

Discussion:

Examples

Using a Diamond with a Pbind: