<div dir="ltr"><div><div><div>What I meant about (time,[-88,88]) --> X,Y is that a tone is very similiar to the same tone one octave up and one octave down.<br></div><div>This introduces problems because your tone space is not flat (like [1,88]). Therefore you may want to models this using a third dimension.<br>
<br></div><div>However you can somehow only use 2D and introduce this octave knowledge in your distance/measure functions.<br><br></div><div> for the time I wouldn't discretize it (convert to int), because in classical music for instance the tempo is constantly fluctuating during all the play<br>
, so if you define time has regularly spaced notes, your going to loose a lot's of knowledge. Moreover, you have nothing to gain by doing this. All PostGis function work on X as a float (double in fact).<br><br></div>
<div>What this modelisation is going to do is exactly what you would obtain if you draw a line between the note on the score (the behavior of what you want is not clear for chords tough).<br></div><div><br></div><div>I did use PLR, <br>
</div>it works very well and is very handy.<br></div><div>I would recommend writting the R in RStudio with fake data for test, then port it to PL/R. <br>Be carefull wrong operation may crash the server at first.<br><br><br>
</div>I did clustering, which you could also do on your not as X,Y points. For this you need a measure of distance, you can simply take euclidian distance (regular postgis distance) for a start.<br><br></div>Cheers,<br>Rémi-C<br>
<div><br><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-27 18:38 GMT+02:00 Lee R <span dir="ltr"><<a href="mailto:sregdoreel@gmail.com" target="_blank">sregdoreel@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class=""><br>On Monday, August 25, 2014 4:46:11 AM UTC-4, Rémi Cura wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div>You want to map your dimension<br></div>(time, note_pitch) to (X,Y) ?<br><br>It seems really difficult to achieve if for instance you would consider a C and a C up an octave closer than a C and a D.<br>

<br>And if you consider<br></div>(time,note_pitch) to (X=time, Y = [A-G], Z = [1-8]) ,<br></div>Lot's of function in postgis doesn't work well with Z.<br></div></div></div></blockquote><div><br></div></div><div>Fortunately we can map musical notes as 1-12 instead of A - G, or for that matter 1-88.  As "vectors" the notes can range from -88 to 88 (keys on the piano), bounded somewhat by abs( vector1+vector2+vector3 ) <= 88. <br>
<br>In other words instead of an X,Y coordinate system, a musical note is 1 dimension (y), time the 2nd dimension (x). Analyzed as a directed path (geometrically left to right .. ) the query would be analyzing time instead of a physical "x" coordinate (i.e. longitude).<br>
<br>So if "X" is time & "Y" is pitch, can I quantize time by arbitrarily discrete amounts & still get usable results? Say for example we establish the 1/32nd note as being the smallest duration, then everything would be an integer multiple of that. It's surely not a perfect model, but a cartesian reduction of a certain problem for quick analyses. <br>
<br>An example of what I'm thinking: Using multilines, it could be possible to observe where a melody & it's counterpoint harmony cross over. Or draw a chord as a polygon & see where a melodic line crosses through it.<br>
<br>I wondering what other types of metrics I can derive from a cartesian geometry? <br><br>For instance, I gather PostGIS can find polylines ranked by similarity? If so this could be superior to my trigram dictionary attack method, or bothering with an FP-Growth algorithm.<br>
<br></div><div dir="ltr"><div class=""><div>> Moreover, distance between geometry (serei of not ein your case) in postgis are rather limited to <br>> _what you can come up with <br>> _<code><b>ST_HausdorffDistance</b>() <br>
</code></div><div><code>> (you could use R to create your own distances)<br></code></div><code></code></div><div><br>TY for the pointer. <br><br>I'm very much considering using R as a stored procedure language to work over these data.<div class="">
<br><br>> I'm not an expert but lots of work in GIS rearch is devoted to time serie, mainly GPS trace (X,Y,Z,timestamp).<br>> It seems that Grass GIS has a module for it : <a href="http://grasswiki.osgeo.org/wiki/Time_series" target="_blank">http://grasswiki.osgeo.org/<u></u>wiki/Time_series</a><br>
<br></div></div><div>Yeh, that's the USACE GIS db. Another thing to look into... :)<br><br>Thanks!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>--Lee</div></font></span></div></div></blockquote>
</div><br></div>