How to create smooth scaling from midi to number
Hi. Forgive my density. I am looking to turn a knob on my midi controller to sweep through the time it takes to play through a buffer with the groove~ object. For example, with the groove~ object you can change via a number box how fast or slow it plays through the buffer. I'm looking to go from say -8.0 to 8.0 (-8.0 x normal speed to 8.0x normal speed). The problem I'm having is that when using the scaling object in conjunction with the midi output (0-127), it is extremely jumpy. I'm looking to smooth that out to intervals of .01. I've tried using the line object in conjunction with the scaling object but to no avail. I've seen a number of posts on this but it is not working. I'm so dang frustrated. I've tried using the pack object with the line object but it doesn't accept the format that the line object is looking for. Can somebody please please help?!
Here is just a snippet of the patch. Thanks in advance!
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 7,
"minor" : 0,
"revision" : 3,
"architecture" : "x86",
"modernui" : 1
}
,
"rect" : [ 296.0, 211.0, 640.0, 480.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 1,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 1,
"objectsnaponopen" : 1,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"lefttoolbarpinned" : 0,
"toptoolbarpinned" : 0,
"righttoolbarpinned" : 0,
"bottomtoolbarpinned" : 0,
"toolbars_unpinned_last_save" : 0,
"tallnewobj" : 0,
"boxanimatetime" : 200,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"boxes" : [ {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-7",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 177.0, 208.0, 36.0, 22.0 ],
"style" : "",
"text" : "pack"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-6",
"maxclass" : "number",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 173.0, 296.0, 50.0, 22.0 ],
"style" : ""
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-3",
"maxclass" : "newobj",
"numinlets" : 3,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 177.0, 256.0, 46.0, 22.0 ],
"style" : "",
"text" : "line"
}
}
, {
"box" : {
"fontface" : 0,
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-2",
"maxclass" : "newobj",
"numinlets" : 6,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 173.0, 140.0, 96.0, 22.0 ],
"style" : "",
"text" : "scale 0 127 -8 8"
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-1",
"maxclass" : "number",
"maximum" : 127,
"minimum" : 0,
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 173.0, 104.0, 50.0, 22.0 ],
"style" : ""
}
}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-1", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-7", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-2", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-6", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-3", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"disabled" : 0,
"hidden" : 0,
"source" : [ "obj-7", 0 ]
}
}
],
"dependency_cache" : [ ],
"embedsnapshot" : 0
}
}
Hi Scott, you've just encountered the difference between float and int. Once you make sure the objects are outputting/handling numbers as floats rather than ints, then you're solution is a good one.
Also, use Edit > Copy Compressed when sharing patches. It'll make your posts easier to read--and maybe more likely for someone to respond.
Thank you so much! I appreciate the time that you took to answer my post. I tried like crazy to make something like this work. What is the f in the pack stand for? I ended up downloading an external package called smooth-line that seemed to work too. Yours seems the exact same so I don't know what the smooth-line object does. Oh well, thanks so much. It's tough not having a local support group. Maybe I should start one here in Detroit. Have a great day.
One more thing. I guess I don't understand how the number from the scale object and the number combine in only one inlet on the line object to create the smoothing. Perhaps you could explain.
Hi Scott, the f stands for float. It ensures that the pack object sends out floating-point numbers and not just integers. Take a look at the line object help file to answer your second question, particularly the 'lists and ramps' tab. There you'll see that the line object will accept a list of two numbers (this is what the pack does--combines 2 numbers into a list): the first number is the destination and the second number is the time to take to get there. Hope this helps.
Thanks Holland for your time! It is greatly appreciated. I didn't see the lists and ramps tab on the help file. I need to be more cognizant of all the tabs and views.