Archive for the 'Programming' Category
Sunday, September 14th, 2008
A new (working) itunes lyric downloader
With the recently released iTunes 8.0, it seems that my itunes tagger app’s similar playlist functionality isn’t a big priority anymore. While I sometimes like the results from last.fm’s similar tracks better than itunes’, having Genius built into itunes is just a lot more convenient.
The one thing iTunes is still (surprisingly) missing is automatic lyrics downloading. A while back I wrote a quick program to find some lyrics from lyricwiki and sing365, but it has since become terribly outdated and provided no relevant results. And since I still get a couple hits a day for that program, I thought I’d update it for y’all.
Sunday, August 10th, 2008
Updated itunes tagger program
The itunes last.fm tagger program has been updated. The old beta version has replaced the current itunes tagger program, and there is a new beta program on this page. The beta version has a couple cool new features that you might want to check out, including faster tagging, last.fm tag submissions, and similar tracks playlist generating.
Thursday, June 5th, 2008
itunes lastfm tagger now open source!
Alright, so it’s all out there in the open now. If you download it, it’ll probably be the worst coding you’ve seen. But maybe some people can fix that? We shall see. Anyways, have fun folks. Just goes to show that if enough people ask for open source, they’ll get it.
Sidenote: I love open source and all it stands for. And I know it took me a while, but I really wanted to write this one by my lonesome, as it’s my first ever program that’s actually starting to be useful. But, I can see a lot of potential here as well, so it’s time to let it run free ![]()
Link: http://code.google.com/p/itunes-lastfm-tagger/
Thursday, May 15th, 2008
New iTunes Last.FM Tagger Release
I’ve just put together a new beta release of itunes tagger. It includes a couple really exciting features, which took a little bit more coding under the hood, but I think it was worth it.
- saves a list of tagged tracks
- saves your options on exit
- can make a playlist from a selected tag
- better error catching!
Thursday, April 3rd, 2008
iTunes Last.FM Tagger v1.4 beta
I just finished updating the last.fm tagger. It actually wasn’t too bad finishing it off in vb.net. I’ll be looking to add some other features to the program in the near future. Leave a comment if there’s anything in particular that you’d like to see.
Monday, March 10th, 2008
Last.fm similar track playlists in iTunes
I’ve just come up with an idea to continue the trend of writing software to extend last.fm’s web services. This program is just a little example so you can see the direction I’m heading. The program takes some selected tracks and will automatically create an itunes playlist of similar tracks (according to last.fm) that it finds in your library. It also spits out an approximate accuracy (just for curiosity’s sake). Give it a try, and if you like the idea, leave a comment and I’ll probably put more work into it. Maybe I’ll even compile it to work with some of my other programs.
This isn’t a real release, so take it with a grain of salt. Requires/will install .Net Framework 3.5.
[Download] (now it runs an installer to fix some dependency issues)
The possibilities for this program are endless really. Some ideas would be:
- Limit the playlist to contain only songs with a particular tag in the comments (would work well with itunes tagger)
- Create automatic playlists from itunes’ most played tracks
- Allow user to specify the approximate popularity of the track (ie only songs you listen to a lot, only songs you rarely hear, somewhere in between)
- Exclude certain ratings, skip counts, etc
There is also another program out there that will create playlists for you based on various last.fm data. It’s called Local.fm, available here.
Thursday, March 6th, 2008
iTunes Last.FM Tagger v.1.3 beta
So, here it is. I finally got around to working on Cherbonsy’s suggestion of using the top Artist tag instead of the track tag from last.fm. I’ve updated the iTunes Tagger Page, so go take a look.
Wednesday, March 5th, 2008
Use Any Old IR Remote to Control Your Computer
Once I moved my old PC into the living room to act as a media pc, I decided it just wasn’t practical to carry the keyboard around whenever I was doing work on my computer. The good news is, you can use your basic computer functions with a simple IR remote control.
1.Get yourself an IR Receiver and old remote.
I got mine from this site for $12 plus shipping. I think his price went up to $18 for the same model since then. Make sure you ask for a windows optimized unit if you buy it from him. If you’d rather do it all yourself, you can try following the instructions from the source at WinLIRC. You can also just buy any other computer remote at your local hardware store, but I’m not sure it’ll be compatible with winLIRC (though it probably comes with it’s own software). Basically, you’ll want to make sure your receiver is connected via a serial connection on your computer, or else check WinLIRC documentation for your remote. The only receiver I can guarantee is the one I use that I mentioned above.
The trick with the remote is that not all signals are recognizable by WinLIRC. 2 of the 4 remotes I have in my house worked fine. One other one I was able to configure with winlirc, but the signal response isn’t solid enough to actually use. In most cases, the best remotes are older ones that you have lying around from your plain old DVD player or TV.
2.Download and run WinLIRC
Get WinLIRC and run the program (it doesn’t require an install). Click on reconfigure… all the default settings are fine for my IR receiver. Yours may vary. Next you need to see if WinLIRC recognizes the remote signal. This is done by clicking “Learn” and following the on-screen instructions. Don’t forget to click “Analyze” when you’re done. Now you should have a .cf file located in your WinLIRC directory, named according to the remote name you gave. You can open this config file in notepad and see all the settings WinLIRC has determined for your remote. If you have WinLIRC running, you should see the “light” in the system tray turn green whenever you press one of your configured buttons. If not, something is wrong.
3. Set up a program to receive the signals
This part is probably where most users find that WinLIRC is too much work than it’s worth. That said, there are a few plugins set up for WinLIRC found at the bottom of this page. There is also an AutoHotKey script set up for WinLIRC if you’re familiar with that program. I plan on preparing my own program in Visual Basic to run and receive the remote signals. This will potentially give me the flexibility of allowing any key to perform any task I desire. It will also potentially require a large amount of work. I’ve written only one portion so far, and it enables this tiny remote to perform some essential itunes commands. The remote config file is available here. The program is up for download here. If you just run the program, you’ll need to configure your buttons to match my configuration file above.
If you’d like to write your own program, WinLIRC has a nice little writeup on how to receive winLIRC signals in Visual Basic.
In the future, I’d like to make the program work with a variety of other programs, and ideally I’d like to set up a little GUI that functions as a way to open movies, songs, or even web pages using nothing but a remote control.
Thursday, February 21st, 2008
iTunes Guitar Tab Downloader Released
Today I wrote a quick program that will automatically search for tabs of the selected tracks in iTunes. The tabs are saved as text files in a specified folder.
I’ve noticed over the years that it’s nice to have copies of guitar tabs on your computer, especially for days where the internet is broken and you have nothing to do. I also like the option of selecting all of my favourite tracks in iTunes (ie my 3-star+ smart playlist) and just browsing the text files. A lot of times it just doesn’t cross my mind to try and learn a certain song on guitar. Anyways, try it out and enjoy!
Tuesday, February 19th, 2008
How to change your MSN Display Picture to iTunes’ Current Playing Album Art
Update: If you’d rather just download a program instead of writing your own to do this for you, take a look at CD Art Display. It’s free to download, and will do even more than just show album art in your msn profile picture.
This little howto is actually quite involved. I wasn’t quite sure what was possible with the new Live Messenger Addin capability, but as it turns out, it is quite difficult to bypass some of the barriers set up by the addin technology. If you are really intent on getting this set up, or are just curious about what I did to get it going, feel free to read on.
A note to those who aren’t interested in the programming side of this post: I’ll post the files you need to download throughout the howto, but these files are not really recommended for everyday use. The actual solution I’ve come to is a pretty odd workaround, though it does work, so feel free to give it a try if you’re brave. You’ll need to go through each step, but you can just download the files for #1 and #4.
What you’ll need:
-some knowledge of VB.Net and a visual studio version with vb.net
-itunes 7.x
-a bit of free time
Step 1: Set up Live Messenger to allow Addins
The new Live Messenger does have addin capabilities built in, but they are not enabled by default (they’re in beta I guess). To enable addins, you’ll have to edit your messenger registry entries. Go to Run, type “regedit” and hit enter. then browse to “HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger” and add a “DWORD” entry called “AddInFeatureEnabled” and change it’s value to 1. Now restart your Live Messenger and go to Options. There should be a tab called “Add-ins”. You’re Messenger is all set to go.
Step 2: Write your .dll file for the Addin
Open up visual studio and start a new Class Library. You’ll want to set up the project name right away, since your Class name has to be the same as the assembly name. Make sure your root namespace is empty. Add the MessengerClient.dll reference (browse to C:\Program Files\Windows Live\Messenger). Then you’ll want to go through and look at this code (download the .dll here):
Imports Microsoft.Messenger
Public Class MessengerAddin ‘<- *Important* this is your assembly name!!
Implements IMessengerAddIn
Public theMessenger As MessengerClientPublic Sub Initialize(ByVal messenger As Microsoft.Messenger.MessengerClient)
Implements Microsoft.Messenger.IMessengerAddIn.Initialize
Me.theMessenger = messenger
Me.theMessenger.AddInProperties.Creator = “SkyCapitan”
Me.theMessenger.AddInProperties.Description = “iTunes Art plugin!”
Me.theMessenger.AddInProperties.FriendlyName = “SkyCapitan’s Addin”
Me.theMessenger.AddInProperties.PersonalStatusMessage = TimeOfDay & ” - Sky’s not listening to music….”
Me.theMessenger.AddInProperties.Url = New Uri(”http://svankruistum.com”)Dim systime As New System.Timers.Timer()
systime.Interval = 5000 ‘This will check our config file every 5 seconds to see if the track has changed
systime.Enabled = True
AddHandler systime.Elapsed, AddressOf OnTimedEventEnd Sub
Public Sub OnTimedEvent()On Error Resume Next ‘in case the config file is not “0″ or an artist_ or album combination
Dim tempin As String
Dim jpeg As String
Dim oRead As System.IO.StreamReader
Dim oWrite As System.IO.StreamWriteroRead = New System.IO.StreamReader(”C:\art\config.txt”)
tempin = oRead.ReadLineIf tempin = “0″ Then
oRead.Close() ‘Nothing new we have to do
Else
jpeg = tempin
‘Change the picture
Me.theMessenger.AddInProperties.UserTile = System.Drawing.Image.FromFile(”C:\art\” & jpeg & “.jpg”)
oRead.Close()
‘Change the config file back to “0″
oWrite = New System.IO.StreamWriter(”C:\art\config.txt”)
oWrite.Write(”0″)
oWrite.Close()End If
End Sub
End Class
A large part of this code is courtesy of a blog post at Nick’s .NET Travels, found here. His example sets up a few other Messenger Events that you might like to explore. There is a lot of opportunity for some interesting addins.
The addin should be operational at this point, but another problem lies with MSN’s strict sandbox for addins…
Step 3: Set up your MessengerAddin.dll to allow the System reference
The code above needs to access the system namespace for a few reasons: get the art file, check the config file, and use the system timer. Due to the sandbox restrictions in place by MSN Messenger, we need to register the addin on our system.
To do this, first you must sign your file. This is done under Project Properties -> signing. Sign the addin and add a password of your choice.
Next, you’ll need to save and build the class library. Then browse to the location of the built .dll file. Now you need to drag and drop the file into your C:\WINDOWS\assembly folder.
Open up MSN, and try enabling your addin. Everything should work (though you don’t have the artwork and the appropriate config file yet).
Step 4: Create a program to save your artwork and config file
After creating a few past itunes programs, I just had to edit a few lines in my itunes displayer program. If you don’t want to create your own program, here is an adjusted version of itunes_displayer for you to run. This isn’t really ideal, since a popup jumps up every track change, etc. here’s some code (it’s vb6, not vb.net) that might help you to set it up:
‘Declarations
‘Allows us to communicate with the running iTunes application
Dim WithEvents iTunes As iTunesApp
Dim Track As iTunesLib.IITTrack‘iTunes play event
Private Sub iTunes_OnPlayerPlayEvent(ByVal iTrack As Variant)‘Find the current track
Set Track = iTunes.CurrentTrackDim Art1 As iTunesLib.IITArtworkCollection
Dim Art2 As iTunesLib.IITArtwork
Set Art1 = Track.ArtworkIf Art1.Count > 0 Then
Set Art2 = Art1.Item(1)
Art2.SaveArtworkToFile (”C:\art\” & Track.Artist & ” - ” & Track.Album & “.jpg”)
Open “C:\art\config.txt” For Output As #5
Print #5, Track.Artist & ” - ” & Track.Album
Close #5End If
End Sub
Either way, you’ll need the artwork and the config file one way or another.
Now all you need to do is run the itunes_displayer program (or your own alternative), and then enable the addin! Hope it works out for you!
A few notes:
-Your messenger picture does not change in real time for everyone. When you have an active conversation open, the person might see your picture change. If not, it won’t always be apparent to others that your picture is changing.
-I had to make all the files and such because despite the signed dll and assembly folder move, the sandbox still doesnt let me open an itunes reference from within the addin. If anyone knows a more efficient way to do this, i’d love to hear it!!