dada.distances

Discussions, advice, bug reports and much more about the "dada" environment.
Post Reply
belljonathan
Posts: 11
Joined: Fri Mar 24, 2017 12:48 pm

dada.distances

Post by belljonathan » Sat May 16, 2020 9:40 pm

Hi,

I've nearly managed to use dada.distances, it's great!

However: while trying to retrieve the entries integer from second outlet (my table's called "mypresets", so entries are like "mypreset_id $1" in the dada.base), I get one of those for answers:
mypreset_id 0,
mypreset_id 1
mypreset_id
mypreset_id -1
instead of an integer between 0 and 50, as I have 50 entries.

As a workaround, I retrieve the features of each entry directly, but I have 11 features, and it seems I can only retrieve 10?

I did something wrong, and I should just try again? :)

Finally, to compute distances between points, I've used mubu.knn, does it sound like an appropriate tool? dada.distance doesn't come with an embedded tool for that, or does it?

Many thanks,

Jonathan

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: dada.distances

Post by danieleghisi » Sun May 17, 2020 5:41 pm

Hi Jonathan, the thing you say about the integer output sounds very weird. Can you please post a minimal patch, so that I can look into it?
On the other hand, you should already have the distance between all your points, since you built the distance table, am I missing something?

belljonathan
Posts: 11
Joined: Fri Mar 24, 2017 12:48 pm

Re: dada.distances

Post by belljonathan » Mon May 18, 2020 5:20 pm

Hi Daniele,

Thanks for getting back. Yes I think the distances work fine. I hope it's ok if I send a link to my db:
https://docs.google.com/document/d/18h2 ... iEX5w/edit

I tried again, but contentfield mypreset_id isn't giving me what I expect

{
"boxes" : [ {
"box" : {
"maxclass" : "message",
"text" : "hover none",
"style" : "",
"numoutlets" : 1,
"patching_rect" : [ 764.0, 714.0, 71.0, 22.0 ],
"outlettype" : [ "" ],
"id" : "obj-7",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "bach.portal @out m",
"style" : "",
"numoutlets" : 2,
"patching_rect" : [ 1019.0, 714.0, 115.0, 22.0 ],
"outlettype" : [ "", "bang" ],
"id" : "obj-5",
"numinlets" : 1,
"saved_object_attributes" : {
"versionnumber" : 80100
}

}

}
, {
"box" : {
"maxclass" : "message",
"text" : "contentfield mypreset_id",
"style" : "",
"numoutlets" : 1,
"patching_rect" : [ 803.0, 94.0, 141.0, 22.0 ],
"outlettype" : [ "" ],
"id" : "obj-4",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "read",
"style" : "",
"numoutlets" : 1,
"patching_rect" : [ 620.0, 66.0, 50.0, 22.0 ],
"outlettype" : [ "" ],
"id" : "obj-2",
"numinlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "dada.base didist",
"style" : "",
"numoutlets" : 2,
"patching_rect" : [ 644.0, 127.0, 103.0, 22.0 ],
"outlettype" : [ "", "bang" ],
"presentation" : 1,
"id" : "obj-116",
"numinlets" : 1,
"presentation_rect" : [ 445.000061, 53.0, 98.0, 22.0 ]
}

}
, {
"box" : {
"maxclass" : "dada.distances",
"maxdistedge" : 2.54,
"query" : "SELECT * FROM mypresets",
"numoutlets" : 4,
"distancetable" : "dists",
"zoom" : 1172.390846,
"versionnumber" : 10200,
"patching_rect" : [ 783.0, 127.0, 727.0, 573.0 ],
"center" : [ 13.124754, -9.571735 ],
"outlettype" : [ "", "", "", "bang" ],
"presentation" : 1,
"id" : "obj-30",
"numiter" : 1627,
"numinlets" : 1,
"presentation_rect" : [ 11.0, 73.0, 1417.0, 747.0 ],
"database" : "didist",
"contentfield" : [ "mypreset_id" ],
"table" : "mypresets",
"out" : "nnn"
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-7", 1 ]
}

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

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

}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-116", 0 ]
}

}
],
"appversion" : {
"major" : 7,
"minor" : 3,
"revision" : 6,
"architecture" : "x64",
"modernui" : 1
}
,
"styles" : [ {
"name" : "AudioStatus_Menu",
"default" : {
"bgfillcolor" : {
"type" : "color",
"color" : [ 0.294118, 0.313726, 0.337255, 1 ],
"color1" : [ 0.454902, 0.462745, 0.482353, 0.0 ],
"color2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"angle" : 270.0,
"proportion" : 0.39,
"autogradient" : 0
}

}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "Default 11Bold Poletti",
"default" : {
"fontsize" : [ 11.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "Default M4L",
"default" : {
"patchlinecolor" : [ 0.290196, 0.309804, 0.301961, 0.85 ],
"fontsize" : [ 11.0 ],
"fontname" : [ "Arial Bold" ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "Default M4L Poletti",
"default" : {
"patchlinecolor" : [ 0.290196, 0.309804, 0.301961, 0.85 ],
"fontsize" : [ 10.0 ],
"fontname" : [ "Arial Bold" ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "Default M4L-1",
"default" : {
"fontface" : [ 1 ],
"fontsize" : [ 11.0 ],
"bgfillcolor" : {
"type" : "gradient",
"color1" : [ 0.376471, 0.384314, 0.4, 1.0 ],
"color2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"angle" : 270.0,
"proportion" : 0.39
}
,
"fontname" : [ "Arial" ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "Default Max7 Poletti",
"default" : {
"bgfillcolor" : {
"type" : "gradient",
"color1" : [ 0.376471, 0.384314, 0.4, 1.0 ],
"color2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"angle" : 270.0,
"proportion" : 0.39
}

}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "jbb",
"default" : {
"fontsize" : [ 9.0 ],
"bgfillcolor" : {
"type" : "gradient",
"color1" : [ 0.376471, 0.384314, 0.4, 1.0 ],
"color2" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"color" : [ 0.290196, 0.309804, 0.301961, 1.0 ],
"angle" : 270.0,
"proportion" : 0.39
}
,
"fontname" : [ "Arial" ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "ksliderWhite",
"default" : {
"color" : [ 1.0, 1.0, 1.0, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "maxscore.default.buttons",
"default" : {
"accentcolor" : [ 1.0, 1.0, 1.0, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "newobjBlue-1",
"default" : {
"accentcolor" : [ 0.317647, 0.654902, 0.976471, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "newobjGreen-1",
"default" : {
"accentcolor" : [ 0.0, 0.533333, 0.168627, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
, {
"name" : "numberGold-1",
"default" : {
"accentcolor" : [ 0.764706, 0.592157, 0.101961, 1.0 ]
}
,
"parentstyle" : "",
"multi" : 0
}
]
}

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: dada.distances

Post by danieleghisi » Thu May 28, 2020 2:42 pm

Hi Jonathan, you're right, that is a bug, it only affects _id columns.
Fixed for next release, thank you.
For the time being, you can perhaps create a column to copies the id?

Post Reply