hackerpoet / fractalsoundexplorer Goto Github PK
View Code? Open in Web Editor NEWExplore fractals in an audio-visual sandbox
License: MIT License
Explore fractals in an audio-visual sandbox
License: MIT License
I'm coming straight from the YT video and haven't even tried the program yet. Ignore this should it not apply any longer, though I'd be surprised if this is the case.
When dragging the mouse over different areas to see hear how the tone progressively changes small pops occur. I propose the theory that this is happening because when the location changes, the tone is sampled and played from the first iteration on, making the distance to the previous point (and thus the amplitude change imposed on the speakers) significantly larger than the previous and subsequent point pairs.
I propose to instead search ahead a few iterations on every location change and try to find a sufficiently close point to the would-be successor from the original series of points. Since we work with cyclic series and this is only intended for minute changes of a few pixels at worst, I suspect this might work out just fine. "sufficiently close" could be something like within half the distance between the last played sample and its would-be successor of the original series.
I think it would be very cool to turn this into a VST plugin so users can use it in their DAW. Personally, I don't think the interface or controls would even need to be changed for this. I'm not sure how much time I will have to look at this (and my 0 experience with C++ does not help), but maybe others can help out with this if there is interest for it.
It would be amazing to have a MIDI out.
This could be useful in so many ways, for example to assign my own sounds and control parameters etc.
I haven't looked into the code ( I don't have even a scrap of experience with C++ unfortunately) but I imagine that it wouldn't be too difficult to generate MIDI data instead of audio at the point where the sound is synthesized.
Anyway, just putting it out there. Thanks to HackerPoet for this amazing software! And to all others who have or will contribute.
Hey, very nice little software, thanks for sharing!
I cut a very simple icon for the program for anyone to use or for @HackerPoet to add should you find it acceptable.
I can't label the issue myself, it'd just be a tiny non-essential enhancement.
Cheers!
(Yes, it's just a snap cutout, but it looks fine - and works in small well).
FractalSoundExplorer_Icon.zip
I have a Linux computer. This usually doesn't mean that I can't run .exe files because I can use Wine. However, this one says that it has to have GLSL 4.0, which is not supported on Linux. I have been looking for AGES for a good microtonal keyboard, and this steps up the game like 1000 levels!
windows.h does not exist on linux. i am unable to compile and use. could you just make this cross-platform? i know it would be a lot of work, but i really want to try your program.
here is the output of my compiler:
$ g++ Main.cpp WinAudio.cpp
In file included from Main.cpp:3:
WinAudio.h:3:10: fatal error: windows.h: No such file or directory
3 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
In file included from WinAudio.cpp:1:
WinAudio.h:3:10: fatal error: windows.h: No such file or directory
3 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
stop your windows-only party, and let linux users in!
WHEN I OPENED "MandelbrotMusic" IT SAID "Security Warning for MandelbrotMusic" THE BUTTONS WERE "OK" AND "Cancel"
This is what I get when I run main.cpp on a mac
./Main.cpp: line 11: //Constants: No such file or directory
./Main.cpp: line 12: static: command not found
./Main.cpp: line 13: static: command not found
./Main.cpp: line 14: static: command not found
./Main.cpp: line 15: static: command not found
./Main.cpp: line 16: static: command not found
./Main.cpp: line 17: static: command not found
./Main.cpp: line 18: static: command not found
./Main.cpp: line 19: static: command not found
./Main.cpp: line 20: static: command not found
./Main.cpp: line 22: //Settings: No such file or directory
./Main.cpp: line 23: static: command not found
./Main.cpp: line 24: static: command not found
./Main.cpp: line 25: static: command not found
./Main.cpp: line 26: static: command not found
./Main.cpp: line 27: static: command not found
./Main.cpp: line 28: static: command not found
./Main.cpp: line 29: static: command not found
./Main.cpp: line 30: static: command not found
./Main.cpp: line 31: static: command not found
./Main.cpp: line 32: static: command not found
./Main.cpp: line 33: static: command not found
./Main.cpp: line 34: static: command not found
./Main.cpp: line 35: static: command not found
./Main.cpp: line 36: static: command not found
./Main.cpp: line 37: static: command not found
./Main.cpp: line 38: static: command not found
./Main.cpp: line 39: static: command not found
./Main.cpp: line 41: //Fractal: No such file or directory
./Main.cpp: line 42: syntax error near unexpected token `('
./Main.cpp: line 42: `typedef void (*Fractal)(double&, double&, double, double);'
It would be great to be able to use a shortcut to export the currently played sound (or the last played). Is is possible to add it to the program ?
dfhhyyrgjh
I don't know what's wrong with my computer, but the audio keeps skipping. It's definitely not my hardware; I barely notice anything in task manager, apart from the GPU, which only gets to about 25-30% The framerate is fine, and the problem persists even if I make the window as small as possible (Which is a zero pixel height, btw.)
The comments are somewhat vague, and the video only mentions that "the left and right channels are mapped to the x,y coordinates of the orbit points [...] sampled at 8000hz, then interpolated to 48000hz", iirc.
I understand that this is a POC and I wont hold it against you that it is not throughly documented, but a detailed explanation would be welcome.
I have studied the algorithm thoroughly, but the only conclusive statement I can make is that with the global constants defined in Main.cpp, the following behavior arises :
"steps" is computed as samplerate / max_freq -> steps = 48000/4000 = 12
I posit that this represents the number of samples necessary to represent a cycle of a sinusoidal of frequency max_freq.
Then, the audio buffer is filled. A time cursor named "m_audio_time" advances at half the rate of the buffer cursor, simply because we fill the two channels at every loop.
A cursor inside this "steps" window, called j, is made equal to m_audio_time % steps, meaning that it serves as a sample cursor inside the "steps" window. A new fractal point is computed every time j is zero, AKA we have spanned "steps" samples.
Meaning that every point in the orbit generates 12 samples. (Obviously, if they make a cycle, each point will generate way more)
Apparently, distance values, dx/y and dpx/y, are calculated relative either to the first point then normalized, either to the advancing mean of all previously computed point.
A time cursor named t is computed as j/steps, meaning it represents the relative advancement throughout the window.
Its value is then updated through the function : 0.5 - 0.5 cos(t *pi)
Thus, for every calculated point, t will represent 12 samples of half a cycle of a cosine, bounded between 1 and 0.
I suppose that the magic happens right after that, when you set the value of the output sample to be :
w = t * d + (1-t) * dp
or
w = dp + t * (d - dp)
What it seems to me is that, every time a new orbit point is calculated, it generates a cosine half cycle, spanning 12 samples, and its distance to the previous point is used to manipulate these samples so that their interleaving in the buffer somehow generate different frequencies.
I may certainly have misunderstood some things and would love to be englightened.
So, I cracked this open in Visual Studio and of course it doesn't just compile. What are the extra steps to get it to run?
I did manage, but it took some sleuthing to figure out. Should that have been easier? Anyway, here's what I needed to do:
-> I guess the actionable item here is to delete the x86 targets since they won't work in this project.
And a side note, when I open this up in Visual Studio 2019, it asks to update versions of things. If I don't, it asks me every time I open it. So I did, and it still works fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.