Viewpoints

Viewpoints are representations of musical structure. A number of functions are provided to help the user work with viewpoints and viewpoint data.

The available viewpoints are described in Pearce [2005] and implemented in the derived-viewpoints/ directory in amuse-viewpoints. It is easy to implement new viewpoints, the examples in the code and Adding Viewpoints should help you get started.

Viewpoint sequences

The function viewpoint-sequence returns a representation of a melody (composition 0 in dataset 0) corresponding to the supplied viewpoint (chromatic pitch: cpitch). The output corresponds to the pitch of each note in the melody.

CL-USER> (viewpoints:viewpoint-sequence
          (viewpoints:get-viewpoint 'cpitch)
          (md:get-event-sequence 0 0))
(65 62 60 60 60 60 65 65 65 69 69 69 69 69 67 65 65 65 62 60 60 65 69 69 67 65
 60 60 60 60 65 65 65 65 69 69 69 69 72 72 77 74 72 69 69 69 69 65 67 69 65 65
 65 77 74 72 74 76 77 72 72 74 72 74 76 77 74 72 74 76 77 76 77 74 72 69 67 65
 67 77 77 74 72 74 76 77 72 72 74 72 74 76 77 76 74 72 69 69 69 69 67 65 67 69
 65 65)

Derived viewpoints

We can also use viewpoints which represent derived features such as pitch interval (cpint) or IOI ratio (ioi-ratio). Note that because these two derived viewpoints represent relationships between notes, they are undefined for the first note in the sequence (which has no predecessor).

CL-USER> (viewpoints:viewpoint-sequence
          (viewpoints:get-viewpoint 'cpint)
          (md:get-event-sequence 0 0))
(-3 -2 0 0 0 5 0 0 4 0 0 0 0 -2 -2 0 0 -3 -2 0 5 4 0 -2 -2 -5 0 0 0 5 0 0 0 4 0
 0 0 3 0 5 -3 -2 -3 0 0 0 -4 2 2 -4 0 0 12 -3 -2 2 2 1 -5 0 2 -2 2 2 1 -3 -2 2
 2 1 -1 1 -3 -2 -3 -2 -2 2 10 0 -3 -2 2 2 1 -5 0 2 -2 2 2 1 -1 -2 -2 -3 0 0 0
 -2 -2 2 2 -4 0)
CL-USER> (viewpoints:viewpoint-sequence
          (viewpoints:get-viewpoint 'ioi-ratio)
          (md:get-event-sequence 0 0))
(1 1/2 1 1 1 2 1/2 1 1 1 1 1 2 1 1/2 1 2 1 1/2 1 2 1/2 1 3 1/3 1 1 1 1 1 1 1 1
 1 1 1 1 1 1 1 1 1 1 1 1 2 1/2 1 1 1 2 3/2 1/3 1 1 1 1 2 1/2 1 1 1 1 1 4 1/4 1
 1 1 1 1 1 1 1 1 1 1 2 1/2 1 1 1 1 1 2 1/2 1 1 1 1 1 2 1/2 1 1 1 1 1 1 1 1 1 2
 1)

Linked viewpoints

Linked viewpoints are represented as a list of component viewpoints. Here is an example of linking pitch interval (cpint) with scale degree (cpintfref):

CL-USER> (viewpoints:viewpoint-sequence
          (viewpoints:get-viewpoint '(cpint cpintfref))
          (md:get-event-sequence 0 0))
((-3 9) (-2 7) (0 7) (0 7) (0 7) (5 0) (0 0) (0 0) (4 4) (0 4) (0 4) (0 4)
 (0 4) (-2 2) (-2 0) (0 0) (0 0) (-3 9) (-2 7) (0 7) (5 0) (4 4) (0 4) (-2 2)
 (-2 0) (-5 7) (0 7) (0 7) (0 7) (5 0) (0 0) (0 0) (0 0) (4 4) (0 4) (0 4)
 (0 4) (3 7) (0 7) (5 0) (-3 9) (-2 7) (-3 4) (0 4) (0 4) (0 4) (-4 0) (2 2)
 (2 4) (-4 0) (0 0) (0 0) (12 0) (-3 9) (-2 7) (2 9) (2 11) (1 0) (-5 7) (0 7)
 (2 9) (-2 7) (2 9) (2 11) (1 0) (-3 9) (-2 7) (2 9) (2 11) (1 0) (-1 11) (1 0)
 (-3 9) (-2 7) (-3 4) (-2 2) (-2 0) (2 2) (10 0) (0 0) (-3 9) (-2 7) (2 9)
 (2 11) (1 0) (-5 7) (0 7) (2 9) (-2 7) (2 9) (2 11) (1 0) (-1 11) (-2 9)
 (-2 7) (-3 4) (0 4) (0 4) (0 4) (-2 2) (-2 0) (2 2) (2 4) (-4 0) (0 0))
CL-USER> (viewpoints:viewpoint-sequence
          (viewpoints:get-viewpoint '(cpintfref dur metaccent))
          (md:get-event-sequence 0 0))
((0 24 5) (9 24 4) (7 12 5) (7 12 3) (7 12 4) (7 12 3) (0 24 5) (0 12 4)
 (0 12 3) (4 12 5) (4 12 3) (4 12 4) (4 12 3) (4 24 5) (2 24 4) (0 12 5)
 (0 12 3) (0 24 4) (9 24 5) (7 12 4) (7 12 3) (0 24 5) (4 12 4) (4 12 3)
 (2 36 5) (0 12 3) (7 12 5) (7 12 3) (7 12 4) (7 12 3) (0 12 5) (0 12 3)
 (0 12 4) (0 12 3) (4 12 5) (4 12 3) (4 12 4) (4 12 3) (7 12 5) (7 12 3)
 (0 12 4) (9 12 3) (7 12 5) (4 12 3) (4 12 4) (4 12 3) (4 24 5) (0 12 4)
 (2 12 3) (4 12 5) (0 12 3) (0 24 4) (0 36 5) (0 12 3) (9 12 5) (7 12 3)
 (9 12 4) (11 12 3) (0 24 5) (7 12 4) (7 12 3) (9 12 5) (7 12 3) (9 12 4)
 (11 12 3) (0 36 5) (9 12 5) (7 12 3) (9 12 4) (11 12 3) (0 12 5) (11 12 3)
 (0 12 4) (9 12 3) (7 12 5) (4 12 3) (2 12 4) (0 12 3) (2 24 5) (0 12 4)
 (0 12 3) (9 12 5) (7 12 3) (9 12 4) (11 12 3) (0 24 5) (7 12 4) (7 12 3)
 (9 12 5) (7 12 3) (9 12 4) (11 12 3) (0 24 5) (11 12 4) (9 12 3) (7 12 5)
 (4 12 3) (4 12 4) (4 12 3) (4 12 5) (2 12 3) (0 12 4) (2 12 3) (4 24 5)
 (0 24 4) (0 36 5))

Listing defined viewpoints

viewpoints:list-viewpoints returns a list of currently defined viewpoints::
CL-USER> (viewpoints:list-viewpoints)
(VIEWPOINTS::ARTICULATION VIEWPOINTS::COMMA VIEWPOINTS::VOICE
                          VIEWPOINTS::ORNAMENT VIEWPOINTS::DYN
...)

Similarly, particular categories of viewpoints can be listed using viewpoints:list-basic, viewpoints:list-derived, viewpoints:list-linked and viewpoints:list-threaded.

The function predictors lists the viewpoints which are derived from (and therefore capable of predicting) the supplied basic viewpoints:

CL-USER> (viewpoints:predictors '(bioi))
(VIEWPOINTS::BIOI-RATIO VIEWPOINTS::BIOI-CONTOUR VIEWPOINTS::BIOI)