Forum: music.stackexchange.com
Tags: <sound>
Title: Can you turn a recording upside-down?
Question: If I had a recording of some music, I could play it backwards. This is pretty simple.  If I had some music recorded, could I flip it around a note like in this image? If possible, how does that work?

Answers:
sents: text: Theoretically, this could be done by adapting the techniques used in a vocoder .
text: A vocoder works by measuring the amplitude of different frequency bands in a modulator signal (e.g. vocals), and then using that information to filter a carrier signal (e.g. a synthesizer sound), giving it a similar frequency spectrum as the modulator signal.
text: If you inverted the connections, you could control the low frequencies in the carrier signal with the high frequencies in the modulator signal, and vice versa.
text: In fact, patching the connections in a non-linear way was a feature of some analog vocoders, like the EMS Vocoder 5000 from 1975 and the Moog 16-Channel Vocoder from 1979.
text: Moog
text: 16-Channel Vocoder (1979) with frequency band switching patch bay (image from vintagesynth.com )
text: To achieve completely frequency-mirrored audio, you'd have to use white noise (which contains all frequencies) as the carrier signal, and you would need to have a lot more frequency bands than the dozen or so of a classic vocoder.
text: Software vocoders like Reason's BV512 can have hundreds of bands, but you'd probably need thousands to achieve anything "realistic".
text: Even then, the result would not be music with mirrored note pitches.
text: Every sound would have its component harmonics mirrored, and the result would be inharmonic and unrecognizable.
text: Harmonicity of frequency inversion vs. pitch inversion
text: While it is true that Frequency Inversion would preserve the distance between the harmonics in a note, the result would only be harmonic if the mirror frequency was itself a harmonic of the note.
text: If you mirrored A4 (440Hz) around 2200Hz, you'd get these harmonics:
text: HARM FREQ
text: Finv
text: Hinv 1 440 3960 9 2 880 3520 8 3 1320 3080 7 4 1760 2640 6 5 2200 2200 5 6 2640 1760 4 7 3080 1320
text: 3 8 3520 880 2 9 3960
text: 440 1 10 4400 0 0
text: However, if you played a C5 (523.25Hz) mirrored around 2200Hz, you'd get these harmonically unrelated frequencies: HARM FREQ
text: Finv 1 523.25 3876.75 2
text: 1046.50
text: 3353.50 3 1569.75 2830.25 4
text: 2093.00 2307.00
text: 5 2616.25 1783.75 6
text: 3139.50 1260.50 7
text: 3662.75
text: 737.25 8 4186.00 214.00 9
text: 4709.25
text: -309.25 10 5232.50
text: -832.50
text: So the result would only sound harmonic for some notes, much like the way in which the related effect of ring modulation sounds harmonic if there is a simple ratio between the two signals being modulated.
answer_details: author: music.stackexchange.com/users/40114/Your Uncle Bob
score: 12
sents: text: I think what you're asking for is flipping the frequency spectrum of an audio file.
text: You could attempt that by: Converting the audio file into a spectrogram bitmap
text: Flipping the spectrogram bitmap file
text: Resynthesizing the spectrogram bitmap into an audio file.
text: You should probably use the linear frequency scale for spectrograms.
text: The results will be very strange - you will inevitably flip not only the notes themselves, but also the harmonic series of all notes, which is not something that can occur in nature.
text: You can try this process with a free program called ARSS: http://arss.sourceforge.net/download.shtml
answer_details: author: music.stackexchange.com/users/12902/unfa
score: 7
sents: text: Yes it can be done digitally, and someone's already done it, and written a blog post about how they did it, and uploaded some examples https://griffonagedotcom.wordpress.com/2017/06/08/turning-audio-upside-down-with-octave-inversion/
text: William Tell Overture sounds absolutely incredible.
text: Posting this as an answer because I think it's better than the other examples given so far and a comment will get buried in the many other comments and lost.
answer_details: author: music.stackexchange.com/users/21139/Some_Guy
score: 7
sents: text: No, there is no single-pass audio process that can invert notes or melodies.
text: Something like Celemony Melodyn Studio could get you started by analyzing all the notes, and then maybe you could embark on a lengthy MIDI inversion process and then try to use the inverted MIDI to re-arrange the audio in Melodyn.
text: That could take a long time.
answer_details: author: music.stackexchange.com/users/6070/Todd Wilcox
score: 5
sents: text: From a mathematical perspective, it might be doable using Fourier series .(Mono)
text: sound is just a mathematical function, basically saying how the speaker should move.
text: The Fourier series tells you how much there are of each frequency.
text: One could do some type of inverting around say, A, (440hz),and map each frequency 440+F to 440-F, or, as a function, f(F) =
text: 880-F.That is, the coefficient of cos(n x) is mapped to the coefficient of cos((880-n)x).
text: If this makes sense from a musical perspective, I don't know.
text: As people mentioned, one should perhaps consider some log scaling.
answer_details: author: music.stackexchange.com/users/60661/per
score: 2
sents: text: It is indeed possible, using some old-school analog techniques.
text: But probably not practical unless you are very much an electronics type.
text: The principle sounds a lot like the vocoder described by @Your Uncle Bob, although not nearly as complicated.
text: Basically the audio is subtracted from a fixed carrier frequency and the difference is what you hear.
text: As pitch goes up, the resulting pitch goes down.
text: One possible flaw is that the chosen carrier frequency can add an offset to the pitch, and if there's an fixed offset added to the pitch,then the intervals won't be correct.
text: Then it sounds even stranger, because the harmonics (overtones) won't have the proper intervals, either.
text: Also consider that the overtones will be lower , not higher, adding to the strangeness.
text: That much strangeness probably makes you want to try it!
text: The first time I tried this was using a pair of ham radios (I won't explain that one).
text: The second one was a project from an electronics magazine, effectively four diodes (the modulator) and two or three audio transformers.
text: I think this was supposed to be a "voice scrambler".
text: I have heard things called "scramblers" that appeared to do the same thing.
text: I think in today's world, it will be a lot more practical to use some of the computer-aided techniques cited in the other answers.
text: But I had to point out that long ago, good ol' analog had its own bag of tricks.
answer_details: author: music.stackexchange.com/users/52658/gbarry
score: 2
sents: text: This smacks of negative harmony , and I highly recommend
text: you read that post.
text: It's very informative, and one of the processes involved in that discussion is essentially inverting a song about an arbitrary axis, which seems to be what you want.
text: However, though this is possible, I don't know of any software to do it for you, and generally this is a (rather rare) conceptual device used by musicians and applied to music, not just an algorithm that gets applied to existing sheet music to get a new result.
answer_details: author: music.stackexchange.com/users/37992/user45266
score: 1

Summary of the answers:
S0: Theoretically, turning a recording upside down could be done by adapting the techniques used in a  vocoder .  A vocoder works by measuring the amplitude of different frequency bands in a modulator signal (e.g. vocals), and then using that information to filter a carrier signal (e.g. a synthesizer sound), giving it a similar frequency spectrum as the modulator signal. In reality, it can be done digitally, and someone's already done it, and written a blog post about how they did it, and uploaded some examples  https://griffonagedotcom.wordpress.com/2017/06/08/turning-audio-upside-down-with-octave-inversion/. However, though this is possible, I don't know of any software to do it for you, and generally this is a (rather rare) conceptual device used by musicians and applied to music, not just an algorithm that gets applied to existing sheet music to get a new result.
It can be done by adapting the techniques used in a  vocoder and  digitally as well.