Skip to content

Commit

Permalink
pre 0.2 release ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sjcobb committed Oct 25, 2019
1 parent 3330d80 commit aabf06d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion css/bounce.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ button#bounce {
animation: fade-in 2.0s 1;
animation-fill-mode: forwards;
/* animation-delay: 6s; */
animation-delay: 6s;
animation-delay: 12s;
}

@keyframes fade-in {
Expand Down
25 changes: 16 additions & 9 deletions src/js/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import Physics from './Physics.js';

// Tone.Transport.clear()

const MIN_NOTE = 48;
// const MIN_NOTE = 36; //Error: `NoteSequence` has a pitch outside of the valid range: 47
const MIN_NOTE = 48;
const MAX_NOTE = 84;
let pulsePattern = true;

Expand Down Expand Up @@ -254,13 +255,19 @@ function machineKeyDown(note = 60, time = 0) {
let tonalNote = Tonal.Note.fromMidi(note);
let instrMapped = getInstrByInputNote(tonalNote);

// if (instrMapped === undefined && note) {
// console.log('(machineKeyDown) UNDEF -> note: ', note);
// const undefNoteArr = note.split(''); // ERR: note.split is not a function
// note = undefNoteArr[0] + undefNoteArr[2];
// instrMapped = getInstrByInputNote(note);
// }

if (instrMapped === undefined && tonalNote.length === 2) {
// console.log('(machineKeyDown) UNDEF -> note: ', note);
console.log('(machineKeyDown) UNDEF -> tonalNote: ', tonalNote);
const undefNoteArr = tonalNote.split(''); // ERR: note.split is not a function - Eb4
note = undefNoteArr[0] + undefNoteArr[2];
instrMapped = getInstrByInputNote(note);
}

if (instrMapped === undefined) {
instrMapped = getInstrByInputNote('C4');
}

// console.log('(machineKeyDown) -> instrMapped: ', instrMapped);
instrMapped.color = '#ED4A82'; // pink
physics.addBody(true, globals.dropPosX, instrMapped);
}
Expand Down Expand Up @@ -392,7 +399,7 @@ function startSequenceGenerator(seed) {
}

function consumeNext(time) {
console.log('consumeNext -> time: ', time);
// console.log('consumeNext -> time: ', time);
if (generatedSequence.length) {
console.log('consumeNext -> generatedSequence: ', generatedSequence);
let note = generatedSequence.shift();
Expand Down
3 changes: 2 additions & 1 deletion src/js/Physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export default class Physics {
// https://codepen.io/danlong/pen/LJQYYN
zPos += 10; // see globals.staffLineInitZ and globals.staffLineSecondZ
} else {
zPos -= 10;
// zPos -= 10; //PREV
zPos -= 3; //PREV
}
// zPos = options.originalPosition.z;

Expand Down
2 changes: 1 addition & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function addStaffLines(color = 0x000000, offset, posXstart, posXend, posY, posZ,
}
}

const staffLineLengthEnd = 2000;
const staffLineLengthEnd = 8000;
if (globals.keysOnly !== true) {
addStaffLines(0x000000, globals.staffLineInitZ, -1000, staffLineLengthEnd, 0.08, 0, 2);
} else if (globals.keysOnly === true) {
Expand Down

0 comments on commit aabf06d

Please sign in to comment.