<?
// write values to a file.

#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <math.h>

int main()
{
  
int value[1] = {255};
  
char filename[] = "sil.wav";
  
int file_descriptorclose_err;
  
int incrementcurend;
  
int passes 1;
  
int volcontrol 10;
  
  
srand((unsigned inttime (NULL));

  
file_descriptor open (filenameO_RDWR);

  
int i;
  
end lseek(file_descriptor0SEEK_END) - 10;        // detect end of file
  
cur lseek(file_descriptor54SEEK_SET);            // start from beginning of file, but after header
  
float pitch 0.01;
  
/* write until file ends */
  
while(cur end/2)
  {
    
value[0] = (int) 256 sin(pitch*((float) cur));
    
value[0] = value[0] / volcontrol;
    
write (file_descriptor, (void *) value1);
    
cur lseek(file_descriptor0SEEK_CUR);
    
pitch *= 1.00001;
  }
  
pitch 1024;
  
int cutoff;
  while(
cur end)
  {
    
value[0] = cur%((int) pitch);
    
cutoff = (int) (pitch 2);
    if (
value[0] > cutoff)
    {
      
value[0] = 255;
    }
    else
    {
      
value[0] = 0;
    }
    
value[0] = value[0] / volcontrol;
    
write (file_descriptor, (void *) value1);
    
pitch /= 1.00001;
    
cur lseek(file_descriptor0SEEK_CUR);
  }
  
  
printf("Done \n");
  
close (file_descriptor);

  return 
0;
}
?>
Databending - TranceAddict Forums

Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > DJing / Production / Promotion > Production Studio > Databending
  Last Thread   Next Thread
Share
Author
Thread    Post A Reply
Vector A
Your petrochemical arms



Registered: Apr 2011
Location: U.S.
Databending

"Databending" is taking files that were meant to be interpreted by your computer in one way and editing or interpreting them in another way. For example, you could take an image or text or executable file, and load it into a WAV editor as sound. This generally leads to some pretty crazy (and mostly very noisy) results.

For example, my post so far, copied a thousand times, sounds like this when imported into Audacity as raw data (File > Import > Raw Data > signed 8 bit stereo PCM):

http://dl.dropbox.com/u/27221906/TA/post.mp3

It's kind of hard to predict just by looking at a file how a WAV editor will interpret it. The sound will also change depending on the bit rate and other options you select when loading the data. But for me the unpredictability is part of the fun. I've found that large DOC and PDF files can give some good results, while JPGs usually seem to end up as just white noise. If you're into programming, you can also try generating large files of your own within some parameters (for example, write random numbers or letters, or paste randomly chosen text blocks from a pre-defined set to a file) and see how your WAV editor interprets them. With bigger and more varied files, you generally get more sounds and have a better chance of finding something interesting.

Here are some neat noises I got by loading different kinds of files into Audacity, plus some trial and error with programming random output (make sure your volume is reasonable before listening):

http://dl.dropbox.com/u/27221906/TA/datab.wav

There are also other things you can do, like opening a sound file in a hex or text editor, replacing or altering large portions of it, then trying to play it. Of course, you can also databend with other types of files in mind for the end product, like images, though I haven't really looked into that yet.

Anyway, a lot of the fun of this kind of thing is seeing what you can come up with on your own. So if you mess with some files yourself and find something you enjoy, I'd like to hear it.

Old Post Jul-27-2012 14:46  United States
Click Here to See the Profile for Vector A Click here to Send Vector A a Private Message Add Vector A to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Vector A
Your petrochemical arms



Registered: Apr 2011
Location: U.S.

Here's a basic example of how you can use a program that makes random text. This Ruby program makes a new file, prints a random character in it, and inserts a random number of spaces after the character. It does this 50,000 times. As the program goes on, the maximum for the random number of spaces increases (so the characters tend to get sparser):

code:
1.times do |x| f = File.new("rand1", "w") 50000.times do |y| ch = (33+rand(45)).chr f.print ch, " "*rand(y/10) end f.close end

A normal text file full of random characters (no spaces) will sound something like this when loaded in Audacity:

http://dl.dropbox.com/u/27221906/TA/rand0txt.wav

But the one created by the program above is a bit more interesting:

http://dl.dropbox.com/u/27221906/TA/rand1txt.wav

You can hear the little "static bits" getting further apart as the file plays.

Old Post Jul-27-2012 15:26  United States
Click Here to See the Profile for Vector A Click here to Send Vector A a Private Message Add Vector A to your buddy list Vector A is online now Report this Post Reply w/Quote Edit/Delete Message
itsamemario
Divine Angel



Registered: Jun 2001
Location: Mushroom Kingdom

cool stuff. sounds SIDy


___________________
BA-DUM-TSS


quote:

ALFI - BOHICA - DJ MIX (Stream+Dropbox)

Old Post Jul-27-2012 16:06  Norway
Click Here to See the Profile for itsamemario Click here to Send itsamemario a Private Message Visit itsamemario's homepage! Add itsamemario to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Vector A
Your petrochemical arms



Registered: Apr 2011
Location: U.S.

So, I've figured out how to make some basic waveforms by writing numbers to files.

PHP:



If you compile and run the C program (with appropriate filename entered), this is what you get:

http://dl.dropbox.com/u/27221906/TA/sil.wav

The pitch-bending sounds really screwed up on the square wave, not sure why yet, lol. You can also make a saw wave with the modulus operator (something like "value[0] = cur % 256;", with higher values for lower frequencies). I am a n00b at C so I'm sure there are tons of things that could be done better.

Old Post Aug-20-2012 16:17  United States
Click Here to See the Profile for Vector A Click here to Send Vector A a Private Message Add Vector A to your buddy list Vector A is online now Report this Post Reply w/Quote Edit/Delete Message
KilldaDJ
birth.school.trance.death



Registered: Sep 2001
Location: tranceaddict wants to know your location

lol a lot of it is mostly noise !


___________________


Found Atlantis - Mixography [mix archive/mokumentary/my soul]?
i writed a song.

Old Post Aug-20-2012 19:44 
Click Here to See the Profile for KilldaDJ Click here to Send KilldaDJ a Private Message Visit KilldaDJ's homepage! Add KilldaDJ to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Vector A
Your petrochemical arms



Registered: Apr 2011
Location: U.S.

quote:
Originally posted by KilldaDJ
lol a lot of it is mostly noise !

http://dl.dropbox.com/u/27221906/TA/hello.wav

Old Post Aug-20-2012 20:27  United States
Click Here to See the Profile for Vector A Click here to Send Vector A a Private Message Add Vector A to your buddy list Vector A is online now Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > DJing / Production / Promotion > Production Studio > Databending
Post New Thread    Post A Reply

 
Last Thread   Next Thread
Click here to listen to the sample!Pause playbackcheck out this orgasmic track!! [2005] [3]

Click here to listen to the sample!Pause playbackGigi D'Agostino - "Un Giorno Credi" [2002]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 13:16.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!