Use imagemagick to find recurring patterns in waveform ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Use imagemagick to find recurring patterns in waveform ?

Post by Rye »

So... as there are no sufficient tools at hand (that I can find at the current point in time) that allow me to analyze music waveforms for repeating patterns:

Would it be possible to use Imagemagick to:
1.) Feed it a Picture of a waveform
2.) Get it to "mark" repeating patterns in such image ?

For example take this waveform:

Image

Code: Select all

https://image.ibb.co/ftRkEG/2018_01_22_223715_2.jpg
Thanks in advance for any hints.

- Rye
Last edited by Rye on 2018-01-22T13:56:42-07:00, edited 1 time in total.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Use imagemagick to find recurring patterns in waveform ?

Post by fmw42 »

I do not know how Imagemagick would help. It is an image processor, not a wave analysis tool.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Use imagemagick to find recurring patterns in waveform ?

Post by Bonzo »

I would guess you could do a sub image? search but how do you decide what to search for?
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Use imagemagick to find recurring patterns in waveform ?

Post by Rye »

fmw42 wrote: 2018-01-22T13:44:14-07:00 I do not know how Imagemagick would help. It is an image processor, not a wave analysis tool.
Indeed, but you can see, I'm talking about analysing "a picture of the waveform" to find rough pattern similarities
- not the music file itself.

While I know this is probably not the best take on this thematic, I figured that imagemagick might be able to recognize patterns in images in such manner.

What to search for ?
Exactly. That is the problem.

The only thing that is clear (from the picture I provided for example) is:

The only eligible pixels for this search are to be "blue"

Aside from this, maybe it is possible to define a range ?
For example "look for pattern within a 40x191 to 600x191" range or something that match up exactly ?

While I have a rough idea what should be achieved here, I don't know the exact way of handling is.

If the problem is unclear, I can provide a "mock up" of sorts to clear up what result would fit in range.


EDIT: I added a waveform sample image atop that has the ususal program shenanigans removed, leaving only the wave form, maybe it's simpler that way ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Use imagemagick to find recurring patterns in waveform ?

Post by snibgo »

Rye wrote:1.) Feed it a Picture of a waveform
I wouldn't start from there. Start from the waveform itself, not a graph of the waveform. So the image is Nx1 pixels, not NxM. The problem is then much smaller.

Then you can crop out whatever small section you want, and search for that in the rest of the image.
snibgo's IM pages: im.snibgo.com
Rye
Posts: 158
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Use imagemagick to find recurring patterns in waveform ?

Post by Rye »

That sounds like a reasonable suggestion.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Post Reply