Semitone Spectrogram

Post any examples or modules that you want to share here
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Semitone Spectrogram

Post 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!
Attachments
semitoneSpectrogram2.png
semitoneSpectrogram2.png (200.4 KiB) Viewed 47405 times
Spectrogram2.fsm
(157.16 KiB) Downloaded 2092 times
Spectrogram.fsm
(115.57 KiB) Downloaded 2021 times
Last edited by martinvicanek on Wed Dec 30, 2015 7:29 pm, edited 1 time in total.
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Semitone Spectrogram

Post by Tronic »

:geek: Mastodontic 8-)
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Semitone Spectrogram

Post by RJHollins »

Impressive !!!!

Thanks Martinvicanek

8-)
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Semitone Spectrogram

Post 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
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Semitone Spectrogram

Post 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
Attachments
Pitch finder 1.0.fsm
(1.31 MiB) Downloaded 2083 times
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Semitone Spectrogram

Post 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? ;)
"There lies the dog buried" (German saying translated literally)
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Semitone Spectrogram

Post 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:
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Semitone Spectrogram

Post 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.
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Semitone Spectrogram

Post 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.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Semitone Spectrogram

Post 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)
"There lies the dog buried" (German saying translated literally)
Post Reply