Viewpoints - mtpearce/idyom GitHub Wiki
Viewpoints are representations of musical structure. A number of functions are provided to help the user work with viewpoints and viewpoint data.
The implemented viewpoints are described in Pearce (2005) and implemented in the idyom/viewpoints/
directory. It is quite easy to implement new viewpoints, the examples in the code and Adding Viewpoints should help you get started.
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> (vp:viewpoint-sequence 'cpitch (mo:get-music-objects 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)
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> (vp:viewpoint-sequence 'cpint (mo:get-music-obects 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> (vp:viewpoint-sequence 'ioi-ratio (mo:get-music-objects 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 are represented as a list of component viewpoints. Here is an example of linking pitch interval (cpint) with scale degree (cpintfref):
CL-USER> (vp:viewpoint-sequence '(cpint cpintfref) (mo:get-music-obects 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> (vp:viewpoint-sequence '(cpintfref dur metaccent) (mo:get-music-objects 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))
vp:list-viewpoints
returns a list of currently defined viewpoints::
CL-USER> (vp:list-viewpoints)
(VIEWPOINTS::ARTICULATION VIEWPOINTS::COMMA VIEWPOINTS::VOICE
VIEWPOINTS::ORNAMENT VIEWPOINTS::DYN
...)
Similarly, particular categories of viewpoints can be listed using vp:list-basic
, vp:list-derived
, vp:list-linked
and vp:list-threaded
.
The function vp:predictors
lists the viewpoints which are derived from (and therefore capable of predicting) the supplied basic viewpoints:
CL-USER> (vp:predictors '(bioi))
(VIEWPOINTS::BIOI-RATIO VIEWPOINTS::BIOI-CONTOUR VIEWPOINTS::BIOI)