-
Braaaaiiiins
|
|
|
 |
Epic Music Time
This code below is a shell script that will produce immense amounts of Nostalgia for NB's older crowd. The script uses a.out to play audio in 8bits at a 8000MHz in mono.
Warning: You will need a bash/shell environment for this bash/shell script to work. A GNU/Linux disto (Debian, Gentoo, Arch, Slack etc), or a BSD will work (I don't know much about BSD to be honest, so I will explain everything from a GNU/Linux perspective).
Code:
echo "main(i){for(i=0;;i++)putchar(((i*(i>>8|i>>9)&46&i >>8))^(i&i>>13|i>>6));}" | gcc -x c - && ./a.out | aplay
Step One: Open a shell terminal

It should by default place you in your home folder, /home/username/ and it's up to you if you want to create another folder or create the script directly in your home folder. For this example, I will plot it directly into the home folder.
Step Two: Inserting the code
From here, you will use nano (unless of course you're more experienced, then you would have just copied the code and gone off and done your own thing).
nano music.sh
This will open a non-graphical text editor. Don't get scared, all you're going to do is copy and paste the code (you will have to right click inside the terminal window and choose paste from the pop up menu).

At this point, you will hit ctrl+o, that will write the changes you made to music.sh. After which you will use ctrl+x to exit nano.
Step Three: Starting the script.
You should be back in your home directory, use chmod +x to make the shell script executable.
Then all you have to do is run the script
./music.sh

Warning: To stop this script, use ctrl+c. Else, if you close the terminal window and find yourself unable to halt it, use ps -ef and look for ./a. out and aplay. To the left will be the PID (process ID) you will need to kill it.

Use the kill command to kill the PID, example from my image: kill 8217 && kill 8218
Enjoy!
|
|
| |
|
|
Last edited by Zombie; 01-10-2013 at 01:31 PM.
-
Black Leg Sanji
-
Usurper King Zant
-
â•∩╮(︶︿︶)⠕∩╮
-
Braaaaiiiins
|
|
|
 |
Re: Epic Music Time
Tutorial is done. If you need help, explanations on commands, etc, just ask.
|
|
| |
|
|
Last edited by Zombie; 01-10-2013 at 12:44 PM.
-
Hiraishin no jutsu
-
Braaaaiiiins
|
|
|
 |
Re: Epic Music Time
 Originally Posted by kladarakun
what's this
See post above yours.
|
|
| |
|
|
Last edited by Zombie; 01-10-2013 at 01:08 PM.
-
|
|
|
 |
Re: Epic Music Time
This code below is a shell script that will produce immense amounts of Nostalgia for OPB's older crowd.
how does this explain what it does, or what it's for? It produces nostalgia... That could be about anything, please explain more thoroughly. Also, if it's for OPB's older crowd, I think you switched up forums.
|
|
| |
|
|
-
Braaaaiiiins
|
|
|
 |
Re: Epic Music Time
 Originally Posted by Wesobi
This code below is a shell script that will produce immense amounts of Nostalgia for OPB's older crowd.
how does this explain what it does, or what it's for? It produces nostalgia... That could be about anything, please explain more thoroughly. Also, if it's for OPB's older crowd, I think you switched up forums.
Ah, didn't notice I forgot to edit that part to NB's older crowd. ;o I'll explain it a bit more briefly then too.
Good catch on that. I didn't think to explain what exactly the script did, as I can look at the script and tell exactly what it does. Well, I put a little more of a brief explanation in. I'll go into much further details if people want, but that will take many many paragraphs.
|
|
| |
|
|
-
turtles
|
|
|
 |
Re: Epic Music Time
err..you can just copy and paste that code right in a terminal and ctrl-z to kill it when you're bored after 5 seconds. And, cd to someplace with a lot of space if you plan on playing it for more than a few seconds. rm a.out too
|
|
| |
|
|
-
Braaaaiiiins
|
|
|
 |
Re: Epic Music Time
 Originally Posted by gamahiro
err..you can just copy and paste that code right in a terminal and ctrl-z to kill it when you're bored after 5 seconds. And, cd to someplace with a lot of space if you plan on playing it for more than a few seconds. rm a.out too
I'd hope people would have a lot of space in their /home partition. ;o
And I was aiming the whole making a music.sh file at people who've never done anything like this before, that way they can garner some experience. ;D
|
|
| |
|
|
Last edited by Zombie; 01-10-2013 at 02:22 PM.
-
der Fehler
|
|
|
 |
Re: Epic Music Time
 Originally Posted by rinnemaki
what?
 Originally Posted by COLONELJJ81
what?
 Originally Posted by PainTotheEarth
what do u mean ?
 Originally Posted by kladarakun
what's this
dat nb
|
|
| |
|
|
-
Braaaaiiiins
|
|
|
 |
Re: Epic Music Time
 Originally Posted by Phail
dat nb
Of course they'd get it.
|
|
| |
|
|
-
Academy Student
|
|
|
 |
Re: Epic Music Time
I see.
Quite nostalgic indeed.
|
|
| |
|
|
-
Braaaaiiiins
|
|
|
 |
Re: Epic Music Time
 Originally Posted by testing123
 I see.
Quite nostalgic indeed.
Claims nostalgia, is still a child.
|
|
| |
|
|
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|