Checking Amazon Wishlists for cheap stuff

I wanted a way to keep track of stuff I’d like, but don’t want to spend much money on, so I made semi private wishlist on Amazon and stuck all those things, mostly movies, on there. I then wrote a little script that checks to see if any items on that list are below a certain max price.

There are two parts. First is the Ruby script that I call from cron:

require 'rubygems'
require 'json'
require 'hpricot'
require 'yaml'
require 'open-uri'

MAX_PRICE = 7.00 wishlist = 'wishlistidgoeshere'

url = "{wishlist}?layout=compact" doc = Hpricot(open(url))

names ='.g-title').each do |item| thing ='a').inner_text.lstrip.rstrip names << thing unless thing.empty? end

prices ='.g-price').each do |item| thing ='span').inner_text.lstrip.rstrip.gsub('$','') prices << thing.to_f unless thing.empty? end

res = prices.each_with_index do |value, i| if value <= MAX_PRICE res[names[i]] = value end end

res.each do |name, price| /usr/bin/ "Amazon" "#{name} - #{price}" end

The Wishlist ID can be obtained by sharing the wishlist and grabbing the ID from the resulting URL.

The script is only a wrapper around Twurl. You can figure out how to get that going. Mine looks like this:


subject="$1" message="$2"

/usr/bin/twurl -d "status=${subject}: ${message}" /1.1/statuses/update.json

The tweets are posted to a private account I set up for stuff like that. My main account is its only follower.

Now just call the first script via cron however often you’d like to check and get good deals in good time!

NanoStudio wobble bass tutorial

NanoStudio is an awesome music app for iPhone &c. It’s really powerful yet simple to use, considering all that power. However, there is somewhat of a learning curve when trying to get your head around the Eden synth.

That’s why I decided to make a small tutorial that explains how to make a wobble bass. It’s based on this forum post by blip but will hopefully be a little more verbose and explanatory. As an Electrical Engineer I’m pretty fascinated by all kinds of signals and understand the theory, but this whole music making thing is new to me. NanoStudio has been very fun to play with though. It’s a great app! Remember, I’m just a newbie, too!

Before we start, you need to read the manual. Really. Do it now. At least the sections about the Eden synth. You may also want to keep the glossary handy.

Great. Pick any synth track and select a free project preset to write to. Name it something fitting, like “Wobble Bass.” You may want to periodically write the preset to the slot in case you get a call or something and lose your progress. I hear that will be a little more elegant in the future.

Save the instrument in one of the Project presets

To begin, scroll to the patchbay and unhook everything by setting all the destinations to Off. If you scroll back up to the XY pads, you’ll see the axes and knob labelled unused, together with all the LFOs and aux envelope further down. No worries though, we’ll hook some stuff back up in a bit.

Patchbay all cleared out

Scroll to the oscillator section. Here’s where all the sounds begin. You have two at your disposal that you can play with. Cycle through the waveforms and play a few notes to get a feel of what’s there and how it sounds.

For our wobble bass, we’ll use the SawSqr waveform in OscA. You can play with mixing something else into it from OscB, but I didn’t find anything that I liked, so I set it to off. Adjust the transpose to your liking, it just changes the pitch up or down in semitones. Mine’s around -10 or so for some nice bass. A whole octave would be -12.

Oscillators produce the sound

Next, we will play with the Filter and one of the XY pads to get familiar with what it does. To do that, go to the patchbay and hook up the XY pad 1 axes to Filter, Cutoff and Q, respectively, with amount to 100.

Filter parameters controlled by XY Pad 1

Back to the filter, set it to low pass (LP), 12dB, not inverted. Set cutoff and Q to 0, since we will be controlling it with the pad. If we had set the patchbay amount to -100, we’d have to set both cutoff and Q to their max values. You get the idea here, it’s additive. Next, set the envelope Amount to 0. The envelope controls the filter behavior, more specifically which frequencies are filtered, but we want nothing fancy. It works on top of the Cutoff knob, like the pads. For kicks, try setting that to the max and play with the Amount while playing a note and you won’t hear much happening, because max cutoff plus any Amount is still max cutoff.

Filter panel

Alright, now the filter is good to go. Go to the pads and play a note. While playing, slide the filter cutoff in the pad up and down (or left and right, depending on what axis you put the cutoff). It wobbles! That’s great…but a little tedious. We will fix that though.

XY Pad 1 controlling the Filter

Play around with the pad a bit to get a feel of everything and we will move on. Move the dot back into the bottom left corner before you continue, or it may sound funny when we get towards the end.

Next, let’s set Polyphony to 1-Mono. You can change it, but I like the single sound. Make sure to adjust reverb and delay when we’ve got the final sound to tweak your bass a bit; it doesn’t make much sense to do that right now. The other setting on this panel is the amp envelope. It controls the volume (AMPlitude) of the note over time. Gradual Attack means it gets louder over time, sharp Attack means it’s right there when you hit the key. Sustain/Release set how long after you release the key the note echoes around. I like my bass a little shorter, so I set Release down to 0.30. One more setting to play with and make your own!

Amp envelope and polyphony

Finally, the key to our tutorial! Wobbling the bass manually is lame, so let’s have the synth do it for us. As we know by now, we need to move the filter cutoff back and forth at some rate that fits the song to make the wobble. Meet the LFO, low frequency oscillator! That’s exactly what it does: move something back and forth at some frequency. So go to the patchbay, hook up LFO1 to Filter, Cutoff, 100, and go back to the LFO panel.

LFO1 hooked up to Filter Cutoff

Set waveform to SawUp, which I think sounds the best. Sync rate with Key or Beat, up to you. Now dial up the amount and rate to hear the LFO wobble the bass for you! (If you didn’t move the XY pad dot back into the bottom left corner earlier, it may be all high pitched and funny sounding, if it wobbles at all. That’s because both LFO1 and the pad are set to manipulate the Filter Cutoff. So fix that if you have trouble here.)

LFO1 setup for testing wobble

We can one-up that though. It would be useful to change the wobble rate live, so let’s use the Knob or, in this case, the other XY pad. To the patchbay! We already know how to do this: For the XYPad 2 axes, destination LFO1, Rate and Amount, respectively, and Amount 100.

Hook up LFO1 parameters to XY Pad 2

Remember to dial the two knobs in LFO1 back to 0 for that.

When using the XY Pad, set LFO1 parameters to 0

Now the first pad controls the filter, and the second the wobble rate and amount. Not bad!

Control the wobble with XY Pad 2

Hope you learned a little bit about how the Eden synth works and lost your fear of all the settings. It’s really pretty straightforward when you play with it a bit. Now you should be able to make all kinds of sweet sounds and take this to the next level. Rock on!

Bonus: instead of using the first XY pad to control the filter, make some cool effects with the Chronos delay panel!

Tetris in HC12 assembly

It’s been a while since we actually completed this project, but here’s the video finally. Basic HC12 dev board, PS2 controller on the SPI bus and the LCD display on two of the I/O ports.

All the code is on GitHub for your reusing pleasure:

Note that you need the exact hardware to reproduce it, especially the display and an HC12. Maybe I will get around looking up the model # of the LCD display someday.

Darkness during Christ’s Crucifixion an Eclipse?

Luke 23:44f says:

It was now about the sixth hour, and darkness fell over the whole land until the ninth hour, because the sun was obscured; and the veil of the temple was torn in two. (NASB)

The popular naturalistic explanation for that is an eclipse. The sun was obscured by the moon, obviously. Dr Ehrman also hints at that in his “The New Testament” text in chapter 9 on the Gospel of Luke.

That explanation is, of course, totally wrong and somewhat hilarious. The Jews use a lunar calendar to determine their festivals, and Passover is no different.

From Wikipedia:

Passover begins on the 15th day of the month of Nisan, which corresponds to the full moon of Nisan, the first month of the Hebrew calendar, in accordance with the Hebrew Bible.

Now, an eclipse during a full moon is truly a miracle, even for the anti-supernatural standard applied to the Bible by mainline scholars.

The Historical Jesus in the Synoptics

Examining the historical Jesus in the synoptic gospels was an assignment in a religious studies class I am currently taking. It may be useful for your own studies and point to you more resources based on my bibliography.

From the introduction:

As any careful reader of the NT gospels will notice, Mark, Matthew, and Luke have striking similarities as well as significant differences. Each gospel has a different emphasis, a slightly different order of events, and a different target audiences. Each portrays Jesus in a different role. Therefore the first question is how are the accounts of the synoptics different? What are the differences, and what picture of Jesus can be gathered from each? Next, what does the result mean for the study of the historical Jesus? Is it important, and if so, why?

The Historical Jesus

When you stand over your child’s dead body

Got this in today’s Grace Gem. The quote is by C.H. Spurgeon.

May you so live, that when you stand over your child’s dead body, you may never hear a voice coming up from that clay, “Father, your negligence was my destruction! Mother, your prayerlessness was the instrument of my damnation!
Impress these words of Mine on your hearts and minds . . . Teach them to your children, talking about them when you sit at home and when you walk along the road, when you lie down and when you get up.” Deuteronomy 11:18-19

Ouch. Christian parent, are you praying for your children and training them in the way they should go? (Proverbs 22:6)

Be filled with the Spirit

Ever wonder what it means to be filled with the Spirit? In Ephesians 5, Paul explains the symptoms of a Spirit-filled Christian and even commands it. So what does that look like? I am indebted to John MacArthur for pointing the following out.

Let’s read the text first, starting in verse 18:

And do not get drunk with wine, for that is dissipation, but be filled with the Spirit, speaking to one another in psalms and hymns and spiritual songs, singing and making melody with your heart to the Lord; always giving thanks for all things in the name of our Lord Jesus Christ to God, even the Father; and be subject to one another in the fear of Christ. Wives [...]. Husbands [...]. Children [...]. Fathers [...]. (NASB)

Alright, here’s the command and the symptom of what it means to be Spirit filled. Now compare the parallel passage in Colossians 3, starting in verse 16:

Let the word of Christ richly dwell within you, with all wisdom teaching and admonishing one another with psalms and hymns and spiritual songs, singing with thankfulness in your hearts to God. Whatever you do in word or deed, do all in the name of the Lord Jesus, giving thanks through Him to God the Father. Wives [...]. Husbands [...]. Children [...]. Fathers [...]. (NASB)

Now compare the two. Look pretty similar, don’t they. Notice the first part of the first verse. In Ephesians, Paul says “be filled with the Spirit”, but in Colossians, he commands us to “[l]et the word of Christ richly dwell within you.” Both commands yield the same result, so being filled with the Spirit means to let the word of Christ richly dwell within us.

What’s the word of Christ? Follow your cross references to get an example of what that means. At the very least it means the Gospel message, but we can understand it to mean the whole revelation of God to us, i.e. the Bible. So if you never thought that reading the Bible was necessary, consider these passages. I’d also make sure to read 1 John and supplement it with my Good Person Test to test whether you are even truly saved because there is no Christian who does not desire to read God’s complete, inerrant, infallible, sufficient revelation to man. What do you think?

various things that are seldomly updated.