How To Write a Rap / House / Disco Song

Locked
Message
Author
User avatar
heinrich
Posts: 219
Joined: 22. Sep 1999 11:22
Location: N49.137 E8.544

How To Write a Rap / House / Disco Song

#1 Post by heinrich »

<font face="Courier New">How To Write a Rap / House / Disco Song</font><!--fixed-->
<font face="Courier New">***************************************</font><!--fixed-->

<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
#include <stdio.h>
#include <stdlib.h>

static char col1[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"Move it",
"Get up",
"Pump it up",
"Get down",
"Shake it",
"Pump the jam"
};

static char col2[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"to triple beat",
"get body heat",
"feel the beat",
"get around",
"the joint is jumpin'",
"feet are stompin'"
};

static char col3[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"in the city streets\<!--no-->n",
"you'll be humpin'\<!--no-->n",
"'til the night is over\<!--no-->n",
"shake your meat\<!--no-->n",
"I'm bustin' loose\<!--no-->n",
"with disco heat\<!--no-->n"
};


void chorus(int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->])
{
int i;

printf("\<!--no-->n(chorus)\<!--no-->n");
for (i = 0; i < 2; i++)
printf("%s %s %s",col1[chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col2[chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col3[chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->]);
printf("\<!--no-->n");
}

void verse(void)
{
int i;

for (i = 0; i < 4; i++)
{
printf("%s %s %s",col1[<!--no-->rand()%6<!--no-->],
col2[<!--no-->rand()%6<!--no-->],
col3[<!--no-->rand()%6<!--no-->]);
}
}

void lastline(int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->])
{
int i;

for (i = 0; i < 17; i++)
{
printf("%s %s %s",col1[chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col2[chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col3[chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->]);
}
}

void main(void)
{
int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->];
int i;
int j;
// int getpid();
long now;

/* Generate random seed */
now = time(&now) / rand();
// srand(getpid() + (int)((now >> 16) + now + time(&now)));
srand((int)((now >> 16) + now + time(&now)));

/* Generate chorus and title */
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
chor[<!--no-->i<!--no-->][<!--no-->j<!--no-->] = rand() % 6;
printf("\<!--no-->n\<!--no-->"%s\<!--no-->" by Mixmastermeatbeaters\<!--no-->n\<!--no-->n",col1[chor[<!--no-->0<!--no-->][<!--no-->0<!--no-->]<!--no-->]);

/* Print out song */
verse();
chorus(chor);
verse();
chorus(chor);
lastline(chor);
printf("-----\<!--no-->n");
}
</font><hr></pre></blockquote>

Leander Hanwald

Re: How To Write a Rap / House / Disco Song

#2 Post by Leander Hanwald »

Habe ich schonmal erwähnt das ich Pascal viel besser finde? ;)

Jochen

Re: How To Write a Rap / House / Disco Song

#3 Post by Jochen »

Hmm. Pascal eignet sich aber eher für Kantaten à la J.S. Bach! <img src="http://www.pl-forum.de/UltraBoard/Images/Happy.gif" border="0" align="middle">

Descartes

Re: How To Write a Rap / House / Disco Song

#4 Post by Descartes »

Und ein Port zu Win32 damit auch unsere Windows-Freunde sich ihre Songs mit C/C++ erzeugen können <img src="http://www.pl-forum.de/UltraBoard/Images/Happy.gif" border="0" align="middle">
<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
#include <stdio.h> // printf()
#include <stdlib.h> // rand(), srand()
#include <time.h> // time()
#ifndef WIN32
#include <unistd.h> // getpid()
#endif

static char col1[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"Move it",
"Get up",
"Pump it up",
"Get down",
"Shake it",
"Pump the jam"
};

static char col2[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"to triple beat",
"get body heat",
"feel the beat",
"get around",
"the joint is jumpin'",
"feet are stompin'"
};

static char col3[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"in the city streets\<!--no-->n",
"you'll be humpin'\<!--no-->n",
"'til the night is over\<!--no-->n",
"shake your meat\<!--no-->n",
"I'm bustin' loose\<!--no-->n",
"with disco heat\<!--no-->n"
};


void chorus(int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->])
{
int i;

printf("\<!--no-->n(chorus)\<!--no-->n");
for (i = 0; i < 2; i++)
printf("%s %s %s",col1[<!--no-->chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col2[<!--no-->chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col3[<!--no-->chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->]);
printf("\<!--no-->n");
}

void verse(void)
{
int i;

for (i = 0; i < 4; i++)
{
printf("%s %s %s",col1[<!--no-->rand()%6<!--no-->],
col2[<!--no-->rand()%6<!--no-->],
col3[<!--no-->rand()%6<!--no-->]);
}
}

void lastline(int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->])
{
int i;

for (i = 0; i < 17; i++)
{
printf("%s %s %s",col1[<!--no-->chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col2[<!--no-->chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col3[<!--no-->chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->]);
}
}

void main(void)
{
int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->];
int i;
int j;
// int getpid();
long now;

/* Generate random seed */
now = time(&now) / rand();
#ifndef WIN32
srand(getpid() + (int)((now >> 16) + now + time(&now)));
#else
srand((int)((now >> 16) + now + time(&now)));
#endif
/* Generate chorus and title */
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
chor[<!--no-->i<!--no-->][<!--no-->j<!--no-->] = rand() % 6;
printf("\<!--no-->n\"%s\" by Mixmastermeatbeaters\<!--no-->n\<!--no-->n",col1[<!--no-->chor[<!--no-->0<!--no-->][<!--no-->0<!--no-->]<!--no-->]);

/* Print out song */
verse();
chorus(chor);
verse();
chorus(chor);
lastline(chor);
printf("-----\<!--no-->n");
}
</font><hr></pre></blockquote>

TuX

Re: How To Write a Rap / House / Disco Song

#5 Post by TuX »

@Descartes
Im Win32-Port ist aber noch ein kleiner Fehler: statt <b>#ifndef WIN32</b> muss es <b>#ifndef __WIN32__</b> heissen...

<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">#include <stdio.h> // printf()
#include <stdlib.h> // rand(), srand()
#include <time.h> // time()
#ifndef __WIN32__
#include <unistd.h> // getpid()
#endif

static char col1[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"Move it",
"Get up",
"Pump it up",
"Get down",
"Shake it",
"Pump the jam"
};

static char col2[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"to triple beat",
"get body heat",
"feel the beat",
"get around",
"the joint is jumpin'",
"feet are stompin'"
};

static char col3[<!--no-->6<!--no-->][<!--no-->30<!--no-->] = {
"in the city streets\<!--no-->n",
"you'll be humpin'\<!--no-->n",
"'til the night is over\<!--no-->n",
"shake your meat\<!--no-->n",
"I'm bustin' loose\<!--no-->n",
"with disco heat\<!--no-->n"
};


void chorus(int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->])
{
int i;

printf("\<!--no-->n(chorus)\<!--no-->n");
for (i = 0; i < 2; i++)
printf("%s %s %s",col1[<!--no-->chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col2[<!--no-->chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col3[<!--no-->chor[<!--no-->i<!--no-->][<!--no-->0<!--no-->]<!--no-->]);
printf("\<!--no-->n");
}

void verse(void)
{
int i;

for (i = 0; i < 4; i++)
{
printf("%s %s %s",col1[<!--no-->rand()%6<!--no-->],
col2[<!--no-->rand()%6<!--no-->],
col3[<!--no-->rand()%6<!--no-->]);
}
}

void lastline(int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->])
{
int i;

for (i = 0; i < 17; i++)
{
printf("%s %s %s",col1[<!--no-->chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col2[<!--no-->chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->],
col3[<!--no-->chor[<!--no-->1<!--no-->][<!--no-->0<!--no-->]<!--no-->]);
}
}

void main(void)
{
int chor[<!--no-->2<!--no-->][<!--no-->3<!--no-->];
int i;
int j;
// int getpid();
long now;

/* Generate random seed */
now = time(&now) / rand();
#ifndef __WIN32__
srand(getpid() + (int)((now >> 16) + now + time(&now)));
#else
srand((int)((now >> 16) + now + time(&now)));
#endif
/* Generate chorus and title */
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
chor[<!--no-->i<!--no-->][<!--no-->j<!--no-->] = rand() % 6;
printf("\<!--no-->n\"%s\" by Mixmastermeatbeaters\<!--no-->n\<!--no-->n",col1[<!--no-->chor[<!--no-->0<!--no-->][<!--no-->0<!--no-->]<!--no-->]);

/* Print out song */
verse();
chorus(chor);
verse();
chorus(chor);
lastline(chor);
printf("-----\<!--no-->n");
}</font><hr></pre></blockquote>

Locked