<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: MSP external inside pfft</title>
		<atom:link href="http://cycling74.com/forums/topic/msp-external-inside-pfft/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/msp-external-inside-pfft/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 21:09:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-63919</guid>
					<title><![CDATA[MSP external inside pfft]]></title>
					<link>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-63919</link>
					<pubDate>Thu, 09 Aug 2012 14:44:11 +0000</pubDate>
					<dc:creator>CarmineCella</dc:creator>

					<description>
						<![CDATA[
						<p>Hi all,</p>
<p>I&#8217;m writing a Max external called sparkle~ and I have a problem.</p>
<p>It&#8217;s a tool for frequency processing: in the first version I was doing<br />
windowing and overlapping my self,<br />
taking and giving audio data, such as:</p>
<p>adc~ 1<br />
  !<br />
  !<br />
sparkle~ (overlapp add, windowing, fft, ifft, cartopol, poltocar, &#8230; all<br />
inside)<br />
  !<br />
  !<br />
dac~ 1</p>
<p>Then, for some reasons, i decided to make it work inside a pfft~ subpatch<br />
like this:</p>
<p>fftin~ 1<br />
  !<br />
  !<br />
cartopol~<br />
  !<br />
  !<br />
sparkle~ (not windowing nor overlapping anymore, just data processing)<br />
  !<br />
  !<br />
poltocar~<br />
  !<br />
  !<br />
fftout~ 1</p>
<p>Here it is my problem:</p>
<p>the resynthesis is not good as I get when I was doing the overlap myself<br />
(is like filtered). I suppose I&#8217;m loosing data because in the<br />
perfom function of the external I only have access to vector-sized buffers<br />
not to FFT-sized buffer (as I&#8217;m supposing should happen inside pfft~).<br />
But if I try to access more data everything crashes, as if it were not<br />
allocated.</p>
<p>Can anyone give me a hint to solve the problem?</p>
<p>Thanks a lot, Carmine</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230504</guid>
					<title><![CDATA[Re: MSP external inside pfft]]></title>
					<link>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230504</link>
					<pubDate>Fri, 10 Aug 2012 14:15:04 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>It&#8217;s hard to tell without looking at the code. Basically what you get in your perform method is the unwindowed vector of real / imaginary for each window. As an example here it what zsa.centroid&#8217;s perform looks like:</p>
<p><code><br />
void zsa_centroid_perform64(t_zsa_centroid *x, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long sampleframes, long flags, void *userparam)<br />
{<br />
	double *r			= ins[0];<br />
	double *i			= ins[1];<br />
	double *freqout		= outs[0];<br />
	long j, n			= sampleframes;<br />
	double binsize		= x->x_sr / (sampleframes * 2);<br />
	double centroid		= 0;<br />
	double sommeAmp		= 0;<br />
	double sommeIndex	= 0;<br />
	double tmp;</code></p>
<p>	for (j = 0; j < n; j++) {<br />
		tmp = r[j]*r[j] + i[j]*i[j];	// amplitude energy<br />
		sommeAmp += tmp;<br />
		sommeIndex += tmp * j;<br />
	}</p>
<p>	if (sommeAmp)<br />
		centroid = sommeIndex / sommeAmp * binsize;<br />
	else<br />
		centroid = 0.;</p>
<p>	while (n--) {<br />
		*freqout++ = centroid;<br />
	}<br />
}<br /></p>
<p>You might need to do something different to take care of the number of overlaps. Zsa.centroid&#8217;s outputs needs to be divided by the number of overlaps before being sent out pfft~ out objects to have the correct value.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230505</guid>
					<title><![CDATA[Re: MSP external inside pfft]]></title>
					<link>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230505</link>
					<pubDate>Sat, 11 Aug 2012 10:38:59 +0000</pubDate>
					<dc:creator>CarmineCella</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Emmanuel, </p>
<p>thanks for your answer. I&#8217;ll try to clean up a bit my code and I&#8217;ll post it.<br />
Anyway, here what I am assuming inside pfft:</p>
<p>1. the signal passed to any fftin~ is already composed and windowed properly<br />
2. inside my external I can use up to N image&#038;real samples (as specified in the parameters of pfft)<br />
3. is up to me the normalization for the signal before passing it to fftout~</p>
<p>is this right?</p>
<p>I&#8217;ll keep you update. Best, Carmine</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230506</guid>
					<title><![CDATA[Re: MSP external inside pfft]]></title>
					<link>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230506</link>
					<pubDate>Sat, 11 Aug 2012 15:21:38 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>1. yep<br />
2. yep (looking at numins and numouts should give you the number of bins)<br />
3. probably</p>
<p>Cheers,<br />
ej</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230507</guid>
					<title><![CDATA[Re: MSP external inside pfft]]></title>
					<link>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230507</link>
					<pubDate>Sun, 12 Aug 2012 18:20:38 +0000</pubDate>
					<dc:creator>CarmineCella</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Emmanuel,</p>
<p>I finally solved the problem. In fact I was doing all in the right way, but I was using in a wrong way pfft~  : I was assuming the full-spectrum mode without setting the specific flag. I then changed the invocation of pfft~ in the following way:</p>
<p>pfft~ sparkle_obj 2048 4 0 1</p>
<p>and everything started working!</p>
<p>Thanks anyway for your help.<br />
Cheers, Carmine</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230508</guid>
					<title><![CDATA[Re: MSP external inside pfft]]></title>
					<link>http://cycling74.com/forums/topic/msp-external-inside-pfft/#post-230508</link>
					<pubDate>Mon, 13 Aug 2012 16:35:57 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>Cool. Thanks for the update. Looking forward to hearing sparkle magic ;-)</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

