Page 1 of 2

Semitone Spectrogram

PostPosted: Sun Dec 20, 2015 6:51 am
by martinvicanek
Hi gang,

this is a demo of a semitone spectrogram. It covers 4 octaves, I was happy to see that Ruby can draw 64x48 rectangles fast enough for a sense of motion. However, I am sure it can be done more efficiently.

The DSP part includes a filter bank of 48 4th order bandpass filters followed by envelope followers. There is still some headroom regarding expansions to more octaves as well as further optimizations.

Have fun!

Re: Semitone Spectrogram

PostPosted: Sun Dec 20, 2015 6:56 am
by Tronic
:geek: Mastodontic 8-)

Re: Semitone Spectrogram

PostPosted: Sun Dec 20, 2015 9:26 am
by RJHollins
Impressive !!!!

Thanks Martinvicanek

8-)

Re: Semitone Spectrogram

PostPosted: Sun Dec 20, 2015 10:12 am
by Spogg
Absolutely fantastic Martin.

Plus, this is just what I needed right now to analyse some samples for pitch for my ongoing Q-50 project :o

How did you know? I was expecting socks :lol:

Merry Christmas

Spogg

Re: Semitone Spectrogram

PostPosted: Sun Dec 20, 2015 1:32 pm
by Spogg
I rigged this up to find the base pitch of samples and to test with a simple tone.
I've tried quite a few samples and it's SO good (your module!).

This is such a great gift for me so thank you again :D :D :D

Cheers

Spogg

Re: Semitone Spectrogram

PostPosted: Mon Dec 28, 2015 9:21 pm
by tulamide
Finally had the time to test your Spectogram (I am so used to the word Sonograph, but it seems that word is nowadays used for those body scanners only?). Martin, that is fantastic. As always I have no clue how you realized that, but it is so impressive. I fed it with a stem file from one of my songs. It was a pad played with two notes, not changing. Your module identified the two notes without any problem. I might be wrong, but it seems that it also shows the strengths of the two notes (I played the higher note quieter than the lower one and the spectogram shows more color for the lower note), but maybe that's just a coincidence.

And congratulations to your Ruby code. If I'm right it's the first time that you post something with a self-made Ruby code and it is beautiful. Well structured, easy to read, makes use of the class methods, etc., very good job.

If you want to reduce the number of inputs (Ruby doesn't care, but maybe you like it clean), you could use a RubyEdit per 12-output module and route the 12 arrays to one Ruby object. They could then again being combined to one Ruby object, so that you only have one input to the main RubyEdit.

Very good job. I'm just a bit afraid. You are already a master in dsp/asm. If you now also become a master in Ruby, what will be left for me to help? ;)

Re: Semitone Spectrogram

PostPosted: Mon Dec 28, 2015 10:27 pm
by martinvicanek
tulamide wrote:And congratulations to your Ruby code. If I'm right it's the first time that you post something with a self-made Ruby code and it is beautiful. Well structured, easy to read, makes use of the class methods, etc., very good job.
Thanks, tulamide. I try to keep my code tidy so I can understand it the next time I look at it. :mrgreen:
tulamide wrote:If you want to reduce the number of inputs (Ruby doesn't care, but maybe you like it clean), you could use a RubyEdit per 12-output module and route the 12 arrays to one Ruby object. They could then again being combined to one Ruby object, so that you only have one input to the main RubyEdit.
Yes, I have done that already. I'll post an update soon, with extended range and better performance. And some neat preferences, too.
tulamide wrote:If you now also become a master in Ruby, what will be left for me to help? ;)
Don't worry, I might ascend to the Rubyist Club some day if I work hard, but I'll always leave the tricky stuff to you. :twisted:

Re: Semitone Spectrogram

PostPosted: Wed Dec 30, 2015 7:20 pm
by martinvicanek
Updated the first post. Version 2 features 5 octaves and some other enhancements. Uses heterodyning instead of bandpass filters. Comments and suggestions, please.

Re: Semitone Spectrogram

PostPosted: Thu Dec 31, 2015 10:48 am
by Tronic
heterodyning?
you raise my curiosity....
I have read some info in internet....
but some explanation from you is welcome, to better understand how you use it in this case.

Re: Semitone Spectrogram

PostPosted: Thu Dec 31, 2015 10:55 am
by tulamide
Have read a bit on the internet, too. It seems to me that you would need to do inverse heterodyning to achieve a spectrogram, won't you?
If so, I again bow deep and praise your creativity! (And still have no clue how you do it)