Logo by KRAFTWERK - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. December 07, 2019, 08:44:12 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: kf-extras for manipulating output from Kalles Fraktaler 2  (Read 1798 times)
0 Members and 1 Guest are viewing this topic.
claude
Fractal Bachius
*
Posts: 563



WWW
« on: December 14, 2014, 10:02:57 PM »

I created a repository for my little programs that do things to the output of kf (just some colouring tools so far):

https://gitorious.org/maximus/kf-extras
http://code.mathr.co.uk/kf-extras

They're written in C (C99 standard), tested on Linux with GCC, using OpenMP for parallelism where appropriate.

Code is currently a bit ugly (lots of copy/paste between files) - I hope to clean it up soon, which should make writing new tools much easier.
« Last Edit: March 10, 2015, 03:09:25 AM by claude, Reason: gitorious.org is closing » Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #1 on: December 17, 2014, 03:11:31 PM »

Today I finished the exponential map (aka log polar or mercator projection) convertor:



parameters: http://mathr.co.uk/mandelbrot/2014-12-17_kf-extras_expmap_wire.kfr

rendered from 98 640x360 kfb files, giving a 565x6075 image, downscaled 4x in GIMP for anti-aliasing.
Logged
youhn
Fractal Molossus
**
Posts: 696


Shapes only exists in our heads.


« Reply #2 on: December 17, 2014, 05:59:55 PM »

How would this sound if you see the horizontal axis as time, and the vertical axis as frequency ... ? Maybe do a logscale on the horizontal axis first. Any jpeg-to-wave converters around?  huh?
Logged
Chillheimer
Global Moderator
Fractal Schemer
******
Posts: 972


Just another fractal being floating by..


chilli.chillheimer chillheimer
WWW
« Reply #3 on: December 17, 2014, 07:11:40 PM »

hey claude, this looks really fascinating!
and the fact that you can do this with an addition to kalles fraktaler is the best.. smiley
now I'm wondering, how can someone like me, who has no programming skills, using windows 8, use this? is it possible?

you do know kf is open source?
it would be great if these kinds of things would find their way directly into the program.
Logged

--- Fractals - add some Chaos to your life and put the world in order. ---
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #4 on: December 17, 2014, 08:54:24 PM »

hey claude, this looks really fascinating!
and the fact that you can do this with an addition to kalles fraktaler is the best.. smiley
now I'm wondering, how can someone like me, who has no programming skills, using windows 8, use this? is it possible?

probably not without learning more - even if you had exe versions (which I can't provide as I don't use windows), you'd need to use interactive cmd command line (or bat files) to make them do anything useful - so I guess they're power-user only for now

Quote
you do know kf is open source?
it would be great if these kinds of things would find their way directly into the program.

yep, I looked at kf's source to know the file format of .kfb files

and my programs are open source too, so Karl is free to look (and copy - all I ask is attribution and reciprocal source openness, no specific license yet but think LGPL in intent) the code into his stuff - I can't do it myself because (again) I don't use windows

another possibility is for someone to write a separate gui program (like the movie maker) that allows batch processing, but it would be nice to have at least some of the features in kf (especially i miss the pseudode colouring when exploring)
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #5 on: December 17, 2014, 09:03:27 PM »

How would this sound if you see the horizontal axis as time, and the vertical axis as frequency ... ? Maybe do a logscale on the horizontal axis first. Any jpeg-to-wave converters around?  huh?

I tried some experiments with libfftw3, but didn't like how it sounded: http://mathr.co.uk/mandelbrot/2014-12-17_kf-extras_expmap_wire.wav
will continue experimenting...
Logged
youhn
Fractal Molossus
**
Posts: 696


Shapes only exists in our heads.


« Reply #6 on: December 17, 2014, 10:04:51 PM »

Ha, that was fast! Thanks man!   grin

Indeed does not sound very good, this should be filtered further to perhaps make something nice of it.
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #7 on: December 17, 2014, 10:49:31 PM »

Here's a new video with sound:

http://mathr.co.uk/mandelbrot/2014-12-17_three_five.ogv
http://mathr.co.uk/mandelbrot/2014-12-17_three_five.kfr

When zooming I tried to go through a few places with different rotational symmetry to make the sound more interesting.

Here's a tutorial of how I made it, bash shell commands with comments in between:

Code:
mkdir ~/work
cd ~/work
wine32 ~/windows/fraktal_sft.exe
# render zoom out sequence with kalles fraktaler, saving to ~/work
for i in *.kfb ; do ~/code/maximus_kf-extras/pseudo-de < ${i} | pgmtoppm white > ${i%kfb}ppm done
# count number of kfb files, (ls *.kfb | tail -n 1) gives a hint, I had 311
ls *.kfb | ~/code/maximus_kf-extras/expmap 311 > expmap.pgm
ghc -e "100 / sqrt ( 565 * 19820 / (120 * 8000) )"
# or your favourite calculator program if you don't have ghc
# prints 29.27922435677391
# where 565 * 19820 is the size of the expmap
# 8000 is desired sample rate
# 120 is desired movie length in seconds
gimp expmap.pgm
# downscale by 29.27922435677391% (output from ghci)
# flip vertically
# make sure it's greyscale with no alpha
# save as expmap-downscaled.png
# gimp saves comments in its netpbm writers, my bad code doesn't handle it
pngtopnm < expmap-downscaled.png > expmap-downscaled.pgm
audacity
# import raw expmap-downscaled.pgm as raw unsigned 8bit PCM mono 8000Hz
# set project sample rate to 48000Hz
# select the track, mix and render
# select the track, apply filter DC Offset Removal (maybe needs a plugin)
# select the track, select amplify and apply to normalize the volume
# duplicate the track twice
# for each of the duplicates in turn, select it and apply a reverb (GVerb plugin)
# use slightly different reverb settings for each track (for stereo effect)
# normalize the duplicates by select track, select amplify, apply
# make one duplicate a left channel and the other a right channel
# set the levels of each track to -3dB
# select all tracks, mix and render
# normalize volume if needed
# select track, export as stereo wav 16bit PCM to expmap.wav
# note down the length (my test gave 1m56s)
ghc -e "1 * 60 + 56"
# to get the audio length in seconds (116)
# check the size of the kfb files (here I used 640 by 360)
# remember we have 311 kfb files
ls 00*.ppm | tac | xargs cat | ~/code/maximus_book/code/zoom 640 360 311 116 |
  avconv -f yuv4mpegpipe -i - -i expmap.wav -acodec vorbis -ab 192k -vb 2M out.ogv
# finally!
mplayer out.ogv

The zoom assembler is at
https://gitorious.org/maximus/book
http://code.mathr.co.uk/book

it doesn't need anything else in the repository so you could just get that file:
https://gitorious.org/maximus/book/raw/HEAD:code/zoom.c
http://code.mathr.co.uk/book/blob/HEAD:/code/zoom.c (click "raw" to download)

compile it like this:
Code:
gcc -std=c99 -Wall -Wextra -pedantic -O3 -fopenmp -ggdb -o zoom zoom.c -lGLU -lGL -lGLEW -lglut -lm
« Last Edit: March 10, 2015, 03:00:28 AM by claude, Reason: gitorious.org is closing » Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #8 on: December 18, 2014, 11:54:33 AM »

Here's a tutorial of how I made it

Now obsoleted by a fully automatic movie maker bash script (kfbtoogv.sh in the repository) - just specifiy the length in seconds and a couple of directories!  A few things are hardcoded (program directories, antialiasing factor, ... - need to make them runtime options), and using ghc for simple maths is a bit overkill, so it's not perfect yet.

Overnight I rendered a zoom out sequence of the same location at 3840x2160 into ~/work , then I mkdir ~/work/tmp, then I kfbtoogv.sh 120 ~/work ~/work/tmp and 18mins later got this video without having to do anything manually:

http://mathr.co.uk/mandelbrot/2014-12-18_three_five_720p.ogv
Logged
TheRedshiftRider
Fractalist Chemist
Global Moderator
Fractal Iambus
******
Posts: 854



WWW
« Reply #9 on: December 18, 2014, 01:35:10 PM »

I dont want to sound like a noob but how do I open the files of the expmap? I read what you said but what could I use to open them?
« Last Edit: December 18, 2014, 01:44:58 PM by Toofgib » Logged

Motivation is like a salt, once it has been dissolved it can react with things it comes into contact with to form something interesting. nerd
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #10 on: December 18, 2014, 02:06:22 PM »

I dont want to sound like a noob but how do I open the files of the expmap? I read what you said but what could I use to open them?

You can browse the source code here:
https://gitorious.org/maximus/kf-extras
http://code.mathr.co.uk/kf-extras/tree

You can download all the code with git, for example:
git clone https://gitorious.org/maximus/kf-extras.git
git clone http://code.mathr.co.uk/kf-extras.git

or there's a Download button on the gitorious browse page which gives you a tarball (probably 7zip can extract on Windows, on Linux run  tar xzvf foo.tar.gz where foo.tar.gz is to be replaced by the name of the downloaded file).

Once you have the source code, you need to compile it.  On Linux, just cd into the directory and type 'make'.  On Debian systems you probably need the package 'build-essential', so install that first.  Other Linux distributions probably have similar packages. I don't know how to compile it on Windows, but MINGW might be a start (it provides a minimal unix-like toolset including gcc the GNU C compiler).  You might be able to compile it with Microsoft VisualStudio, but I don't know at all anything about that.

Check the README for instructions on how to run it.  You need to give it a list of kfb files and redirect the output to a file, something like "ls *.kfb | expmap > out.pgm" (dir might work on Windows, but check that it outputs one file per line with no other junk)  I just realized there might be a problem with text format (line endings are different between Window (CRLF) and Linux (LF)) - I'll try to debug this soon...

Once you run it, the output is PGM, one of the NetPBM family of simple uncompressed image file formats - GIMP loads it fine, or there is pnmtopng which can convert to PNG on the command line.
« Last Edit: March 10, 2015, 02:57:19 AM by claude, Reason: gitorious.org is closing » Logged
Chillheimer
Global Moderator
Fractal Schemer
******
Posts: 972


Just another fractal being floating by..


chilli.chillheimer chillheimer
WWW
« Reply #11 on: December 18, 2014, 02:21:36 PM »


although at times it sounds horrible, i somehow like the way how the picture translates into sound. it sounds accurate and partly harmonic...
As computer-musician I wonder if one could use fractals as oscillators....
(a little research shows: already happens, I have to check that out.. http://www.musicradar.com/reviews/tech/tone2-electrax-387994/  )
Logged

--- Fractals - add some Chaos to your life and put the world in order. ---
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #12 on: December 18, 2014, 07:46:05 PM »

take a look at this nifty program, it actually does what you guys are thinking about:

http://photosounder.com/

i tried running a mandelbulb render through it once, it turned out pretty trippy i thought  afro
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #13 on: December 21, 2014, 12:41:14 PM »

I adapted the code for these to run in wine32 on Linux (it seems wine32 really doesn't like to pipe data in or out).  So now they take command line arguments instead.

EXEs are all in here, run them without arguments to see how to use them:
http://mathr.co.uk/mandelbrot/kf-extras_v3-windows.zip

Source code for this release is at the v3-windows tag in the windows branch, direct link to browse:
https://gitorious.org/maximus/kf-extras/source/c6d7a4450c7db17b70a3b8f80647285979d3797f:
http://code.mathr.co.uk/kf-extras/tree/refs/heads/windows

To compile on Linux, install mingw64 development tools (there are Debian packages) and run make -f Makefile.w32



I probably won't develop these any further, as I got mightymandel working to a sufficiently good state (finally added glitch correction!).  Benchmarks are about equally fast as KF in wine32, which is nice.

See this thread for that project's updates: http://www.fractalforums.com/index.php?topic=20428.0
« Last Edit: March 10, 2015, 02:54:07 AM by claude, Reason: gitorious.org is closing » Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Kalles Fraktaler 2.7 Kalles Fraktaler « 1 2 3 » Kalles Fraktaler 35 4023 Last post October 13, 2014, 04:45:04 PM
by youhn
Kalles Fraktaler 2.7.4 available Kalles Fraktaler Kalles Fraktaler 10 1072 Last post November 30, 2014, 01:40:48 PM
by ratcat65
Kalles Fraktaler 2.7.7 available Kalles Fraktaler Kalles Fraktaler 7 1319 Last post January 23, 2015, 12:39:28 PM
by Chillheimer
Kalles Fraktaler 2.7.8 available Kalles Fraktaler Kalles Fraktaler 0 1103 Last post December 30, 2014, 04:04:49 PM
by Kalles Fraktaler
Kalles Fraktaler 2.7.9 available Kalles Fraktaler Kalles Fraktaler 2 1097 Last post March 09, 2015, 08:17:09 PM
by PieMan597

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.158 seconds with 29 queries. (Pretty URLs adds 0.011s, 2q)