diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8d27445 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sonification"] + path = sonification + url = https://github.com/SonifyIt/sonification diff --git a/README.md b/README.md index 7a69b40..a907fc0 100755 --- a/README.md +++ b/README.md @@ -6,8 +6,9 @@ Processing scripts used to generative glitch / art / design generateme.blog@gmail.com -Detailed instructions inside scripts, examples included +clone recursively ```git clone --recursive https://github.com/tsulej/GenerateMe.git``` +Detailed instructions inside scripts, examples included All below works on latest Processing 2 only! For Processing 3 versions see bottom. List: @@ -40,6 +41,8 @@ List: * fm - frequency modulation and demodulation * composite_video_simulator - very precise VHS/Composite Video/Tape simulation, based on: https://github.com/joncampbell123/composite-video-simulator * Obj2Raw - convert OBJ vertex data to RAW 8 bit signed (for sonification purposes) + * granularresynth - Granular (re)synthesis of any RAW using other RAWs for visual/audio + * -> sonification - image sonification * TEMPLATE - clean template sketch with some predefined functions ## Processing 3 diff --git a/granularresynth/audiores.mp3 b/granularresynth/audiores.mp3 new file mode 100755 index 0000000..303b730 Binary files /dev/null and b/granularresynth/audiores.mp3 differ diff --git a/granularresynth/granularresynth.pde b/granularresynth/granularresynth.pde new file mode 100755 index 0000000..b423274 --- /dev/null +++ b/granularresynth/granularresynth.pde @@ -0,0 +1,81 @@ +// Granular resynthesis +// Recreate target file using samples from source files +// generateme @ 2017 + +// Prepare source files as RAW (audio/images etc. any type) and set filenames +String[] sources = { + "test_img.raw", "test_wav.raw" +}; +// Prepare target file and set filename below +String target_fn = "test_wav.raw"; +// Save to filename +String save_to = "result.raw"; +// Number of grains (10-10000), give low number for SELF to get more glitch +final static int gnum = 10; +// Size of grain in bytes (100-10000) +final static int gsize = 3000; +// How far search for grains (only for SELF) in number of grain sizes +final static int gspread = 25; +// How to gather grains: +// - SELF - use target as a source and take grains from neighborhood +// - ALL - use all files as sources +int type = SELF; + +// do not touch below + +// list of types +final static int SELF = 0; +final static int ALL = 1; + +void setup() { + byte[] target = loadBytes(target_fn); + ArrayList source = new ArrayList(); + + if (type == ALL) { + for (String s : sources) { + source.add( loadBytes(s) ); + } + } + + byte[] result = new byte[target.length]; + + for (int i=0; i