-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample-playing-melodies.js
71 lines (48 loc) · 2.2 KB
/
example-playing-melodies.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// --------------------------------------------------------------------------
// -- example-playing-melodies.js
// -- initial author: Renick Bell ([email protected])
// -- initial creation date: Wed Jun 28 10:08:48 AM CST 2023
// -- contributors: Yiler Huang ([email protected]); Steve Wang ([email protected])
// -- license: GPL 3.0
// --------------------------------------------------------------------------
updateMidiOutputList(e)
//e.changeTempo(250)
e.play('musicSynthesizerSession1')
e.play('musicSynthesizerSession3')
e.play('musicSynthesizerSession4')
e.play('musicSynthesizerSession2')
// messageAllClients({action: 'animationExample'})
e.stopAll()
e.stop('musicSynthesizerSession3')
e.currentBeat()
updateMidiInputList(e)
receiveMessagesFromInput(e, 1, 1, true, 100)
e.recordedMessages['m1'] = e.inputs[1].recordedMessages
e.messageMaps['testios'] = ['m1']
//use an L-system to create a melod:
//keys in L system represent scale degree or operations in scale degree
//Avoid disonace.
//Solution: handleDissonance function checks for disonace and flags it and blocks it. Changes it to 0. Prevents disonance from playing.
//Status: complete.
//Longer melody that sounds like is leading to something.
//Solution: Make one part of the melody louder and quicker.
//Status: complete
//Be able to live code from another file.
//Solution: fs.watchFile
//Status: complete. RUn code below and will change randomMelody1.
//Connect to SVG.js. Circles show when trhere is sound and bigger circle for bigger volume.
//Solution: websocket.
//Status: complete.
//do another one based on lsystem
/*
store melodies by name in musical environment
use playername to check which melody should be played
play on emeody for 64 beats
quantized map that includes times and melody name
prepare a presentation to explain how I use an lsystem to make a melody
easy to read print out of the musical environment
*/
// let twelveBarsConfa = assignChordProgressionToPlayer('p1', 'twelveBars')
// recordConfigurationDataIntoMusicalEnvironment(twelveBarsConfa, 'p1', e)
// assignPlayerForMusicSynthesizerSession(e, 3, {rhythmMapName: 'straight'}, defaultName)
// player.currentChordProgression = correctCurrentChordProgression