The Bronzeville Numbers Unbreakable? Part 2 Music

Josh Olson says his numbers code is unbreakable. Do you like puzzles? If so have fun and contact us to tell us what you find. Maybe in sheer numbers we can brute force the answer.

Could it be a music reference?

Attempts at translating numbers to musical notes failed? Maybe you hear something I don’t. My hearing has gone down hill….. guns & explosions will do that.

  • 6 42 63 42 52 72 2 11 75 27 7 37 4 48 58 7 27 8 45 51 2 12 22 7 18

How it was done

I took the numbers and using c# output them into 2 different ways to generate frequencies to output as tones. First method was simply multiplying each number by 100 to get the frequency in playable range. The second method was converting each number to binary then getting the sum of the ones within each binary number, a method found to be used for storing music information.

Numbers to Music-Ish With Code

Part 1 of The Numbers

Be sure to check out the Bronzeville FAQ

Parsing Digital Sheet Music MXL Files – Stranger Things Theme Song on Arduino

Arduino Stranger ThingsI’ve been toying around with playing music using simple tones on the Arduino. I’m no composer or musician so looking around for sheet music I eventually stumbled across MXL files on a few sites like MuseScore.com. Below I have posted a sample of the Arduino playing the Stranger Things theme song.

MXL is a compressed XML file that contains the Sheet Music data, Credits, Parts, Voice Definitions, Notes, Tempo and Durations along with other information. Basically a universal format designed for composing music, project sharing and several additional applications.

Ok so MXL files, what I keyed in on was that the MXL file contained the Notes and their Durations. This is perfect because you can create a simple Arduino code to play notes if you have this information. Sorting through these files is very daunting and time consuming so I decided to create a simple app to parse this information to use it more easily.

This app was banged out pretty quickly so please forgive possible errors. Because some MXL files are compressed and others are not I built in the code necessary to unpackage the XML before parsing. The app allows me to separate the notes by voice with their durations. In addition I placed a numeric control that limits the amount of notes that get parsed. A screenshot example is on the left.

Huge thanks to Shvelo who’s Ruby code got me pointed in the right direction.

I have this project posted on GitHub where you can obtain the code for the app as well as the Arduino sample code.

You can download the compiled app from GitHub.

Arduino SetupPlaying the Stranger Things theme song on the Arduino was a bit tricky tweaking the tempo to make it sound right but way easier without having to manually extract the notes and durations. To the left is the simple Arduino setup using piezo from a walkie talkie wired to pin 8 and ground on the controller. Ignore the other wires because they’re not used here.

A thanks to Riley Apperson on MuseScore for his/her Composition of the Stranger Things Theme.

Code Contest on Instructables

Coded Creations

Instructables with sponsorship by Microsoft is holding a contest for the best Instructables that are code related. The contest is called Coding Creations and among many prizes is a surface pro 3 and a Spark Prototyping Bundle.  The judges prize is for the “best use of Visual Studio,  Microsoft Azure, Kinect/Xbox, Windows Phone apps, or any Windows app” so if anyone has any ideas let me know.

So far I have submitted 2 Instructables for this competition, A View-State Key Generator (in c# & php) and a simple app that does Image Edge Detection.

This is a link to my profile on Instructables.

 

Instructables WordPress Plugin

So a while back I posted a how-to on displaying a user’s Instructables projects on their own site or projects of those that they follow. I have since then created a WordPress plugin to do the work for you.

Download the Instructables Plugin Here

If you’re not familiar with www.Instructables.com and are interested in DIY projects go check it out.

Do you author DIY/How-To’s on Instructables?
Do you like the projects on Instructables?

This plugin allows you to post the latest projects you or other authors have posted or projects by keyword on your own site. See an example below

This is an expansion of an Instructable I wrote a while back that you can find here http://www.instructables.com/id/Display-your-Instructables-on-a-Wordpress-or-PHP-b/

Display a user’s projects:
[instructablesUP username=”MrRedBeard” num=”2″ thumb=”true”]

Display a list of projects by keyword:
[instructablesKW keyword=”tent” num=”3″ thumb=”true”]

 

Fix for Dot Net Error Validation of viewstate MAC failed

View state issues with the error “Validation of viewstate MAC failed”. I ran across this error while building a report in ASP.net c# web forms. The error first started when a viewer refreshed the screen after a long period of no use. Evidently this is a common issue with dotNet apps located on a server instance that also houses several other applications within the same instance (same issues as those experienced with a Web Farm). One fix I found to get around this issue is to switch from auto-generated keys to defining static complex keys.

The following is generated from a completely random key generator that I have developed. Refresh the screen to generate a new set of keys.

validationKey is SHA1 and 128 bits
decryptionKey is AES and 64 bits

Add this to your web.config

[MachineKeyGen][/MachineKeyGen]

Adapted from this MSDN article on MachineKey Configuration.

http://msdn.microsoft.com/en-us/library/ff649308.aspx

Interesting Finds Number 2

Daniel Bingham Image courtesy of http://theroadgoeson.com/
Daniel Bingham Image courtesy of http://theroadgoeson.com/

Tonight while googling some terms I ran across Daniel Bingham’s website http://www.theroadgoeson.com. This guy seems pretty cool and his website covers topics that I am interested in such as permaculture, programming to include game engine development and web design. The website isn’t perfect and has some broken links but interesting.

Funny enough I have the same Refactoring book pictured on the coding link. Its about the use of existing code.

Game Engine is called Middle Earth Mud and is described as “a multi-user dungeon written in C++, designed to be as flexible for in game building as possible”.
http://theroadgoeson.com/code/project/middle-earth-mud
http://www.me-mud.org/
https://github.com/danielbingham/muddyreality
or
http://theroadgoeson.com/code/project/muddy-reality
http://muddyreality.me-mud.org/index.php
https://github.com/danielbingham/muddyreality

Farm to Fridge is an opensource web based farmers market
http://theroadgoeson.com/code/project/farm-to-fridge
http://www.farmtofridge.net/
https://github.com/danielbingham/FarmToFridge

Combine 2 or more xml files, sort, dedup and display with php

Want to combine 2 or more xml/rss files with php? This commented code should get you started.

The 2 xml files will need to be structured the same in order for this to work without adding more code. The 2 in this example are from the same source with different filters selected. This allows me to sort, filter and dedup using my own methods. You can then re-create the xml or simply display it on the screen like the example does below.

If you still need help feel free to comment below.

Code and Example below

<?php
//Sort Function by title
function sortFunction( $a, $b )
{
return strtotime($b["title"]) - strtotime($a["title"]);
}

$urllist = array();
//Define new xml files here by adding a new line with different urls
$urllist[] = “http://www.instructables.com/tag/type-question/rss.xml?count=100&sort=RECENT”;
$urllist[] = “http://www.instructables.com/tag/type-question/rss.xml?count=100&sort=UNANSWERED”;

//Loop through urllist array adding each item to one multidimensional array
//Define array before populating
$items = array();
foreach($urllist as $url)
{
$feed = simplexml_load_file($url);

//these item names are the child names in the xml
//channel is the wrapper in the xml
foreach($feed->channel->item as $item)
{
$items[] = array(
‘link’ => (string)$item->link,
‘image’ => (string)$item->imageThumb,
‘title’ => (string)$item->title,
‘pubdate’ => (string)$item->pubDate,
‘author’ => (string)$item->author
);
}
}

//Sort by Title
usort($items, “sortFunction”);

//Remove Duplicates
$items = array_map(“unserialize”, array_unique(array_map(“serialize”, $items)));

//Loop through the list and display them
$ictr = 0;
foreach ($items as $item)
{
echo “<div style=’float:left; width:200px; height:300px; margin-right:15px; text-align:center;’>”;
echo “<a href='” . $item[‘link’] . “‘ target=’_blank’>”;

if(strpos($item[‘image’],”defaultIMG”))
{
echo “<img src=’http://www.instructables.com/static/img/footer/footer-robot.png’ />”;
}
elseif(strpos($item[‘image’],”com”))
{
echo “<img src='” . $item[‘image’] . “‘ />”;
}
else
{
echo “<img src=’http://www.instructables.com” . $item[‘image’] . “‘ />”;
}
echo ‘<br />’ . $item[‘title’] . ‘<br />’;
echo ‘By: ‘ . $item[‘author’] . ‘ On ‘ . $item[‘pubdate’] . ‘</a></div>’;
}
echo “<div style=’clear: both;’>&nbsp;</div>”;
?>


Example of the output:

[phpCombineXMLArticle1][/phpCombineXMLArticle1]
Top