GIS-0.0.7.6: An implementation of David Lewin's Generalized Interval Systems
Copyright(c) Eric Bailey 2021-2025
LicenseMIT
Maintainereric@ericb.me
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Data.GIS

Description

David Lewin's Generalized Interval Systems (GIS).

Synopsis

Documentation

class Group (Interval space) => GIS space where Source #

A Generalized Interval System (GIS) is a triple (S, (G, ·), int) where

  • \(S\) is a musical space (space),
  • \(G\) is the group of intervals (Interval space) for the GIS, and
  • int is a function \(S \times S \to G\) (space -> space -> Interval space)

such that

  1. \(\forall r,s,t \in S, int(r,s) \cdot int(s,t) = int(r,t)\), and
  2. \(\forall s \in S, g \in G, \exists! t \in S, int(s,t) = g\).

Minimal complete definition

label | int

Associated Types

type Interval space Source #

The group of intervals.

type Interval space = IntervalOf space

Methods

ref :: space Source #

A referential element in the musical space.

default ref :: Bounded space => space Source #

int :: space -> space -> Interval space Source #

The interval between two musical elements.

default int :: space -> space -> Interval space Source #

int s t = label t ~~ label s

label :: space -> Interval space Source #

Uniquely map a musical element to an element of the group of intervals.

default label :: Eq space => space -> Interval space Source #

Instances

Instances details
PitchClassSpace space => GIS space Source #

For a pitch class space \(S\) (space) with the same Cardinality as a Group \(G\) (IntervalOf space), there exists a GIS (S, (G, ·), int) where ref = 0.

Instance details

Defined in Data.GIS

Associated Types

type Interval space 
Instance details

Defined in Data.GIS

type Interval space = IntervalOf space

Methods

ref :: space Source #

int :: space -> space -> Interval space Source #

label :: space -> Interval space Source #

PitchSpace space => GIS (Pitch space) Source #

For a pitch space \(S\) (Pitch space), where intervals are representable as integers, there exists a GIS (S, (ℤ, +), int), where pitches are labeled via labelPitch and ref = 0.

Instance details

Defined in Data.GIS

Associated Types

type Interval space 
Instance details

Defined in Data.GIS

type Interval space = IntervalOf space
type Interval (Pitch space) 
Instance details

Defined in Data.GIS

type Interval (Pitch space) = IntervalOf (Pitch space)

Methods

ref :: Pitch space Source #

int :: Pitch space -> Pitch space -> Interval (Pitch space) Source #

label :: Pitch space -> Interval (Pitch space) Source #

type family IntervalOf space Source #

The type of intervals associated with a given musical space in a Generalized Interval System (GIS).

Instances

Instances details
type IntervalOf PitchClass Source #

In chromatic pc-space, the twelve pitch classes can be labeled by the elements of the cyclic group of order \(12\), C₁₂.

Instance details

Defined in Data.PitchClass.Chromatic

type IntervalOf PitchClass Source #

In diatonic pc-space, the seven pitch classes can be labeled by the elements of the cyclic group of order \(7\), C₇.

Instance details

Defined in Data.PitchClass.Diatonic

type IntervalOf (Pitch PitchClass) Source #

In chromatic p-space, pitches can be labeled by the elements of the group of integers under addition, \((\mathbb{Z}, +)\).

Instance details

Defined in Data.PitchClass.Chromatic

type IntervalOf (Pitch PitchClass) Source #

In diatonic p-space, pitches can be labeled by the elements of the group of integers under addition, \((\mathbb{Z}, +)\).

Instance details

Defined in Data.PitchClass.Diatonic

type PitchClassSpace space = (Bounded space, Finitary space, Finitary (IntervalOf space), Cardinality space ~ Cardinality (IntervalOf space), Group (IntervalOf space), Torsor (IntervalOf space) space) Source #

A bounded pitch class space with the same Cardinality as a Group (IntervalOf space).

type PitchSpace space = (Bounded space, Finitary space, IntervalOf (Pitch space) ~ Sum Int) Source #

A bounded pitch class space can be used to create a pitch space where intervals are representable in the group of integers under addition.