Rockbox Development > Feature Ideas
X-Y scope
insanepotato:
Ok, I think I can do that :D
Thanks
Strife89:
When you get a patch up, do link it here, please. ;)
dreamlayers:
Plugins currently cannot access actual PCM data. They can just get peak values. If those were used, the result wouldn't quite be an X-Y scope. Part of FS#10065 adds a pcm_get_peak_buffer function for plugins, which allows access to PCM data
insanepotato:
I have still yet to use the code from the FS#10065, and know nothing about PCM data; but here's what I have thus far: FS#10135
It seemed to work in the simulator, but doesn't really on a real device. All the points appear in the lower right of the screen, which leads me to believe the peaks are always positive(?). If this is true, how do i get the negative peaks?
The code used in Oscillosope to get the peaks is (not exactly as appears in Oscilloscope):
x = rb->mas_codec_readreg(0xC);
y = rb->mas_codec_readreg(0xD);
rb->pcm_calculate_peaks(&x, &y);
The following is later performed on x and y before they are drawn (not exactly as appears in Oscilloscope)
x = LCD_HEIGHT/2-1 - (((LCD_HEIGHT-2) * x) >> 16));
y = LCD_HEIGHT/2+1 + (((LCD_HEIGHT-2) * x) >> 16));
(Is the bit shifting to get only the positive peak? if so, do i just "<< 16" to get the negative?)
If someone could possibly give some explanations or link me up to some reading material, that would be great ::) ::) ::)
edyasia:
Hi!!! i`m impressed for this thread...
For winamp users here is a post started for me about X-y scope.... for a example. http://forums.winamp.com/showthread.php?threadid=249159
Thanks and waiting for x-y final plugin or demo release
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version