Re: [Sndobj-devel] SndLoop setting input and resampling
Status: Abandoned
Brought to you by:
veplaini
From: Victor L. <Vic...@nu...> - 2009-08-13 09:26:44
|
Sounds like a bug. I have never tried switching the input to it and then resampling. You could try just running with some audio, without switching the output and then calling resample() to see if it does what it supposed to do. I have used SndLoop like that quite a lot and never encountered a problem. When sampling, the input is connected directly to the output, ie: PutSample((m_output[m_vecpos] = m_input->Output(m_vecpos))); PutSample() writes the signal into memory. So you are getting input OK. Then when you are playing back it switches to this code: m_output[m_vecpos] = GetSample(); m_point += m_pitch; m_rpointer = (long)m_point; while(m_point >= m_size) m_point -= m_size; while(m_point < 0) m_point += m_size; Now the output is connected to memory only (through GetSample()). The playback speed is controlled by m_pitch. If that is for some reason, set to 0, you would be stuck in one memory location and would hear nothing (possibly a click when switching off or on, but nothing else). Make sure pitch is not 0. Looking at the code, I can't see what else could be wrong. Calling SetInput() only points the input object to a different object. Victor At 01:30 13/08/2009, Daniel Skinner wrote: >Hi, > >Ive created a SndLoop object with a default input of sndobj.SndIn() >with a sample time of 2 seconds. As I understand, at this point is >should have sampled 2 seconds of nothing and be playing in a >continuous loop. Is that correct? > >Afterwards I play back a wav file with SndRead and sometime during >the playback i > >sndloop.SetInput(sndread) >sndloop.ReSample() > >effectively. As it resamples for 2 seconds I can immediately see the >output of the sndloop as it plays back everything it is sampling and >then at 2 seconds it stops. No looping or anything. I could also set >the input to an oscili and it will produce the same effect. 2 >seconds of pushing the same sound data to the output during >resampling, then silence afterwards, no looping. Im showing no >errors on the object and i can repeat the process as many times as i like. > >On a side note, its exciting to see with sndobj that i can start >sampling any portion of a signal chain that i may have going and >start messing with it. This is one of the first things i do when >creating ambient background noise for music i mix. Kudos > >Thanks, >Daniel >------------------------------------------------------------------------------ >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >trial. Simplify your report design, integration and deployment - and focus on >what you do best, core application coding. Discover what's new with >Crystal Reports now. http://p.sf.net/sfu/bobj-july >_______________________________________________ >Sndobj-devel mailing list >Snd...@li... >https://lists.sourceforge.net/lists/listinfo/sndobj-devel Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth |