Skip to content

Commit

Permalink
changed note play and select
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 28, 2021
1 parent 5a7e84f commit a2e1685
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ exports.SCENE_BUTTONS = [54,55,44,45];
exports.BIG_GRID = [14,23,32,41,51,62,73,84,85,76,67,58,48,37,26,15];
exports.INNER_GRID = [24,33,42,52,63,74,75,66,57,47,36,25];
exports.SMALL_GRID = [34,43,53,64,65,56,46,35];
exports.CHORD_PLAY_MODE_BUTTONS = [81,82,83,84,85,86,87];
exports.CHORD_PLAY_MODE_BUTTONS = [81,82,83,84,85,86];

exports.CHORD_SCALE_BUTTONS = [18,28,38,48,58,68,78];
exports.CHORD_SCALE_BUTTONS = [18,28,38,48,58,68];

exports.SCENE_STACK_LIMIT = 5

Expand Down
3 changes: 1 addition & 2 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ exports.setupScenes = () => {
return scenes;
};


exports.render = () => {
render.render(scenes, state);
};
Expand Down Expand Up @@ -196,7 +195,7 @@ const setupSceneTracks = () => {
};

const playNote = (pressed, button) => {
if(state.pressedButtons[0] == cons.SHIFT_BUTTON && cons.INNER_GRID.indexOf(button) != -1){
if(state.pressedButtons.length <= 1 && cons.INNER_GRID.indexOf(button) != -1){
var midiMessage = pressed ? 'noteon' : 'noteoff';
io.getOutput().send(midiMessage, {note: state.currentOctave * 12 + cons.INNER_GRID.indexOf(button) ,velocity: 127,channel: state.currentTrack});
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ exports.toogleSingleTriplet = (state,scenes) => {
};

exports.toogleNote = (state,scenes) => {
if(state.pressedButtons.length == 1 && cons.INNER_GRID.indexOf(state.pressedButtons[0]) != -1 && state.workspace > 0){
var note = cons.INNER_GRID.indexOf(state.pressedButtons[0]);
if( state.pressedButtons[0] == cons.SHIFT_BUTTON && cons.INNER_GRID.indexOf(state.pressedButtons[1]) != -1 && state.workspace > 0){
var note = cons.INNER_GRID.indexOf(state.pressedButtons[1]);
scenes[state.currentScene].tracks[state.currentTrack].pattern[state.lastPressedStep].notes[(state.currentOctave * 12) + note] ^= true;
}
};
Expand Down

0 comments on commit a2e1685

Please sign in to comment.