Skip to content

Commit

Permalink
#148 top scrollbar mousearea
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesholdenmusic committed Feb 23, 2024
1 parent f2fb4be commit 70a4dba
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 16 deletions.
12 changes: 7 additions & 5 deletions audio_blocks/seq.sample.tracker.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
"groups" : [
{
"contains" : [0,1,2,3,4,5],
"colour" : [255,255,255]
"colour" : 10
},
{
"contains" : [6,7]
"contains" : [6,7],
"height" : 0
},
{
"contains" : [8,9,10],
"colour" : -20,
"colour" : -10,
"height" : 0
}
],
Expand Down Expand Up @@ -62,7 +63,7 @@
},
{
"name" : "loop_enable",
"type" : "menu_i",
"type" : "menu_l",
"values" : ["oneshot", "loop"],
"wrap" : 0,
"default" : 0.6
Expand Down Expand Up @@ -97,8 +98,9 @@
},
{
"name" : "midi_in",
"type" : "menu_i",
"type" : "menu_l",
"values" : ["play", "record"],
"force_label" : 1,
"wrap" : 0,
"default" : 0.25
},
Expand Down
6 changes: 3 additions & 3 deletions code/mouse_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,12 +1087,12 @@ function toggle_panel(parameter,value){
}
function scroll_sidebar(parameter,value){
if(value=="get"){
return -sidebar.scroll.position/300;
return -sidebar.scroll.position/400;
}else if(value=="rel"){
sidebar.scroll.position = Math.min(Math.max(0,sidebar.scroll.position-parameter*100),sidebar.scroll.max-0.01);
sidebar.scroll.position = Math.min(Math.max(0,sidebar.scroll.position-parameter*1000),sidebar.scroll.max-0.01);
redraw_flag.flag |= 2;
}else{
sidebar.scroll.position = Math.min(Math.max(0,-value*300),sidebar.scroll.max-0.01);
sidebar.scroll.position = Math.min(Math.max(0,-value*400),sidebar.scroll.max-0.01);
redraw_flag.flag |= 2;
}
}
Expand Down
2 changes: 1 addition & 1 deletion note_blocks/seq.note.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function mouse(x,y,lb,sh,al,ct,scr){
}
}
}else if(y<sy){//top rows
if(y<sy-uy){//very top, voice select
if(y<sy-unit*0.6){//very top, voice select
selected_voice = Math.floor(v_list.length*x/width);
drawflag = 1;
}else{//timeline (a timeline? in this software? call it something else please you imperialist pig)
Expand Down
21 changes: 19 additions & 2 deletions note_blocks/seq.values.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
{
"contains" : [1],
"colour" : 10,
"onepervoice" :1
"onepervoice" :1,
"height" : 0
},
{
"contains" : [4],
"contains" : [4,4,4,5,6],
"height" : 0
}
],
Expand Down Expand Up @@ -80,6 +81,22 @@
"values" : [ "trigger only", "trig vel -> output value" ],
"wrap" : 1,
"default" : 0.25
},
{
"name" : "<_back",
"type" : "button",
"default" : 0,
"error_scale" : 0,
"wrap" : 0,
"values" : ["voices","<_back",-1]
},
{
"name" : ">_fwd",
"type" : "button",
"default" : 0,
"error_scale" : 0,
"wrap" : 0,
"values" : ["voices",">_fwd", 1]
}
]
}
Expand Down
89 changes: 84 additions & 5 deletions note_blocks/seq.values.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
,
"classnamespace" : "box",
"rect" : [ 134.0, 134.0, 1061.0, 595.0 ],
"rect" : [ 34.0, 76.0, 1061.0, 595.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
Expand Down Expand Up @@ -39,6 +39,42 @@
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ {
"box" : {
"id" : "obj-67",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 23.0, 393.0, 29.5, 22.0 ],
"text" : "+ 0"
}

}
, {
"box" : {
"id" : "obj-66",
"maxclass" : "newobj",
"numinlets" : 3,
"numoutlets" : 3,
"outlettype" : [ "", "", "" ],
"patching_rect" : [ 742.0, 108.0, 85.0, 22.0 ],
"text" : "routepass 1 -1"
}

}
, {
"box" : {
"id" : "obj-30",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 652.0, 82.0, 109.0, 22.0 ],
"text" : "route voice_details"
}

}
, {
"box" : {
"id" : "obj-31",
"maxclass" : "newobj",
Expand Down Expand Up @@ -1306,10 +1342,6 @@
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 38.75, 754.0, 35.0, 22.0 ],
"saved_object_attributes" : {
"attr_comment" : ""
}
,
"text" : "out 1"
}

Expand Down Expand Up @@ -1346,6 +1378,10 @@
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 489.0, 17.0, 28.0, 22.0 ],
"saved_object_attributes" : {
"attr_comment" : ""
}
,
"text" : "in 1"
}

Expand Down Expand Up @@ -1420,6 +1456,14 @@
"source" : [ "obj-15", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-67", 1 ],
"order" : 2,
"source" : [ "obj-15", 0 ]
}

}
, {
"patchline" : {
Expand Down Expand Up @@ -1577,6 +1621,13 @@
"source" : [ "obj-29", 1 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-66", 0 ],
"source" : [ "obj-30", 1 ]
}

}
, {
"patchline" : {
Expand Down Expand Up @@ -1668,6 +1719,13 @@
"source" : [ "obj-39", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-30", 0 ],
"source" : [ "obj-39", 3 ]
}

}
, {
"patchline" : {
Expand Down Expand Up @@ -1964,6 +2022,27 @@
"source" : [ "obj-65", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-67", 0 ],
"source" : [ "obj-66", 1 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-67", 0 ],
"source" : [ "obj-66", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-15", 3 ],
"source" : [ "obj-67", 0 ]
}

}
, {
"patchline" : {
Expand Down

0 comments on commit 70a4dba

Please sign in to comment.