Computational Philosophy / Music Composition using Energy Transformations

Music Composition using Energy Transformations

SOCRATES : Music can be composed by thinking of a proposition with two objects and changing whether the melody goes up or down based whether energy is predominantly increased or decreased in the proposition. Give me an example of this.
LUCIAN : Say the first proposition is "The mushrooms are planted." The first note is 'C'. Say the second proposition is "The mushrooms are watered." The water is pouring from a jug onto the plant, indicating a downward movement. Therefore the note goes down from 'C' to 'B'. The other notes are found in this way.


%% ?- changes_to_music([+,+,-,-],Music).
%% Music = [c, d, e, d, c] ;

%% changes_to_music(Changes,Music)
%% Changes - List of +'s or -'s, indicating whether a note should
%% go up or down from the last one, respectively.
%% Music - List of notes

changes_to_music(Changes,Music) :-
changes_to_music1(Changes,[],c,Music).

%% changes_to_music1(Changes,Music1,Music2,Music3)
%% Changes - as for changes_to_music/2
%% Music1 - Current list of notes
%% Music2 - Next note
%% Music3 - List of notes

changes_to_music1([],Music,Music1,Music2) :-
append(Music,[Music1],Music2).
changes_to_music1([+|Changes],Music1,Music2,Music3) :-
music(Music2,Music4),
changes_to_music2(Music1,Music2,Changes,Music4,Music3).
changes_to_music1([-|Changes],Music1,Music2,Music3) :-
music(Music4,Music2),
changes_to_music2(Music1,Music2,Changes,Music4,Music3).

%% changes_to_music2(Music1,Music2,Changes,Music3,Music4)
%% Music1, Music2, Changes - as for changes_to_music1/4
%% Music3 - Next note
%% Music4 - List of notes

changes_to_music2(Music1,Music2,Changes,Music3,Music4) :-
append(Music1,[Music2],Music5),
changes_to_music1(Changes,Music5,Music3,Music4).

%% music(Note,NextNote)
%% Note - First note
%% NextNote - Note about the first note

music(b,c).
music(c,d).
music(d,e).
music(e,f).
music(f,g).
music(g,a).
music(a,b).

Hosted by www.Geocities.ws

1