Skip to content

Commit

Permalink
#226 qwertmidi octave display
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesholdenmusic committed Apr 14, 2024
1 parent 7d2ceec commit cdae1c2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions code/blockmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ var automap = {

var qwertym = {
octave : 4,
octf : 4,
vel : 100
}

Expand Down
14 changes: 14 additions & 0 deletions code/display_pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6114,6 +6114,20 @@ function draw_automap_headers(y_offset, sx, block) {
lcd_main.message("write", midiins[ti]);
sx += bw2;
}
if(usermouse.caps){
var bw2 = fo1 * 14;
var ex = sx + bw2 - fo1;
lcd_main.message("paintrect", sx, y_offset, ex, y_offset + fontheight * 0.5, automap.colours_k.dark);
click_zone(qwertymidi_octave, null, null, sx, y_offset, ex, y_offset + fontheight * 0.5, mouse_index, 2);
lcd_main.message("frgb", automap.colours_k.darkest);
lcd_main.message("moveto", sx + fo1, y_offset + 0.25 * fontheight);
lcd_main.message("write", "octave");
lcd_main.message("frgb", automap.colours_k.colour);
lcd_main.message("moveto", sx + fo1, y_offset + 0.4 * fontheight);
lcd_main.message("write", qwertym.octave);
sx += bw2;

}

if ((sx < sidebar.x + (sidebar.width) / automap.count)) {
var osx = sx;
Expand Down
7 changes: 3 additions & 4 deletions code/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ function omouse(x,y,leftbutton,ctrl,shift,caps,alt,e){
usermouse.shift = shift;
usermouse.ctrl = ctrl;
usermouse.alt = alt;
//if(usermouse.caps!=caps){
usermouse.caps = caps;
// redraw_flag.flag |= 2; //so the qwertymidi indicator gets drawn
//}
if(usermouse.caps!=caps) redraw_flag.flag |= 2; //so the qwertymidi indicator gets drawn
usermouse.caps = caps;

usermouse.x = x;
usermouse.y = y;
usermouse.sidebar_scrolling = null;
Expand Down
13 changes: 13 additions & 0 deletions code/mouse_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,19 @@ function data_edit(parameter,value){
redraw_flag.flag |= 2;// was 4?
}
}

function qwertymidi_octave(parameter, value){
if(value=="get"){
var t = Math.floor(qwertym.octf * 12);
if(t!=qwertym.octave) qwertym.octf = qwertym.octave/12;
return(qwertym.octf);
}else{
value = Math.max(0,Math.min(0.9999999,value));
qwertym.octf = value;
qwertym.octave = Math.floor(value*12);
redraw_flag.flag |= 2;
}
}

function sidebar_parameter_knob(parameter, value){
//post("\nP: ",parameter," V:",value);
Expand Down

0 comments on commit cdae1c2

Please sign in to comment.