Skip to content

Commit

Permalink
Fix javascript constructor properties
Browse files Browse the repository at this point in the history
  • Loading branch information
dubreuia committed Feb 19, 2020
1 parent 343bf80 commit be376c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 9 additions & 8 deletions Chapter08/chapter_08_example_03.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ <h1>Music Generation With Magenta.js - MusicVAE example</h1>
// bass drum), the bass and the lead.
class Player extends mm.BasePlayer {

bassDrumSynth = new mm.Player.tone.MembraneSynth().toMaster();

bassSynth = new mm.Player.tone.Synth({
volume: 5,
oscillator: {type: "triangle"}
}).toMaster();

leadSynth = new mm.Player.tone.PolySynth(5).toMaster();
constructor() {
super();
this.bassDrumSynth = new mm.Player.tone.MembraneSynth().toMaster();
this.bassSynth = new mm.Player.tone.Synth({
volume: 5,
oscillator: {type: "triangle"}
}).toMaster();
this.leadSynth = new mm.Player.tone.PolySynth(5).toMaster();
}

// Plays the note at the proper time using tone.js
playNote(time, note) {
Expand Down
17 changes: 9 additions & 8 deletions Chapter08/chapter_08_example_04.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ <h1>Music Generation With Magenta.js - MusicVAE + GANSynth</h1>
// bass drum), the bass and the lead.
class Player extends mm.BasePlayer {

bassDrumSynth = new mm.Player.tone.MembraneSynth().toMaster();

bassSynth = new mm.Player.tone.Synth({
volume: 5,
oscillator: {type: "triangle"}
}).toMaster();

leadSynth = null;
constructor() {
super();
this.bassDrumSynth = new mm.Player.tone.MembraneSynth().toMaster();
this.bassSynth = new mm.Player.tone.Synth({
volume: 5,
oscillator: {type: "triangle"}
}).toMaster();
this.leadSynth = null;
}

// Plays the note at the proper time using tone.js
playNote(time, note) {
Expand Down

0 comments on commit be376c1

Please sign in to comment.