diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 7da2d980..cf7db677 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -119,7 +119,7 @@ MODOPT={--Mod options }, {no=19,id="CS",name="customSeq", key="b",x=680,y=470,color="blue", - list={"bag","his4","rnd","reverb"}, + list={"bag","his4","c2","rnd","reverb"}, func=function(P,O)P.gameEnv.sequence=O end, unranked=true, }, diff --git a/parts/player/prepareSequence.lua b/parts/player/prepareSequence.lua index b44283d6..aa5f6f35 100644 --- a/parts/player/prepareSequence.lua +++ b/parts/player/prepareSequence.lua @@ -36,6 +36,26 @@ local sequenceModes={ yield() end end, + c2=function(P,seq0) + local len=#seq0 + local weight={} + for i=1,len do weight[i]=0 end + + while true do + while #P.nextQueue<6 do + local maxK=1 + for i=1,len do + weight[i]=weight[i]*.5+P:RND() + if weight[i]>weight[maxK]then + maxK=i + end + end + weight[maxK]=weight[maxK]/3.5 + P:getNext(seq0[maxK]) + end + yield() + end + end, rnd=function(P,seq0) P:getNext(seq0[rnd(#seq0)]) while true do diff --git a/parts/scenes/custom_sequence.lua b/parts/scenes/custom_sequence.lua index 981dc7cc..80bf7d90 100644 --- a/parts/scenes/custom_sequence.lua +++ b/parts/scenes/custom_sequence.lua @@ -190,7 +190,7 @@ scene.widgetList={ WIDGET.newSelector{name="sequence", x=1080,y=60,w=200,color="yellow", - list={"bag","his4","rnd","reverb","loop","fixed"}, + list={"bag","his4","c2","rnd","reverb","loop","fixed"}, disp=lnk_CUSval("sequence"), code=lnk_CUSsto("sequence") },