{"id":1446,"date":"2010-12-23T19:59:20","date_gmt":"2010-12-23T09:59:20","guid":{"rendered":"http:\/\/www.somethinkodd.com\/oddthinking\/?p=1446"},"modified":"2010-12-23T19:59:20","modified_gmt":"2010-12-23T09:59:20","slug":"playing-sharps-and-flats-naturally","status":"publish","type":"post","link":"https:\/\/www.somethinkodd.com\/oddthinking\/2010\/12\/23\/playing-sharps-and-flats-naturally\/","title":{"rendered":"Playing Sharps and Flats Naturally"},"content":{"rendered":"<p>One of the many reasons I have been quiet recently is I am working on a personal project &#8211; an amateur stop-motion video. The final product will appear to be a large group of my friends playing music in an orchestra. The raw material I have is dozens of sets of still photos of my friends pretending to play instruments in front of a green-screen. Each set has about 10 photos of the person playing the instrument.<\/p>\n<p>I am working on an interesting challenge, and I thought that I might benefit if I wrote it out as a blog article to force me to think it through.<\/p>\n<p>For the time being, I am just going to consider wind and brass instruments (e.g. flute, oboe, clarinet, trumpet, trombone, etc.)<\/p>\n<h4>Plan A<\/h4>\n<p>The original, original plan was to take a photo of every different legal fingering position for the instrument, and map that across to the particular notes being played in the music. Whenever a B&#9837; was played, the photo corresponding to the B&#9837; fingering would be substituted in.<\/p>\n<p>This original, original plan is almost feasible for an instrument such as a trumpet. If you assume that the lip-position is not discernable, then there are only 8 fingerings &#8211; several notes correspond to the same fingering. It would take some research, but is doable.<\/p>\n<p>However, I looked up the fingering charts for an oboe and found there were (from memory) 44 different positions. That would take too much studio time, too much categorisation time and be too boring for my volunteers.<\/p>\n<h4>Plan B<\/h4>\n<p>So, the original, original plan was replaced with Plan B before the photo shoot. Plan B involved taking approximately 10 photos of each instrument being played. Where convenient, these would be associated with their correct notes. Where a note didn&#8217;t have a corresponding photo available, the software would assign a random fingering to that position, and then maintain that association throughout the piece. A musician who played that instrument might notice the discrepancy, but hopefully the casual viewer wouldn&#8217;t notice the &#8220;anachronism&#8221;. Perhaps some smarts might be added to prevent two sequentially-played but differently-pitched notes from having the same fingering, so that some movement occured between notes, but that would probably not be required.<\/p>\n<h4>The Shoot<\/h4>\n<p>Associated with the shoot was my birthday party.<\/p>\n<p>You can view the causality either way: in order to get volunteers to come to the photo shoot, I invited them to a party in a pub near the studio, or in order to get my friends to come to my party, I invited them to a photo-shoot in a studio near the pub.<\/p>\n<p>I relied on my friends to take up roles such as Assistant Director, Photographer, Wranglers and Tour Guides. They were terrific, and I am ever so thankful for the work that they did. They made the day run very smoothly, and I was &#8211; several times &#8211; banished from the studio and set to the pub because they had everything under control.<\/p>\n<p>But as part of having many short shifts of volunteers, and volunteers training other volunteers (while the director lazed in the pub) is that there was a certain element of Chinese Whispers. <\/p>\n<p>In particular, the &#8220;franticness&#8221; of the playing slowly increased over the day. At the beginning, I have photos of flautists keeping their heads and bodies still, while just moving their fingers. By the end of the shoot, I have saxophonists wildly boogeying left and right as they play.<\/p>\n<p>Now, this isn&#8217;t quite in keeping with the sedate orchestral image I was originally planning, but I can adapt. More importantly, it offers great challenges for the stop-motion &#8211; I can&#8217;t have the player swinging their hips 90 degrees with each note played, if they are playing, say, 200 notes per minute &#8211; they will look like they are holding an out-of-control jack-hammer to their lips.<\/p>\n<p>I want to be quite clear that I am not blaming the volunteers involved. I could have made my needs clearer, I could have kept a closer eye on the proceedings and, really, this problem is a pretty minor one compared with what <em>could<\/em> have gone wrong. I am overall still pleased and thankful.<\/p>\n<p>(Some of the production people claim that they tried to get some serious playing photos before some more fun ones. That is certainly true for some instruments. For other ones, I really only have a couple of &#8220;sedate&#8221; playing images, making the animation rather dull if I don&#8217;t incorporate some of the later images.)<\/p>\n<h4>Plan C<\/h4>\n<p>So today I came up with another idea.<\/p>\n<p>Suppose we ignore the fingering &#8211; no-one will notice the fingering positions of a dancing saxophonist. Instead, just focus on the instrument\/body position of the player.<\/p>\n<p>For each set of photos of a single player, we can compare each pair of photos and rate them as say &#8220;tiny movement&#8221;, &#8220;moderate movement&#8221;, &#8220;large movement&#8221;.<\/p>\n<p>You know what &#8211; this will be easier to explain if I can degenerate to Comp Sci geek&#8230;<\/p>\n<p>Let each of the 10-20 photos be a node in a fully-connected bi-directional graph, and each edge be weighted by the size of the delta between the positions.<\/p>\n<p>Idea #1:  Discard all the edges which are rated higher than &#8220;moderate&#8221;. Then, each time a different note is played, one of the connections is randomly chosen to allow the player to continually make small, but random movements as they move through the space. Hopefully the random big jumps will be turned into more gradual hip swinging.<\/p>\n<p>Idea #2: Reduce the probability of leaving a node along the same edge it entered through, so the player doesn&#8217;t &#8220;vibrate&#8221; as much &#8211; jumping back and forth between the same two nodes. Note, some nodes will only have one other node similar to them, making vibration inevitable.<\/p>\n<p>Idea #3: Increase the probability of leaving a node along the same edge it entered through if the previous note is repeated. e.g. let the player vibrate if they are playing A-B-A-B-A.<\/p>\n<p>Idea #4: Tag each edge with the next note played during each transition, and then re-use that transition if you find yourself doing the same note transition, so the player is likely to (but not definitely) repeat their movements when they play the same refrain a second time.<\/p>\n<p>Idea #5: Don&#8217;t discard the large weightings. Instead just make them stochastically less common. This will reduce the chance that a player will become randomly stuck in some small set of nodes, vibrating until the piece is over. It will increase the chance that they do get stuck in such a situation for short periods.<\/p>\n<p>Idea #6: Occasional frantic movements may be justified and natural. Could there be some trigger that makes larger movements more likely for some transitions? Big jumps in tone? Jumps in tempo, key or volume? Semibreves? <\/p>\n<h4>Categorisation<\/h4>\n<p>With a large number of instruments and a large number of photos of each, coming up with a rating for each pair is likely to be laborious.<\/p>\n<p>Richard A. suggested the other day that I farm out some of the categorisation work. I guess I could make a web-site that displayed two merged photos and asked for a personal rating of the differences, and then asked some volunteers to walk through them. Would writing the web-site (Oh gawd! PHP?) be worth it? How much consistency will I get through different people rating them?<\/p>\n<p>Could I do it automatically, by taking a delta between the two images (at the pixel-level) and then somehow summing the result to get a metric for how much the picture had changed?  Would that metric be reasonably correlated to a manual rating?<\/p>\n<h4>Conclusion<\/h4>\n<p>Writing this down has clarified it in my mind, and triggered a few more ideas. <\/p>\n<p>It has also revealed it to be a lot of work &#8211; and possibly the result will be unwatchable. Hmmmm&#8230;.<\/p>\n<p>On the other hand, the solution (at least a manully-rated one) is likely to be useful for string instruments too (violin, cello, double-bass, etc.) &#8211; ensuring the bow positions transition rather than jump.<\/p>\n<p>Suggestions very welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the many reasons I have been quiet recently is I am working on a personal project &#8211; an amateur stop-motion video. The final product will appear to be a large group of my friends playing music in an orchestra. The raw material I have is dozens of sets of still photos of my friends pretending to play instruments in front of a green-screen. Each set has about 10 photos of the person playing the instrument.<\/p>\n<p>I am working on an interesting challenge, and I thought that I might benefit if I wrote it out as a blog article to force me to think it through.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","footnotes":""},"categories":[33,34],"tags":[],"class_list":["post-1446","post","type-post","status-publish","format-standard","hentry","category-puzzle-solving","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/comments?post=1446"}],"version-history":[{"count":3,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1446\/revisions"}],"predecessor-version":[{"id":1449,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/1446\/revisions\/1449"}],"wp:attachment":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/media?parent=1446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/categories?post=1446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/tags?post=1446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}