File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Example: Markov music
3
+ * Demonstrates the use of Markov chains to model musical sequences.
4
+ *
5
+ * The user adds notes to the Markov chain by playing notes ASDFGHJKL
6
+ * on the keyboard. Every note event (note on and note off) is registered
7
+ * as a new node in the graph, and the graph records all transitions
8
+ * between note events as edges along the graph.
9
+ *
10
+ * During playback mode, the algorithm simply traverses the graph randomly,
11
+ * playing notes based on the nodes upon which it traverses.
12
+ *
13
+ * The Markov chain (graph) is visualized as a standard network of nodes,
14
+ * with transitions represented by edges between nodes. The current/latest
15
+ * node as well as the edges of its previously recorded transitions are
16
+ * highlighted.
17
+ */
18
+
1
19
// Music
2
20
var synth ;
3
21
var velocity = 0.7 ; // From 0-1
You can’t perform that action at this time.
0 commit comments