English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 06 June 2022, 18:02   #1
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
How works Sound Spectrum Analyzer ?

Hi,

Can someone give me the principle of the Spectrum Analyzer we could see in Protracker or some demos ?
I'm zero at sound so a simple explanation would be nice

LeCaravage is offline  
Old 06 June 2022, 18:53   #2
no9
Registered User
 
no9's Avatar
 
Join Date: Feb 2018
Location: Poland
Posts: 352
Bars are triggered by the notes replayed in pattern or by keyboard. Their heights are based on notes volumes which are added to the current bar heigh's value. It is not a real spectrum analyzer. Quadra Composer has more interesting one.
no9 is offline  
Old 06 June 2022, 19:02   #3
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Thanks for infos, no9
LeCaravage is offline  
Old 07 June 2022, 17:50   #4
Total Eclipse
Registered User
 
Total Eclipse's Avatar
 
Join Date: May 2005
Location: Atherstone / UK
Age: 49
Posts: 161
Quote:
Originally Posted by no9 View Post
Bars are triggered by the notes replayed in pattern or by keyboard. Their heights are based on notes volumes which are added to the current bar heigh's value. It is not a real spectrum analyzer. Quadra Composer has more interesting one.
I presume the OP is talking about the spectrum analyser on the top right, rather than the bars above each channel? Doesn't that display actually respond to the frequencies being played? I'd guess that it doesn't actually analyse the sample data being played, rather it takes its cue from the pitch that's triggered as part of the pattern, though I could be very wrong here.
Total Eclipse is offline  
Old 07 June 2022, 18:31   #5
no9
Registered User
 
no9's Avatar
 
Join Date: Feb 2018
Location: Poland
Posts: 352
Yes, the bars represent notes from C1 on the far left to B3 on the far right of the Spectrum Analyzer. Which also implies their frequencies (sample rates) at the same time.

no9 is offline  
Old 07 June 2022, 19:23   #6
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 361
Quote:
Originally Posted by no9 View Post
Yes, the bars represent notes from C1 on the far left to B3 on the far right of the Spectrum Analyzer. Which also implies their frequencies (sample rates) at the same time.
To clarify, each note from C1 to B3 has a specific playback frequency in Hertz.
The actual audible frequencies are created based on this playback frequency and the form of the wave being played. From this point of view the Spectrum Analyzer in the picture does not actually display the frequency spectrum
koobo is offline  
Old 09 June 2022, 11:47   #7
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Ahhhh!!! I always wondered how Protractor faked the spectrum analyser. Very clever...

I have tried to write a Fixed Point FFT algorithm, but could never get it fast enough to run on a 68000 (especially after the windowing passes), and now even cheap microcontrollers have FPUs and run at hundreds of MHz, there isn't much point
bloodline is offline  
Old 09 June 2022, 14:34   #8
no9
Registered User
 
no9's Avatar
 
Join Date: Feb 2018
Location: Poland
Posts: 352
Look there at the Quadra Composer's Spectrum Analyser.
[ Show youtube player ]

Last edited by no9; 09 June 2022 at 17:48.
no9 is offline  
Old 09 June 2022, 15:32   #9
Estrayk
Registered User
 
Estrayk's Avatar
 
Join Date: Apr 2015
Location: Spain
Posts: 511
I have never seen much sense about the spectrum analyser in protracker, because in order to visually understand what you see in the spectrum all the notes should be sampled at the same frequency, which is not very common in amiga mods.

It looks nice but it is not very effective.

Just an opinion
Estrayk is offline  
Old 09 June 2022, 19:37   #10
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 361
Quote:
Originally Posted by bloodline View Post

I have tried to write a Fixed Point FFT algorithm, but could never get it fast enough to run on a 68000 (especially after the windowing passes), and now even cheap microcontrollers have FPUs and run at hundreds of MHz, there isn't much point
Making an impossible thing work on 68000 is exactly the point!

In HippoPlayer (v2.52) there is a spectrum analyzer scope that runs about 5-10 frames per second on A500. Admittedly it is not super smooth but it's quite ok I think.

It is a port of an old C-algorithm. Technical details: Mix and resample four channels into input data, apply Hanning window, calculate 128-point fixed point FFT, calculate decibel representation, plot data.
koobo is offline  
Old 16 June 2022, 13:23   #11
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
I was looking for a way retrieve actual sample address being played and landed here. From the HW manual it seems like audio registers are write only so it shouldn't be possible but maybe there is some trick?
KONEY is offline  
Old 16 June 2022, 17:20   #12
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
You have to access player structures, it typically maintains a copy of sample ptrs, periods, volumes, etc. for all the (active) channels. So you take sample ptrs and then you calculate where exactly within a sample you are. This can get tricky due to sample looping, replaying the same sample with a different note/period, changing volume, etc. You also have to maintain frame counters for each channel you so know for how long it's been played.
I did that with the noisetracker player, in a music disc we released back in the 90's. So if you are using protracker it could be done in a similar way *or* if you switch to P61 player that has the oscilloscope already built-in you could just customize it (haven't used it myself, I only needed a pure player at some point).
IIRC you are primarily using octamed, so in that case you'll have to look into its source code but the principles are the same.
a/b is offline  
Old 16 June 2022, 17:51   #13
Predseda
Puttymoon inhabitant
 
Predseda's Avatar
 
Join Date: Mar 2007
Location: Tromaville
Age: 46
Posts: 7,539
Send a message via ICQ to Predseda
It is indeed cool, but what does it tell me?
Predseda is offline  
Old 16 June 2022, 18:05   #14
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by Predseda View Post
It is indeed cool, but what does it tell me?
ProTracker is not a professional music production tool. The basic (and improper) visualizers are there mostly to entertain you and make the tracker more interesting to use.

Both the spectrum analyzer and the VU-meters are fake.
8bitbubsy is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
More than 4 sound channels - how it works? Mrs Beanbag Coders. General 210 03 March 2024 10:16
Help with Blue Ribbon Sound Works One Stop Music Shop Tavis support.Apps 16 07 May 2022 19:13
Advanced Amiga Analyzer 2.0 Nibbler support.Hardware 2 14 July 2016 13:30
25 ZX Spectrum Games That Sound Like Seventies o Movies s2325 Retrogaming General Discussion 1 29 July 2011 19:24
Logic Analyzer ??????? Dimlow support.Hardware 7 25 September 2008 17:29

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 +2. The time now is 00:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08588 seconds with 13 queries