Old 08-14-2018, 04:54 AM   #1
LuCsa
Human being with feelings
 
Join Date: Aug 2016
Posts: 31
Default Reaper's Spectrograms

Hey, fellow Reapers.

I wondered how Reaper generates the spectrograms for its spectrogram view and if it's somehow possible/allowed to use Reaper('s spectrogram functionality) to generate spectrograms of a given wav file to use it outside of Reaper?
Also, is there a way to work with the peak data?

Thanks!
Lukas
LuCsa is offline   Reply With Quote
Old 08-14-2018, 09:52 AM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,099
Default

There is https://www.reaper.fm/sdk/reapeaks.txt but it looks outdated (v5.15+ uses floating point, and it doesn't mention spectrograms & spectral peaks)...

EDIT: The API has GetMediaItemTake_Peaks which allow extracting spectral information.

Last edited by cfillion; 08-14-2018 at 11:37 AM.
cfillion is offline   Reply With Quote
Old 08-14-2018, 11:33 AM   #3
Philbo King
Human being with feelings
 
Join Date: May 2017
Posts: 796
Default

Not to hijack the thread, but it has often occurred to me that the spectral view, with a separate color per note, could be used to generate midi from audio (missing the octave).
__________________
Tangent Studio - Philbo King
www.soundclick.com/philboking - stream music
www.facebook.com/philboking - gigs and news
Philbo King is offline   Reply With Quote
Old 08-14-2018, 10:00 PM   #4
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,492
Default

Quote:
Originally Posted by Philbo King View Post
Not to hijack the thread, but it has often occurred to me that the spectral view, with a separate color per note, could be used to generate midi from audio (missing the octave).
I suppose the resolution is not fine enough.
Moreover this only would work for a sequence of pure sine waves, but not for real audio signals, containing multiple frequencies at the same time, so you can't easily "follow a melody" or even detect a chord.

To do this you would need to use e.g. Melodyne, that performs such things by really complex algorithms.

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 08-15-2018 at 06:51 AM.
mschnell is offline   Reply With Quote
Old 08-15-2018, 05:50 AM   #5
Philbo King
Human being with feelings
 
Join Date: May 2017
Posts: 796
Default

Quote:
Originally Posted by mschnell View Post
I suppose the resolution is not fine enough.
Moreover this would only would work for a sequence of pure sine waves, but not for real audio signals, containing multiple frequencies at the same time, so you can't easily "follow a melody" or even detect a chord.

To do this you would need to use e.g. Melodyne, that performs such things by really complex algorithms.

-Michael
I think you overstate your case a bit. I agree it's not great for chords, but I see definite consistent colors for any pitched mono melody, even with complex harmonics (pipe organ, distorted guitars, etc.). You do have a point that there is other software that would do the job better. But it would be a convenient feature.

Returning to the OP topic, I suppose there is better software for doing that as well. While you could drag a Wav into Reaper, turn on spectrograpgh peaks mide, and zoom it up to do a screen capture, the lack of frequency indicator lines and an amplitude color index would make it fairly useless for serious measurements. I suppose it depends on what you use it for.
__________________
Tangent Studio - Philbo King
www.soundclick.com/philboking - stream music
www.facebook.com/philboking - gigs and news
Philbo King is offline   Reply With Quote
Old 08-27-2018, 02:42 PM   #6
LuCsa
Human being with feelings
 
Join Date: Aug 2016
Posts: 31
Default

Hey guys, sorry for the very late reply!

As for the pitch detection idea: I side with Michael in that pitch detection is a very complex task for complex sounds (which almost any real sound is...) - I think we all agree on that - but yeah, maybe a simple algorithm would pick the frequency area of highest intensity (ignoring all other frequency contents), quantizing them to half-tone steps with respect to a given reference tone (e.g. 440Hz) --> extracting, so to say, the "monophonic melody of highest intensity". But even that could fail as for instance low piano notes tend to have a fundamental lower in intensity than its e.g. second partial.

But back to the topic: I asked because the spectrogram looks very convenient and simple, good enough in resolution. I have a recording where there are some clicks (one to two samples make a jag in the waveform). In order to find and correct them, I look for vertical sharp lines (meaning constant intensity over all frequencies at a given time) in the spectrum (the laws of Fourier analysis demand that a pulse in the time domain gives a constant frequency response). It would be so nice if Reaper could toggle into a "destructive wav editing" mode in order to make such corrections.

Cheers,
Lukas

@Reaper api... to be very frank...I don't understand the documentation of that function.
LuCsa is offline   Reply With Quote
Old 08-27-2018, 09:51 PM   #7
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,492
Default

It would be rather easy to do a JSFX using FFT to implement the pitch detect algorithm you describe, outputting Midi notes. But I suppose nobody will bother to do so, as close to never there will be a usable signal for such conversion.

OTOH, the "peak" files that Reaper creates for generating the spectrum display, will use a by far lower resolution than semitones. Otherwise they would be huge.

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 08-31-2018 at 01:20 PM.
mschnell is offline   Reply With Quote
Old 08-29-2018, 06:39 AM   #8
LuCsa
Human being with feelings
 
Join Date: Aug 2016
Posts: 31
Default

For my purpose it is actually not about frequency resolution at all. I just would like to use the picture information calculated by Reaper to find the clicks in my waveform. And I just wondered whether it is possible to access this data in its peak files (and if yes: how?) or if there is any function in the Reaper API (or code which it uses to calculate the spectrograms).

cheers,
Lukas
LuCsa is offline   Reply With Quote
Old 08-29-2018, 07:06 AM   #9
Philbo King
Human being with feelings
 
Join Date: May 2017
Posts: 796
Default

I'don't imagine it's possible but suspect you would get a lot of false positives from sounds like rim shots (drums in general), pick clicks, stuff like that. I don't have any info on the format of the spectrogram peak file format; however.
__________________
Tangent Studio - Philbo King
www.soundclick.com/philboking - stream music
www.facebook.com/philboking - gigs and news
Philbo King is offline   Reply With Quote
Old 08-30-2018, 08:38 AM   #10
LuCsa
Human being with feelings
 
Join Date: Aug 2016
Posts: 31
Default

Oh, no, I find them manually and it works perfectly fine. The lines in the frequency response are perfectly homogeneous and can be distinguished from "natural click" sounds and I manage to find the corresponding "dips" in the waveform. If Reaper had a destructive wav-editing mode I could directly repair the waveform inside it.

Well...then I need to find some library to compute spectrograms... Or Cockos introduces a wav-editing mode.

Cheers and thanks,
Lukas
LuCsa is offline   Reply With Quote
Old 08-31-2018, 07:09 AM   #11
dave_t
Human being with feelings
 
dave_t's Avatar
 
Join Date: Jan 2016
Posts: 55
Default

Taking the hijack further,

Quote:
Originally Posted by mschnell View Post
I suppose the resolution is not fine enough.
Moreover this only would work for a sequence of pure sine waves, but not for real audio signals, containing multiple frequencies at the same time, so you can't easily "follow a melody" or even detect a chord.

To do this you would need to use e.g. Melodyne, that performs such things by really complex algorithms.

-Michael
There are a few plugins less "mainstream" than Melodyne that do audio to polyphonic MIDI - I assume they use spectral analysis. The results aren't pristine, but I think you could probably pick out melodies and hard-to-hear chords
e.g. https://www.kvraudio.com/product/mp3...y-nguyen-chung
dave_t is offline   Reply With Quote
Old 08-31-2018, 07:20 AM   #12
bezusheist
Human being with feelings
 
bezusheist's Avatar
 
Join Date: Nov 2010
Location: Dummytown
Posts: 610
Default

SoX can be used to generate spectrograms.
__________________
ass reaper
bezusheist is offline   Reply With Quote
Old 09-04-2018, 06:58 PM   #13
LowlyOP
Human being with feelings
 
LowlyOP's Avatar
 
Join Date: Feb 2018
Posts: 45
Default

This discussion is admittedly way above my head, so please keep that in mind (I have a degree in cooking, no real studies in music production, engineering, etc, and I'm a late-comer to musical production in any form).

I normally would just read and soak up the infos here but I thought maybe - if I understand at all what your trying to accomplish (there's a good chance I don't!) - I have a solution to offer that I'd credit to Kenny Gioa from Reaper Mania; I think the video was "External Editor in Reaper" (~) where he uses the classic program " Audacity to edit some wav forms of an analog instrument recording which contained some big spikes/ "clipping."

I've not delved into this yet nor had need to, but, it was surprisingly simple in his example to locate and hone in on those spikes and destructively remove them without any perceivable negative impact on sound quality (by me, anyway). The spikes were far less recognizable inside of reaper. This is a simple approach and doesn't get into the spectogram analysis algorithms and such, but sometimes simple is the better route?

Hope that if nothing else this relates to what you are trying to achieve - good luck!
LowlyOP is offline   Reply With Quote
Old 09-12-2018, 09:06 AM   #14
zlp
Human being with feelings
 
Join Date: Mar 2014
Posts: 2
Default

I'd recommend https://sonicvisualiser.org/ for nice-looking spectrographs + optional metadata. It's free, open source, and easy to use.

If you want to get really fancy, it also supports VAMP analysis plugins: https://www.vamp-plugins.org/
Nothing like Melodyne, but I've used it to identify certain features in sounds and dump the results into files that I parsed with other home-made software.
zlp is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.