Sunday, January 15, 2012

Project Visual: Summary and remaining reports

Since the last post we have been very busy. The plugin system itself is working, loading and managing plugins nicely, but apart from that we have also integrated OpenGL through OpenTK. This means it is now possible to draw anything using OpenGL and it will be displayed on a canvas in Stoffi. We did run in to some technical difficulties with loading plugins at first, and when that was done we had some problems getting the plugin assembly to draw.

What was Project Visual
Project Visual set out to become a plugin based visualizer for Stoffi. We wanted anyone with C# skills to be able to make a visualizer.

OpenGL was desired due to being platform independent. There were several ideas for future development as well, but this was at the heart of it. Visualizers can be fun, but why not give the creativity to you, the user?

During the development of Project Visual the focus slightly changed from being just on a plugin based visualizer to being on a plugin system that could be used to make it possible to develop plugins for other parts of Stoffi as well.

Though we have succeeded in both making a general plugin system which in the future might mean that users can code their own parts of Stoffi, the visualizer is perhaps not as fancy as i set out to make it.

Here is where you will find the visualizer in Stoffi.

Making a Visualizer
Anyonw who wants to code a visualizer could do so with the current system. All you have to do is create a C# project, hook it up to a provided DLL, inherit class in said DLL and just implement a Refresh function. In this function it is now possible to draw anything using OpenGL, and it will be displayed on a canvas. But what is a visualizer if it's just pretty images? Shouldn't it move to the music? Indeed it should, which is why we provide the raw FFT data. Though not filtered in any way, this 1024 array of floats is a good base for building a visualizer. You could indeed code your own filters for this data as well.
When a visualizer is done it just have to be packaged into an SPP (Stoffi Plugin Package) file and either put in the plugin folder or dragged into Stoffi, and it will be loaded.

Just look how pretty it is.
(Please note that this was whipped together in a matter
of minutes with limited previous knowledge of OpenGL.)

The Future
At present it is only possible to get FFT data when playing local files, and not for YouTube. This is because they are not played in the same way. We consider this high priority and more of an issue compared to other future features.

There are several interesting ideas for the future of this feature. Of course you can probably look forward to being able to program other kinds of plugins in the future, but the visualizer alone holds some interesting future possibilities.

First of all the visualizer system should provide some functions which will enable you to make basic, but interesting, visualizers without being a C# or openGL guru. Second, it should provide some nice filters for the data. The idea is that we want to make it simple for as many as possible to make cool visualizers.

There are some interesting possibilities in making interactivity possible. Imagine being able to play a game inside Stoffi, or make your own music based game, with the comparatively easy to use tools provided. This also brings up the future idea of looking ahead in the data. This will mean analyzing a song ahead of time, which should bring interesting possibilities not only to interactive visualizers, but to visualizers in general.

Saturday, January 14, 2012

Updated blog design

The blog has been redesigned to better fit in with the design of the new, upcoming website.

You can change the layout by using the drop down menu in the upper left corner. The about pages are gone and in their place are a bunch of links to the website, the project site and to third party sites such as Facebook, Twitter and YouTube.

Hope you like it.

Tuesday, January 10, 2012

Alpha update: plugins, cloud, social

A new update has been sent to the alpha channel. Since the alpha channel hasn't been updated in a while most of these updates have already been available for some time in the beta channel. But there are some new stuff in here as well:

  • A new plugin system for visualizers
  • A welcome dialog for file associations (which doesn't do anything yet)
  • Icons indicating whether or not a search is active
  • Several bug fixes
Along with these the latest stuff from the beta channel is here as well: improved icon rendering, cloud connectivity and the ability to share songs on YouTube.

Project Social: Summary

Now the time for hackathon has come to a close and this project with it.

What was Project Social all about?

This project was about getting to share your songs and playlists through our newly created cloud system to Facebook, Twitter and Google+. For the most part it had the features we wanted to implement to Stoffi but what wasn't implemented I'll be talking about soon.

Sharing songs

The main goal of this project was to share a song, and to share it with ease. So putting it in a single button that would handle everything was obvious. Of course, you would need to be connected to a Stoffi account before sharing anything.

"Share" has been added to the context menu.

It's also required that the account is also in turn connected to Facebook, Twitter and/or Google+ before the song can be shared onto those sites. But that isn't needed to share at all since it's also uploaded to the account which has all necessary information, including your songs and playlists.

What's to come

The features that are still to be implemented are the abibilty to share a playlist and share a song to Google+.

Sharing a playlist proved to take some more time than what we thought so we felt it was best to postpone it to make time for the other features for this project. And sharing to Google+ has to wait as we're waiting for them to release their API so it can be possible to share.

One other thing that we had an idea of but didn't get to realize it in this project was to be able to stream music from your Stoffi account to other users and be a DJ to your friends! The problem that we had with this was more legal than anything else as you're not allowed to stream the music to too many people at the same time.

Project Remote: Summary

What was Project Remote?
Project Remote was part of the Stoffi Hackathon 2011 and was the realization of a remote control app for stoffi desktop players.

The app used the REST-ful interface of Project Genesis to push changes in a users configuration to the server, which then pushed the changes to the client being controlled.

The first part of the project was to securely connect to the cloud services of Stoffi. GTMOAuth, an open source OAuth library for iOS, was used to a accomplish this. To sign in, the user is presented with an embedded browser with the login page. This way, the user can also login using Facebook, twitter, linked in or other social networks thanks to the existing login system.

The second time you start the app, you will notice that no credentials are needed to login. The app automatically stores the authentication token and session information to restore a secure connection each startup. This information is, of course, erased if you choose to sign out of the app manually.

The remote
A one-view interface was created containing the various playback controls required. Several designs were tried and discarded and I ended up with a quite simple design that focuses on the most basic playback controls: current track, play/pause, previous/next and volume.

The design was created to give the feel of a remote control rather than a music player. This was achieved by removing direct playback control: The user cannot view his music library from the app. Instead, the app contains only the most basic interface elements required to remotely control a music player, similar to a stereo hardware remote.


The app was created with english as its default language and was localized for swedish using the native localization tools for iOS. The app will change the language automatically if you change the system language of your device.

The language files have a very simple format that can be directly sent to translators without any need of programming experience. The localization file currently consists of as little as 11 entries, making the translation work even easier.

Snap Play
To give the app uniqueness and "Wow"-effect, the Snap Play feature was added.

Snap Play allows you to hit "Play" without actually touching your device: When activated, the current track is paused and the app enters a listening mode that detects sudden peaks in volume. Once you snap your fingers, the current song starts playing.

The future of Stoffi Remote
The remote has a lot of room for improvement. Once Stoffi cloud services supports track history, queue and playlists, a lot of new functionality can be added. As the server is quite slow at the moment, all playback changes are quite delayed. Future versions of the app should display this to the user to give you a better feel of what's happening.

The current audio analysis of Snap Play is very simple and only registers changes in decibel. As a result, speaking can unintentionally trigger the feature. This can unfortunately only be fixed by adding pitch analysis, as speaking gives a very loud peak in volume. As a temporary safety measure, the feature is disabled if it detects too much background noise. Adding a better audio analysis function for this feature would greatly improve its "Wow"-effect and make it a much more impressive feature.

The app will be available for testing soon!

Project Genesis: Summary

The 5 month long hackathon draws to an end and we have handed in our first draft of the final report. On Wednesday we will have a demo of the resulting work for our coordinator.

The new "Service" settings where you connect Stoffi to the cloud.

In this last blog post I will summarize Project Genesis and the work that has been created in it's name.

What was Project Genesis?
The project was the birth of our cloud platform. By connecting the Stoffi Music Player to our cloud we will be able to provide countless of new services and cool features, both inside the player itself and as external applications.

Project Genesis was part of the Stoffi 2011 Hackathon which was a joint effort by a group of students at Uppsala University, part of our studies in Computer Science.

Account system
The first thing I did was add the ability to register and login on our website. To ease this process I decided to use OAuth which lets you register using your account on Facebook, Twitter, Google, Vimeo, SoundCloud, Rdio or LinkedIn. Thus, there's no need to create yet another password to remember.

The login screen inside Stoffi Music Player

For those of you who do register, you will notice how little information you actually need to type in. You only need to type in your email address and choose a password. There's no name, no age, no "which company have you worked for or schools have you attended" stuff. Email and password. That's it.

The registration form on the website

I made this choice since I want to limit the amount of personal information that you, our users, need to give us. This limits the impact a breach of security would have in case it would happen. To further enhance security I have enforced the use of a secure connection, password are hashed before submission, hashed further, even several times, before they are stored in the database and the hashing uses user specific salts and another salt which is not inside the database.

Hopefully, this will make it a bit easier for everyone to sleep at night.

With account systems in place and the ability to connect Stoffi Music Player I created the first cloud feature: synchronization.

I started simple and added synchronization of volume, repeat state, shuffle state, media state (paused or playing), and the current track. I also added API calls to tell connected players to switch to the next or previous track.

While Fredrik was busy creating an iOS app named Stoffi Remote which would use this API as a remote controller for Stoffi, I created a web interface to do the same. Since this would mostly be used on phones I made a mobile version of our website as well.

The My Stoffi page on the mobile website.

Once you have connected a Stoffi Music Player to the cloud and enabled synchronization you will be able to remotely control it using a normal browser on any computer, using a browser on a phone, or by using our new Stoffi Remote app for iPhone, iPad and iPod.

Remote controls on the mobile website.
In the next coming months I will further expand this feature. There's so much potential here.

Listening statistics
As part of Project Mind Reader, I and Martin decided to let you submit what songs you are listening to up to our server and there have us analyze the pattern in order to give you suggestions based on that. Of course. His project was not finished in time but we hope to have it ready within a few months. In the mean time you will at least have some rudimentary statistics on what your favorite artists and songs are.

This feature is of course opt-in, which means that it will not be enabled by default. After you connect Stoffi Music Player to your cloud account you will need to enable submissions of the songs you listen to. Everything to ensure privacy.

Donations to artists
Another new cool feature which is not exactly part of Project Genesis, but could be integrated with the new cloud is the ability for you to send money to any artist. You will only be able to send money to artists that have appeared in any form on the cloud system (by sharing, listening, synchronization). As people use our cloud more and more artists should appear.

The artist page on the website.
Each artist will be shown with the top songs, a short description from Wikipedia, a profile picture as well as a button to send them money.

When sending money you can select how much to send, what should happen if we can't find or reach the artists and how to distribute the money among the artist, us (Stoffi) and charity.

The donation form on the website.

You will be able to see the artist that have received the most donations and how much charity that artist has  generated.

Hopefully this will be an interesting new way for artists to generate income as well for us to get a way to pay some of our bills (hopefully).

Where to go from here
There's a lot more that can be done with all these new and shiny things. First I plan on adding synchronizations of playlists. I also plan on adding further integration with Google and YouTube, so you can import and synchronize playlist on YouTube as well.

I also want to add more services such as Yahoo! and MySpace. We are also waiting for Google+ to release their API and for Facebook to open their new Open Graph API so we can send the songs users listen to.

Do you have any suggestions on cloud services you think would be nice? Please let me know in the comments.

Monday, January 2, 2012

Project Genesis: Report 14

In between Christmas, GoDaddy fails, New Year and preparations for my daughter's arrival, I have been able to get some fixes in place. Mainly I've created top lists for artists and songs.

I've also been helping out on both Project Visual and Project Social.