<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Not Yet Secure</title>
    <description>Because technology is not yet secure for everyone.</description>
    <link>https://notyetsecure.com</link>
    <atom:link href="https://notyetsecure.com/feed.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>App reviews, usable workflows, and feedback loops</title>
        <description>&lt;p&gt;There’s been a &lt;a href=&quot;http://www.marco.org/2013/12/14/rate-this-app&quot;&gt;lot&lt;/a&gt; of &lt;a href=&quot;http://www.marco.org/2013/12/15/chuq-von-rospach&quot;&gt;discussion&lt;/a&gt; &lt;a href=&quot;http://www.marco.org/2013/12/17/collin-donnell-star-ratings&quot;&gt;lately&lt;/a&gt; about iOS apps showing users modal dialogues requesting that they rate the app on the App Store. Like this (from &lt;a href=&quot;http://effyr.tumblr.com/&quot; title=&quot;Eff Your Review&quot;&gt;Eff Your Review&lt;/a&gt;):&lt;/p&gt;

&lt;p class=&quot;center&quot;&gt;&lt;img src=&quot;/assets/effyr_instagram.jpg&quot; alt=&quot;effyr_instagram&quot; /&gt; &lt;img src=&quot;/assets/effyr_vine.jpg&quot; alt=&quot;effyr_vine&quot; /&gt; &lt;img src=&quot;/assets/effyr_facebook.jpg&quot; alt=&quot;effyr_facebook&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The forces encouraging this behavior are complex, and relate to issues of discoverability and ranking in the App Store. There’s &lt;a href=&quot;http://atp.fm/episodes/44-a-plague-with-very-minor-effects&quot;&gt;been debate&lt;/a&gt; about how to curtail these&lt;sup id=&quot;fnref:fn_1&quot;&gt;&lt;a href=&quot;#fn:fn_1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;My lab likes to think about app markets as a place where &lt;strong&gt;feedback loops&lt;/strong&gt; exist, and part of our research into improving the security and privacy of apps (particularly with permission systems) relies on feedback from a user affecting the marketplace itself. Here’s a flowchart of the entire thing from one of David Wagner’s overview talks:&lt;/p&gt;

&lt;p class=&quot;center&quot;&gt;&lt;img src=&quot;/assets/app-flowchart.png&quot; alt=&quot;App Flowchart&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There’s been work to provide tools to improve apps (to help developers reduce overprivileging their apps&lt;sup id=&quot;fnref:fn_2&quot;&gt;&lt;a href=&quot;#fn:fn_2&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;, to detect insecure use of APIs&lt;sup id=&quot;fnref:fn_3&quot;&gt;&lt;a href=&quot;#fn:fn_3&quot; class=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;, etc.), or to improve the platform&lt;sup id=&quot;fnref:fn_4&quot;&gt;&lt;a href=&quot;#fn:fn_4&quot; class=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; (making permissions clearer, showing warnings to users at the right time, avoiding habituation). But we make a big assumption:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Not all users need to notice or understand all warnings or notifications for these new systems to be effective — if some fraction of users &lt;em&gt;do&lt;/em&gt; notice, and provide feedback back into the marketplace or to the developers when undesirable behavior occurs, then these systems can still have a positive effect on the quality of apps on a platform.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This assumption is primarily based on research that shows that app reviews are one of the most significant factors in a user’s decision to install an app&lt;sup id=&quot;fnref:fn_5&quot;&gt;&lt;a href=&quot;#fn:fn_5&quot; class=&quot;footnote&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;. So if some users notice misbehaviors or warnings, and understand them, then they can write good reviews using them, helping all of the novice users that only look over reviews when considering apps.&lt;/p&gt;

&lt;p&gt;But is this actually enough? Can we really say that because some users &lt;em&gt;could&lt;/em&gt; write better reviews that our work could actually lead to better app markets?&lt;/p&gt;

&lt;p&gt;The recent app rating brouhaha seems particularly relevant. App markets and platforms need to help out enough to make this work:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Users need to be encouraged to write reviews. This is particularly important for apps that user &lt;em&gt;don’t&lt;/em&gt; keep installed.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Useful&lt;/em&gt; reviews should be easy to write. Platforms probably need to hold users’ hands.&lt;/li&gt;
  &lt;li&gt;Reviews need to be easy to read, with useful information pulled out for easy access to users skimming applications. App markets need to be more like Amazon than the iOS App Store: ranking reviews on recency and usefulness, pulling out key points common across a lot of reviews, verified reviews, etc.&lt;/li&gt;
  &lt;li&gt;Fake reviews and ratings need to be curbed. This includes apps begging for reviews.&lt;/li&gt;
  &lt;li&gt;Rankings and listings in the market should be holistic and well-developed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We don’t really have any of this on any mobile platform currently, but I think any of them would make for a much better app market.&lt;/p&gt;

&lt;h4 id=&quot;footnotes&quot;&gt;Footnotes&lt;/h4&gt;
&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:fn_1&quot;&gt;
      &lt;p&gt;Can Apple ban them? I’d argue you could get pretty far with static analysis tools, but that’s for another post…&amp;nbsp;&lt;a href=&quot;#fnref:fn_1&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:fn_2&quot;&gt;
      &lt;p&gt;&lt;a href=&quot;http://www.cs.berkeley.edu/~daw/papers/androidperm-ccs11.pdf&quot;&gt;Android Permissions Demystified&lt;/a&gt;, by Adrienne Porter Felt et al., developed a tool called Stowaway to detect overprivileged of android apps.&amp;nbsp;&lt;a href=&quot;#fnref:fn_2&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:fn_3&quot;&gt;
      &lt;p&gt;&lt;a href=&quot;http://www.cs.berkeley.edu/~daw/papers/intents-mobisys11.pdf&quot;&gt;Analyzing Inter-Application Communication in Android&lt;/a&gt;, by Erika Chin et al., developed comdroid to detect insecure use of intents.&amp;nbsp;&lt;a href=&quot;#fnref:fn_3&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:fn_4&quot;&gt;
      &lt;p&gt;A lot of work has been done on redesigning permission systems for Android: &lt;a href=&quot;http://www.cs.berkeley.edu/~daw/papers/anduser-soups12.pdf&quot;&gt;What’s wrong with permissions&lt;/a&gt;, &lt;a href=&quot;http://www.cs.berkeley.edu/~daw/papers/askperm-hotsec12.pdf&quot;&gt;how to ask for permission for different resources&lt;/a&gt;, &lt;a href=&quot;http://www.cs.berkeley.edu/~cthompson/papers/SOUPS2013-attribution-mechanisms.pdf&quot;&gt;the benefits of automatically granting low risk permissions&lt;/a&gt;, etc. This has been a big research area for students of my advisor, &lt;a href=&quot;http://www.cs.berkeley.edu/~daw/&quot;&gt;David Wagner&lt;/a&gt;, and the &lt;a href=&quot;http://scrub.cs.berkeley.edu/&quot;&gt;SCRUB center&lt;/a&gt;.&amp;nbsp;&lt;a href=&quot;#fnref:fn_4&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:fn_5&quot;&gt;
      &lt;p&gt;&lt;a href=&quot;http://www.cs.berkeley.edu/~daw/papers/anduser-soups12.pdf&quot;&gt;Android permissions: user attention, comprehension, and behavior&lt;/a&gt;, by Adrienne Porter Felt et al., SOUPS ‘12.&amp;nbsp;&lt;a href=&quot;#fnref:fn_5&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        <pubDate>Mon, 23 Dec 2013 00:00:00 -0800</pubDate>
        <link>https://notyetsecure.com/app-reviews-and-feedback-loops.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/app-reviews-and-feedback-loops.html</guid>
      </item>
    
      <item>
        <title>Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS and Android</title>
        <description>&lt;p&gt;Last year, I worked on reverse engineering Android implementations of IMS, the next generation 4G IP based telephony suite of protocols, with Jethro Beekman at Berkeley.&lt;/p&gt;

&lt;p&gt;We released a &lt;a href=&quot;http://www.cs.berkeley.edu/~cthompson/t-mobile/&quot;&gt;technical report on our MITM attack against T-Mobile’s WiFi Calling service&lt;/a&gt;, which was caused by unvalidated SSL certificates. This was joint work with Jethro Beekman, another EECS grad student at Berkeley. Big takeaway: T-Mobile was great to work with on fixing this vulnerability—their security team is excellent.&lt;/p&gt;

&lt;p&gt;In addition to the technical report, we continued to look at IMS systems in general, and how T-Mobile and Android implemented them. We found that, amongst other things, Digest AKAv1, the authentication and key exchange protocol used in IMS, doesn’t correctly require use of the generated secret keys, allowing a variety of attacks. Additionally, generally accessible APIs in both core Android and in T-Mobile’s customized ROMs allow apps with just the &lt;code&gt;READ_PHONE_STATE&lt;/code&gt; permission to access the IMS authentication routines in the SIM card, making it possible for low-privilege malware on a phone to let a remote attacker authenticate as that phone.&lt;/p&gt;

&lt;p&gt;A simple example of why you might care: An attacker can pretend to be you (your number, your subscriber ID, your phone) and call premium 1-900 numbers or send text premium text messages, costing you real money.&lt;/p&gt;

&lt;p&gt;Jethro presented our paper at USENIX WOOT (Workshop On Offensive Technologies) 2013 a couple weeks ago. Thanks to USENIX open access policies, you can view the &lt;a href=&quot;https://www.usenix.org/conference/woot13/breaking-cell-phone-authentication-vulnerabilities-aka-ims-and-android&quot;&gt;paper, slides, and video of the talk online&lt;/a&gt;. &lt;/p&gt;

</description>
        <pubDate>Fri, 30 Aug 2013 22:06:39 -0700</pubDate>
        <link>https://notyetsecure.com/breaking-cell-phone-authentication-ims.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/breaking-cell-phone-authentication-ims.html</guid>
      </item>
    
      <item>
        <title>ignore the code: Opinions vs. Data</title>
        <description>&lt;p&gt;&lt;a title=&quot;Opinions vs. Data&quot; href=&quot;http://ignorethecode.net/blog/2010/08/13/opinions_vs__data/&quot; target=&quot;_blank&quot;&gt;Lukas Mathis on the mysterious Gmail checkbox-with-dropdown&lt;/a&gt;, and why empirical design is important:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;“What Leggett described is exactly how I felt about the widget when I first saw it. I immediately figured out how to use it, but my gut reaction was «most people are not going to get how this works.» It seems I was wrong. This is one of the reasons why I don’t put too much trust into opinion-based usability reviews: There’s a lot of guesswork involved, and guessing how humans behave is an endeavor fraught with peril.”&lt;/p&gt;&lt;/blockquote&gt;
</description>
        <pubDate>Mon, 13 Aug 2012 22:04:28 -0700</pubDate>
        <link>https://notyetsecure.com/ignore-the-code-opinions-vs-data.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/ignore-the-code-opinions-vs-data.html</guid>
      </item>
    
      <item>
        <title>Norman on Ubiquitous Computing</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Would you like a pocket-size device that reminded you of each appointment and daily event? I would. I am waiting for the day when portable computers become small enough that I can keep one with me at all times. I will definitely put all my reminding burdens upon it. It has to be small. It has to be convenient to use. And it has to be relatively powerful, at least by today’s standards. It has to have a full, standard typewriter keyboard and a reasonably large display. It needs good graphics, because that makes a tremendous difference in usability, and a lot of memory—a huge amount, actually. And it should be easy to hook up to the telephone; I need to connect it to my home and laboratory computers. Of course, it should be relatively inexpensive.&lt;/p&gt;

  &lt;p&gt;What I ask for is not unreasonable. The technology I need is available today. It’s just that the full package has never been put together, partly because the cost in today’s world would be prohibitive. But it will exist in imperfect form in five years, possibly in perfect form in ten.”&lt;/p&gt;

  &lt;p&gt;&lt;cite&gt;– Donald Norman, &lt;em&gt;“Design of Everyday Things”&lt;/em&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
        <pubDate>Wed, 13 Jun 2012 21:58:27 -0700</pubDate>
        <link>https://notyetsecure.com/norman-on-ubiquitous-computing.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/norman-on-ubiquitous-computing.html</guid>
      </item>
    
      <item>
        <title>Ant colony optimization</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/ants.png&quot; alt=&quot;Ant agents converging on a path.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image Source:&lt;/em&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Ant_colony_optimization&quot;&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve been looking at ant-algorithms for pathfinding lately. They’re interesting because they are very simple multi-agent search, but some of the benefits that I originally thought it might have (dealing with imperfect last-known-information, dynamic environment, etc.) seem to be negated by the fact that it isn’t terribly great when you don’t have a ton of agents.&lt;/p&gt;

&lt;p&gt;I’ll have a more concrete idea of how feasible ant-algorithms are once my implementations are done and I can run simulations. Never hurts to separate the hype from the substance, though.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update (2011-12-31):&lt;/strong&gt; We ended up implementing some various pathfinding mechanisms for many-agent movement in a semi-unknown environment. Turns out that ant colony optimization is actually not so great… at least in the classic “pathfinding” sense. Convergence is slow, the actual amount of shared information is weak, etc. The test program is at least pretty, thanks to wxPython. The settings are all at the top of the Python script, and a little arcane, but you can run it with&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python sim.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can download the program here: &lt;a href=&quot;http://dl.dropbox.com/u/46716/sim.py&quot;&gt;sim.py&lt;/a&gt;&lt;/p&gt;

</description>
        <pubDate>Tue, 19 Apr 2011 21:53:40 -0700</pubDate>
        <link>https://notyetsecure.com/ant-colony-optimization.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/ant-colony-optimization.html</guid>
      </item>
    
      <item>
        <title>Charting and Design</title>
        <description>&lt;p&gt;From &lt;a href=&quot;http://mrgan.tumblr.com/post/551212989/another-much-linked-chart-this-one-deemed&quot;&gt;mrgan.tumblr.com&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Another much-linked &lt;a href=&quot;http://www.informationisbeautiful.net/visualizations/colours-in-cultures/&quot;&gt;chart&lt;/a&gt;, this one deemed beautiful enough to grace the &lt;a href=&quot;http://www.informationisbeautiful.net/book/process/designing-the-cover/&quot;&gt;cover of a book&lt;/a&gt;. An appealing image, certainly. I’m not sure how it relates to flowers, but ok.&lt;/p&gt;

  &lt;p&gt;Now let’s try using the actual chart. Find what the cultural significance of red is in the Muslim culture. No? Ok, it doesn’t work that way - let’s instead find what color symbolizes peace in Eastern European cultures. Find it yet? Need a compass, perhaps, to trace from the in-chart legend to the desired slice?&lt;/p&gt;

  &lt;p&gt;Please stop the madness. The purpose of a chart is to illuminate; if it’s harder to read than a raw-data table or a paragraph of text saying the same, then &lt;em&gt;don’t use a chart&lt;/em&gt;. And if your goal is simply to create a pretty graphic, then don’t try beefing up your science cred with this “information” stuff.&lt;/p&gt;

  &lt;p&gt;Arranging data in an aesthetically pleasing way with no regard for how the arrangement affects the viewer’s understanding is simply dishonest. It’s only popular because no one really cares to use these charts for any real purpose. (Color significance in cultures - I mean, does it get any fluffier?) Imagine someone with no database experience “visualizing” a SQL query in this way and trying to sell a database administrator on it.&lt;/p&gt;

  &lt;p&gt;Information can be beautiful. Information can also be ugly. It can be helpful or misleading, educational or confusing. Information doesn’t care; the designer has to.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The chart is question &lt;strong&gt;is&lt;/strong&gt; definitely good looking. I’ve made good looking figures (not with as much &lt;em&gt;art&lt;/em&gt; to them).&lt;/p&gt;

&lt;p&gt;The point I get out of this: the chart isn’t &lt;strong&gt;designed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It’s simply made to look good.&lt;/p&gt;

&lt;p&gt;But can this chart be designed? The post on Neven Mrgan’s Tumblr argues that the data doesn’t work in a chart.&lt;/p&gt;

&lt;p&gt;Too often school assignments I’ve had &lt;em&gt;require&lt;/em&gt; figures/charts, and looking back, these really often were unnecessary, redundant, etc. Almost all of them fell under the “harder to read than a raw-data table or &lt;strong&gt;a paragraph of text saying the same&lt;/strong&gt;”. The issue was that there was no freedom in the assignment to make &lt;strong&gt;design choices&lt;/strong&gt;. And there certainly wasn’t design thought going into the construction of most of the assignments, either.&lt;/p&gt;

</description>
        <pubDate>Thu, 29 Apr 2010 21:50:42 -0700</pubDate>
        <link>https://notyetsecure.com/charting-and-design.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/charting-and-design.html</guid>
      </item>
    
      <item>
        <title>GCC Undefined Behavior</title>
        <description>&lt;p&gt;From &lt;a title=&quot;feross.org&quot; href=&quot;http://www.feross.org/gcc-ownage/&quot; target=&quot;_blank&quot;&gt;feross.org&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Check out this little &lt;a href=&quot;http://en.wikipedia.org/wiki/GNU_Compiler_Collection&quot;&gt;GCC&lt;/a&gt; gem that I just discovered &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=A436B63B-8EB4-4914-8041-B914B6E0992C&amp;amp;displaylang=en&quot;&gt;read about&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;When GCC identified bad C++ code, it tried to start &lt;a href=&quot;http://en.wikipedia.org/wiki/NetHack&quot;&gt;NetHack&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Rogue_%28computer_game%29&quot;&gt;Rogue&lt;/a&gt;, or &lt;a href=&quot;http://en.wikipedia.org/wiki/Tower_of_Hanoi#Applications&quot;&gt;Towers of Hanoi&lt;/a&gt;. Failing all three, GCC printed out a cryptic error message. Wow.&lt;/p&gt;
&lt;p&gt;This just goes to show you that when the official C++ specification talks about undefined behavior, they mean business:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;[Undefined behavior is] behavior, such as might arise upon use of an erroneous program construct or erroneous data, for which the Standard imposes no requirements&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;No requirements indeed.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I found this immensely entertaining. &quot;Undefined Behavior&quot; indeed. Also, not surprising that those who have to use C++ could stand have some humor injected into their otherwise painful lives (I kid... kind of).&lt;/p&gt;
</description>
        <pubDate>Mon, 29 Mar 2010 21:46:45 -0700</pubDate>
        <link>https://notyetsecure.com/gcc-undefined-behavior.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/gcc-undefined-behavior.html</guid>
      </item>
    
      <item>
        <title>Using Head-Related Transfer Functions (HRTFs)</title>
        <description>&lt;p&gt;First, HRTFs are adorable:&lt;/p&gt;

&lt;p class=&quot;center&quot;&gt;&lt;img src=&quot;/assets/ascii-hrtfs.png&quot; alt=&quot;ASCII HRTFs&quot; title=&quot;An ASCII HRTF&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;(ASCII from the &lt;a href=&quot;http://sound.media.mit.edu/resources/KEMAR.html&quot;&gt;MIT KEMAR&lt;/a&gt; &lt;a href=&quot;http://sound.media.mit.edu/resources/KEMAR/KEMAR-FAQ.txt&quot;&gt;FAQ&lt;/a&gt;, circa 1997, on how to apply HRTF impulse responses.)&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;My time spent playing around with &lt;a href=&quot;http://www.csounds.com/&quot;&gt;cSound&lt;/a&gt; was delightful and a little sad. There’s so much more I could learn, and a lot of that is fundamental to really understanding signal processing, digital instrumentation, and computer music. But, I have learned a lot about actually &lt;em&gt;using&lt;/em&gt; HRTFs, as one of the things I toyed with while building &lt;a href=&quot;/sound-fall/&quot;&gt;a little game called sound_fall&lt;/a&gt;. While they didn’t work out for that project, I still wanted to dig around a little more, and share some of what I found (since real discussion of HRTFs is lacking).&lt;/p&gt;

&lt;p&gt;If you’re interested in cSound, the &lt;a href=&quot;http://www.csounds.com/manual/html/index.html&quot;&gt;online manual&lt;/a&gt; is very useful, if a bit dense. Looking through the examples included in the pages for the HRTF opcodes was more immediately enlightening, at least from getting immediate use. The relevant opcodes here are &lt;a href=&quot;http://www.csounds.com/manual/html/hrtfer.html&quot;&gt;hrtfer&lt;/a&gt;, &lt;a href=&quot;http://www.csounds.com/manual/html/hrtfmove.html&quot;&gt;hrtfmove&lt;/a&gt;, &lt;a href=&quot;http://www.csounds.com/manual/html/hrtfmove2.html&quot;&gt;hrtfmove2&lt;/a&gt;, and &lt;a href=&quot;http://www.csounds.com/manual/html/hrtfstat.html&quot;&gt;hrtfstat&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To get a feel for this, I’ve made a simple .csd file—the file that contains the instrument and score information for cSound. It plays a fractal phased sine wave that I made in Audacity.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&amp;lt;CsoundSynthesizer&amp;gt;
&amp;lt;CsOptions&amp;gt;
; non-realtime output
  -o hrtf.wav
&amp;lt;/CsOptions&amp;gt;
&amp;lt;CsInstruments&amp;gt;
  sr = 44100  ; standard sample rates
  kr = 4410
  ksmps = 10
  nchnls = 2  ; final output is stereo

instr 10
  kaz line 0, p3, 180          ; move azimuth from front around right to back
  kelev line 50, p3, -30       ; move elevation in arc from 50 to -30 deg
                               ; (above you to below you)
  ain soundin &amp;quot;fast_tone.wav&amp;quot;  ; input sound

  ; set left and right channels to results of the hrtfmove2 opcode
  ; this has less clicking, especially when used for real-time synthesis
  ; this processes ain, with azimuth 0, the predefined elevation arc,
  ; and the two HRTF data files (that contain the impule responses)
  ;aleft,aright hrtfmove2 ain, 0, kelev, &amp;quot;hrtf-44100-left.dat&amp;quot;,&amp;quot;hrtf-44100-right.dat&amp;quot;

  ; This does the same, but with the predefined azimuth arc and an
  ; elevation of zero.
  aleft,aright hrtfmove2 ain, kaz, 0, &amp;quot;hrtf-44100-left.dat&amp;quot;,&amp;quot;hrtf-44100-right.dat&amp;quot;

  outs    aleft, aright

endin
&amp;lt;/CsInstruments&amp;gt;
&amp;lt;CsScore&amp;gt;
i10 0 20  ; play for 20 seconds
e
&amp;lt;/CsScore&amp;gt;
&amp;lt;/CsoundSynthesizer&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I tried to comment the file enough to make it readable, even if you don’t really know what’s going on. To use it, you’ll need to have cSound installed, and grab &lt;a href=&quot;/assets/code/simple_hrtf.zip&quot;&gt;this pack I made with the .csd, fast_tone.wav, and the HRTF data files&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then, from a terminal, invoke csound: &lt;code&gt;$ csound simple_hrtf.csd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will output a file named &lt;code&gt;hrtf.wav&lt;/code&gt;. Try listening to it with decent headphones:&lt;/p&gt;

&lt;audio src=&quot;/assets/audio/0fast_tone.wav&quot; controls=&quot;&quot; class=&quot;center&quot;&gt;
  &lt;p&gt;Your browser does not support HTML5 audio.&lt;/p&gt;
&lt;/audio&gt;

&lt;p&gt;You may notice that you need to pay a bit of attention to where the sound is coming from to really get the effect. The sound I used has enough edge and variation that the motion in space is more noticeable than a more solid tone might be under the same transformations. You can pass the &lt;code&gt;hrtfmove2&lt;/code&gt; opcode any mono input, so experimentation is easy.&lt;/p&gt;

&lt;p&gt;The actual math for using the HRTF datafiles involves FFTs and discrete-time convolutions—since I skipped out of being an electrical engineer, I’ve avoided needing to learn about things like that, but I can’t help being curious. If I was a little more competent, I might try to build an extension for OpenAL (which is woefully neglected these days, from the looks of it) to add this functionality. That would make it a little easier to integrate into applications that aren’t music synthesis oriented. Oh well.&lt;/p&gt;

&lt;p&gt;Moving on from here, I’d really like to find a good system for real-time synthesis. cSound seems like a possibility, but it isn’t really designed for it from the ground up—the HRTF example here is outputted to a wavefile to avoid buffer and clicking issues.&lt;/p&gt;

</description>
        <pubDate>Sun, 21 Mar 2010 21:41:03 -0700</pubDate>
        <link>https://notyetsecure.com/head-related-transfer-functions.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/head-related-transfer-functions.html</guid>
      </item>
    
      <item>
        <title>SOUND _ FALL : build with sound</title>
        <description>&lt;p class=&quot;center&quot;&gt;&lt;img src=&quot;/assets/soundfall.png&quot; alt=&quot;sound_fall&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A friend and I had the idea of building games (defined loosely) that didn’t use sight as the primary medium. On a standard PC, this generally limits you to only sound.&lt;/p&gt;

&lt;p&gt;This project is &lt;a href=&quot;https://github.com/christhompson/sound_fall&quot;&gt;available on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Place blocks of sounds without using your eyes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Download, start it, and then close your eyes. See what you can build using only your ears.&lt;/p&gt;

&lt;p&gt;This game/vignette was created using Python (tested in version 2.6) and &lt;a href=&quot;http://www.pygame.org/&quot;&gt;PyGame&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This was a surprisingly long haul for only four days of working on it on and off. I’ve learned more than I think I’ll want to know in a long time about 3D positional audio.&lt;/p&gt;

&lt;p&gt;Some of the good things I’ve learned:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.pygame.org/&quot;&gt;PyGame&lt;/a&gt; is actually well-built and stable. They know how to handle sampe buffers.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.pyglet.org/&quot;&gt;Pyglet&lt;/a&gt; is definitely a possibility for future endeavors. It’s basically an extension of PyGame for better 3D support.&lt;/li&gt;
  &lt;li&gt;Python is, as always for me, a great prototyping language.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/head-relational-transfer-functions/&quot;&gt;HRTFs are awesome&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But some things I had to learn the hard way:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;OpenAL is a behemoth that I wish worked better. The fact that all of the Python bindings are terribly old and poorly documented doesn’t help.&lt;/li&gt;
  &lt;li&gt;Keep things as simple as possible, even if the overall idea is really complicated. OpenAL was way more than this project needed. I ended up building a custom panning system (since PyGame’s mixer only supports Left/Right channel volumes) that was far simpler, and it did everything I needed it to.&lt;/li&gt;
  &lt;li&gt;Humans don’t have high enough resolution for audiospatial recognition: we really distribute sounds within eight regions of the sphere (from my experience). The rest of what we &lt;em&gt;think&lt;/em&gt; we might be sensing is due to other cues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fact that humans can’t pinpoint sounds in 3D space solely based on the sound was my primary sticking point.&lt;/p&gt;

&lt;p&gt;I had originally wanted to implement this only using 3D positional audio with HRTFs—Head-Relational Transfer Functions. I thought this would let me cue the position of blocks around the player, but it just didn’t end up cutting it. But that doesn’t stop HRTFs from being really awesome.&lt;/p&gt;

&lt;p&gt;If you aren’t familiar with HRTFs and care about audio production in any capacity, you should check them out. Head-Relational Transfer Functions (HRTFs) are signals that you can convolute a mono input against to get the actual signals that a human would hear in each ear. MIT made a database of them, called &lt;a href=&quot;http://sound.media.mit.edu/resources/KEMAR.html&quot;&gt;KEMAR&lt;/a&gt;, back in the ’90s using a dummy head and special microphones. I’m still not comfortable trying to use them by hand, but cSound has HRTF support for static and moving positional sounds, which is really cool. I wanted to try to hack together using the command-line interface to cSound through Python to build this system, but HRTFs just weren’t enough. Darn.&lt;/p&gt;

</description>
        <pubDate>Thu, 18 Mar 2010 21:36:49 -0700</pubDate>
        <link>https://notyetsecure.com/sound-fall.html</link>
        <guid isPermaLink="true">https://notyetsecure.com/sound-fall.html</guid>
      </item>
    
  </channel>
</rss>