Epic Music Time

Zombie

Active member
Veteran
Joined
Oct 14, 2010
Messages
2,676
Kin
241💸
Kumi
6💴
Trait Points
0⚔️
Awards
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

You must be registered for see images


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).

You must be registered for see images


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
You must be registered for see images


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.

You must be registered for see images


Use the kill command to kill the PID, example from my image: kill 8217 && kill 8218

Enjoy!
 
Last edited:

Wesobi

Active member
Legendary
Joined
Oct 28, 2010
Messages
13,052
Kin
0💸
Kumi
0💴
Trait Points
0⚔️
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.
 

Zombie

Active member
Veteran
Joined
Oct 14, 2010
Messages
2,676
Kin
241💸
Kumi
6💴
Trait Points
0⚔️
Awards
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.
 

gamahiro

Active member
Supreme
Joined
Jul 8, 2010
Messages
32,579
Kin
0💸
Kumi
0💴
Trait Points
0⚔️
Awards
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
 

Zombie

Active member
Veteran
Joined
Oct 14, 2010
Messages
2,676
Kin
241💸
Kumi
6💴
Trait Points
0⚔️
Awards
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:
Top