Skip to content

๐ŸŽถ A tee-shirt which programmatically "sings" a song

License

Notifications You must be signed in to change notification settings

Drarig29/tee-shirt-song

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

43 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tee-shirt song

Release

The code below (source) DOES work and it outputs the lyrics (as shown in the gif below).

Nothing is hardcoded.

#include "logic.hpp"

int main()
{
  /**
   * Guess the song... ๐Ÿ˜Œ ๐Ÿ˜Ž
   */

  imagine(!heaven) == "easy";
  us.below = !hell;
  us.above = sky;
  imagineAll("living for today");

  imagine(!countries) != "hard";
  (kill || die).reasons.length == 0;
  religion = undefined;
  imagineAll("living life in peace");

  chorus(); //๐ŸŽต๐ŸŽถ

  imagine(!possessions) ? "๐Ÿ˜€" : "๐Ÿ˜ฅ";
  need(greed || hunger) == false;
  men.reduce([]() { return "brothers"; });
  imagineAll("sharing all the world");

  chorus(); //๐ŸŽต๐ŸŽถ
}

Demo of the executable

Run it

To run the program without compiling it, run the following:

bash <(curl -s https://drarig29.github.io/tee-shirt-song/run.sh)

If VLC is installed on your computer, the MIDI file embedded in the code will be played.

Note: On Linux, VLC requires the vlc-plugin-fluidsynth plugin to play MIDI files (more info).

Disclaimer

I made this translation from a song's lyrics into source code with JavaScript in mind. But to actually implement it, I had to use a lower level language to overload operators, so I chose C++.

Because I used C++, the only difference you'll see between the original source code and the C++ implementation will be the strings (with the use double quotes instead of single quotes) and the lambda function syntax.

Copyright

You can make your own tee-shirt with this "art", I own one personally. If you need the SVG file, just ask me.

About

๐ŸŽถ A tee-shirt which programmatically "sings" a song

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages