On Thursday den 23. May 2013 at 14.46, Jeremy Leonard wrote:
Sure, here they are. There is only one file to be changed.The current problem is, that the analyzed track data isn't correctlyconverted to a byte array.--- DistanceCalculator.cs 2013-04-05 04:58:23.000000000 +0200+++ DistanceCalculator.cs 2013-05-22 20:39:16.834218266 +0200@@ -47,13 +47,20 @@internal static string notify_string =AddinManager.CurrentLocalizer.GetString ("The Mirage extension is stillanalyzing your songs. Until its finished, shuffle and fill by similarmay not perform properly.");+ // static members for distance function+ private static Scms empty_scms = newScms(Analyzer.MFCC_COEFFICIENTS);+ private static int scms_size = empty_scms.ToBytes().Count();+private static object Distance (object seed_id_obj, objectscms_obj){BaseSimilarityContext context;if (!seeds.TryGetValue (Convert.ToInt32 (seed_id_obj), outcontext))throw new ArgumentException ("seed_id not found","seed_id_obj");- var scms_bytes = scms_obj as byte[];+ // copy pointer to byte array using number of bytes fromempty scms+ var scms_bytes = new byte[scms_size];+ System.Runtime.InteropServices.Marshal.Copy((IntPtr)scms_obj, scms_bytes, 0, scms_size);+if (scms_bytes == null) {// TODO raise an event to notify the user (one timeonly) that// there are un-analyzed tracks?@@ -65,7 +72,8 @@Scms.FromBytes (scms_bytes, context.ComparisonScms);total_read_ms += (DateTime.Now - start).TotalMilliseconds;- float distance = context.Distance(context.ComparisonScms).Average ();+ // using float here throws a cast exception+ double distance = context.Distance(context.ComparisonScms).Average ();total_ms += (DateTime.Now - start).TotalMilliseconds;total_count++;Am 23.05.2013 00:00, schrieb Andres G. Aragoneses:On 22/05/13 20:32, Jeremy Leonard wrote:Hello,executing Banshee in random by similar mode with the --debug-mirageswitch, I always got the same huge average weighted distance for everysong, and the selected songs were not at all similar.[Info 21:08:57.808] Running Banshee 2.4.1: [Ubuntu 12.04 LTS(linux-gnu, x86_64) @ 2012-07-17 02:26:43 UTC]Avoided artist ids =Seed Distances:Average weighted distance:340.282.300.000.000.000.000.000.000.000.000.000.000,0>>>>>>>>>>>>>> Total ms spent in Distance func: 0 ms - spent reading: 0ms; total calls: 0>>>>>>>>>>>>>> Distance [min, max] = [3,402823E+38, 0]After downloading the latest source from git and making some minor codechanges, the distance calculation now seems to work:[5 Warn 22:15:31.196] Executed in 1450ms SELECT...Avoided artist ids = 342, 444, 444, 802Seed Distances:Skipped/Discarded seeds (weight 0,1)distance: 15,9, weighted: 159,2 from artist_id 342, urifile://...distance: 17,6, weighted: 175,9 from artist_id 444, urifile://...distance: 14,4, weighted: 144,2 from artist_id 444, urifile://...distance: 14,2, weighted: 141,7 from artist_id 802, urifile://...Average weighted distance: 155,3>>>>>>>>>>>>>> Total ms spent in Distance func: 1226,45199999996 ms -spent reading: 456,079000000002 ms; total calls: 9591>>>>>>>>>>>>>> Distance [min, max] = [3,551699, 4452,018]Has anyone else noticed this behaviour in other releases/platforms?Kind regards,JeremyCan you share the code changes you made?_______________________________________________banshee-list mailing listhttps://mail.gnome.org/mailman/listinfo/banshee-list (unsubscribe here)_______________________________________________banshee-list mailing listhttps://mail.gnome.org/mailman/listinfo/banshee-list (unsubscribe here)