News for hackers. Stuff that matters.
Re:Show HN: Wave function collapse algorithm by twfarland on Friday September 30, 2016 @10:16AM (#12612553)
Mindblowing... could this technique also be applied to music?
Re:Show HN: Wave function collapse algorithm by kowdermeister on Friday September 30, 2016 @10:41AM (#12612719)
It should be, at least on audio level it would work. It would make a nice VST :)
Re:Show HN: Wave function collapse algorithm by mistagiggles on Friday September 30, 2016 @11:31AM (#12613045)
Something similar does exist: http://labs.echonest.com/Uploader/index.html

It detects places in songs where the sound is similar, and can jump between these places in the track to make a seamless unending song.

Re:Show HN: Wave function collapse algorithm by ExUtumno on Friday September 30, 2016 @12:29PM (#12613469)
I doubt it, because music is 1-dimensional and for 1-dimensional arrays WFC is just a Markov chain.
Re:Show HN: Wave function collapse algorithm by barrkel on Friday September 30, 2016 @12:39PM (#12613542)
There are three-dimensional views of music, e.g. time-frequency-amplitude. See https://en.wikipedia.org/wiki/Spectrogram
Re:Show HN: Wave function collapse algorithm by elihu on Friday September 30, 2016 @02:31PM (#12614300)
Another multi-dimensional abstraction for music that's at a bit higher level is a musical lattice. The number of dimensions is limited by the largest prime you accept in the ratios you use. (Typical western music approximated by 12-tone equal temperament uses primes of 2, 3, and 5. Powers of 2 are often ignored because notes an octave apart are perceived to be sort of equivalent for harmonic purposes.)

https://en.wikipedia.org/wiki/Lattice_(music)

Re:Show HN: Wave function collapse algorithm by ssalazar on Friday September 30, 2016 @02:18PM (#12614194)
Spectrogram is 2D (plot of amplitude given time and frequency).

Its interesting to think about it for a spectrogram because "similarity" is different in each dimension (freq vs. time). Frequency is also perceived logarithmically, so you would probably want to convert to e.g. Mel scale before applying this algorithm (a 2000-2100Hz change is much subtler than a 200-300Hz change).

Re:Show HN: Wave function collapse algorithm by jmilloy on Friday September 30, 2016 @02:27PM (#12614267)
Isn't that 3 dimensions (amplitude, time, and frequency)? The plot of course fills 2 spatial dimensions and uses color to represent the 3rd dimension. But I don't know very much about this.
Re:Show HN: Wave function collapse algorithm by ssalazar on Friday September 30, 2016 @02:44PM (#12614395)
I don't have a mathematically rigorous understanding of it but the number of dimensions is basically the number of freely varying inputs to the corresponding functional representation. In a 2d image, x position and y position are mapped to a color, e.g. I(x,y) = C. In a spectrogram, freq and time are mapped to a color (amplitude) e.g. S(f,t) = A. In neither case can you just pick an arbitrary color or amplitude and in general produce a singular x/y or f/t from that.
Re:Show HN: Wave function collapse algorithm by JonnieCache on Friday September 30, 2016 @12:46PM (#12613583)
How is music 1-dimensional?
Re:Show HN: Wave function collapse algorithm by elevensies on Friday September 30, 2016 @12:56PM (#12613633)
A microphone records amplitude of sound waves over time, i.e. the air pressure -- that's the dimension.
Re:Show HN: Wave function collapse algorithm by barrkel on Friday September 30, 2016 @01:04PM (#12613682)
You can also view digital images as 1-dimensional arrays of bits. (This is roughly how fax machines work.) That doesn't mean they can't also be 2-dimensional images, or representations of 3-dimensional images, or indeed an encoding of a 3D scene directly.

Similarly, you can unpack a linear sequence of sound samples into a two-dimensional plot of frequency and amplitude with a fourier transform.

Re:Show HN: Wave function collapse algorithm by JonnieCache on Friday September 30, 2016 @01:06PM (#12613692)
Or you can represent the music as instructions to performers or synthesizers (ie notation) and you've got as many dimensions as you want.

Music is not sound, it's made of sounds. The fact that it gets mixed down to a single waveform when you consume it, either in the studio or when it hits your ear, isnt particularly relevant to how its made. I suppose the same is true of images though.

Markov chains applied to midi have been able to make "locally similar" stuff since forever. I wonder how this algorithm could be applied to higher-order aspects of music notation.

Re:Show HN: Wave function collapse algorithm by ssalazar on Friday September 30, 2016 @02:07PM (#12614132)
> Or you can represent the music as instructions to performers or synthesizers (ie notation) and you've got as many dimensions as you want.

These are just multiple signals in a single dimension (time).

Re:Show HN: Wave function collapse algorithm by tamana on Friday September 30, 2016 @02:25PM (#12614253)
1 physical dimension. Mathematically, each signal is a dimension.
Re:Show HN: Wave function collapse algorithm by derefr on Friday September 30, 2016 @02:51PM (#12614443)
We still call images "two-dimensional" when they're colored. There is a difference between continuous dimensions like space and time, and discrete dimensions like color channels in an image, or like instrument "tracks" of a song. The latter can have correlations, but they'll be sparse associations, rather than structural formulaic ones.
Re:Show HN: Wave function collapse algorithm by ssalazar on Friday September 30, 2016 @02:05PM (#12614116)
> Similarly, you can unpack a linear sequence of sound samples into a two-dimensional plot of frequency and amplitude with a fourier transform.

Fourier transform by itself is still 1D (amplitude vs. frequency); to get to 2 dimensions you can plot it over time i.e. a spectrogram.

Re:Show HN: Wave function collapse algorithm by BHSPitMonkey on Friday September 30, 2016 @04:28PM (#12615087)
You're describing audio, not music. Music as data isn't quantified in the same way as audio (see the various forms of musical notation that exist), and in fact music displayed in a sequencer or tracker looks pretty similar to the 2D bitmaps in the article.
Re:Show HN: Wave function collapse algorithm by toxik on Friday September 30, 2016 @02:56PM (#12614484)
Perhaps possible to slice the music wave data into frames, perform FFT to get a spectrogram and use that as tiles?