play~ audio quality problems

Mar 16, 2006 at 3:30pm

play~ audio quality problems

Hi,

I’ve been using play~ to play back sounds loaded into a buffer~, and
have discovered that the sound quality seems to be a problem. The
playback sounds like it is being slightly ring-modulated, or that it is
showing the effects of a sample-rate mismatch. In any case, to test out
the problem, I tried playing the buffer back with wave~, and the issue
did not occur. I am driving play~ with a line~ object, and thought that
that might also be the problem, so I replaced the line~ with a phasor~
but the problem persisted.

The attached patch demonstrates the issue. Load a 1 minute stereo sample
in the buffer, and then turn on the DAC. Both play~ and wave~ will
playback simultaneously, but you can x-fade between the two to hear the
sound quality difference. Any insight as to why this might be happening
and what I could do to prevent it would be greatly appreciated. Many
thanks in advance.

Best,

Peter Traub

#24913
Mar 16, 2006 at 3:40pm

Apologies. It seems the binary file I attached may cause some problems.
Here is a text version.

Best,

Peter

max v2;
#N vpatcher 275 65 876 807;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden message 181 85 20 196617 50;
#P hidden newex 72 31 48 196617 loadbang;
#P message 354 89 55 196617 0.016666;
#P flonum 179 204 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 290 204 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 450 83 17 196617 0.;
#P hidden newex 77 248 35 196617 *~ 1.;
#P hidden flonum 172 249 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden newex 123 246 35 196617 *~ 1.;
#P hidden newex 147 210 27 196617 + 1.;
#P hidden newex 147 187 34 196617 * -1.;
#P hidden newex 342 251 35 196617 *~ 1.;
#P hidden newex 295 251 35 196617 *~ 1.;
#P hidden newex 235 198 40 196617 / 100.;
#P user hslider 181 172 18 128 101 1 0 0;
#P newex 354 113 46 196617 phasor~;
#P newex 354 151 108 196617 wave~ buf 0 60000 2;
#P user ezdac~ 221 550 265 583 0;
#P user meter~ 196 390 213 514 50 0 168 0 103 103 103 255 153 0 255 0 0
217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 283 390 300 514 50 0 168 0 103 103 103 255 153 0 255 0 0
217 217 0 153 186 0 12 3 3 3 3;
#P user gain~ 254 391 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 221 391 24 100 158 0 1.071519 7.94321 10.;
#P newex 72 145 61 196617 play~ buf 2;
#P message 72 84 86 196617 0 , 60000 60000;
#P newex 72 111 32 196617 line~;
#P message 386 395 30 196617 read;
#P newex 386 423 103 196617 buffer~ buf 60000 2;
#P comment 155 153 194 196617 x-fade between play~ and wave~ objects;
#P window setfont “Sans Serif” 12.;
#P window linecount 2;
#P comment 387 355 158 196620 read a 1 minute stereo sample in here first;
#P window linecount 7;
#P comment 13 392 174 196620 Directions: read in a one minute stereo
sample to buffer. start DAC. playback should begin immediately. crossade
between play~ and wave~ objects to hear sound quality difference.;
#P hidden connect 28 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 7 0;
#P hidden connect 7 0 23 0;
#P hidden connect 20 0 23 1;
#P hidden connect 7 1 21 0;
#P hidden connect 16 0 19 0;
#P hidden connect 19 0 20 0;
#P hidden connect 20 0 21 1;
#P hidden connect 20 0 22 0;
#P hidden connect 20 0 26 0;
#P hidden connect 28 0 29 0;
#P hidden connect 29 0 15 0;
#P hidden connect 8 0 11 0;
#P hidden connect 17 0 8 0;
#P hidden connect 23 0 8 0;
#P connect 8 0 12 0;
#P hidden connect 15 0 16 0;
#P hidden connect 8 1 9 0;
#P hidden connect 18 0 9 0;
#P hidden connect 21 0 9 0;
#P connect 9 0 12 1;
#P hidden connect 9 0 10 0;
#P hidden connect 16 0 25 0;
#P hidden connect 13 0 17 0;
#P hidden connect 16 0 17 1;
#P hidden connect 13 1 18 0;
#P hidden connect 28 0 27 0;
#P connect 27 0 14 0;
#P connect 14 0 13 0;
#P hidden connect 16 0 18 1;
#P connect 4 0 3 0;
#P connect 24 0 14 1;
#P pop;

#72693
Mar 16, 2006 at 4:34pm

Hi Peter,

I tried the patch you sent and couldn’t reproduce the effect.
Sometimes with long sound files there is a problem with the bit depth
of the playback signal that results in playback degradation, but “ring
modulated” isn’t really how I would describe the sound… anyway, you
could try Joshua’s hi-res objects
(http://cycling74.com/twiki/bin/view/Share/JoshuaKitClayton) to see if
that fixes your problem. Otherwise the only thing I can suggest is to
make your one minute sound file available somewhere on the web so that
we can test that.

Ben

#72694
Mar 16, 2006 at 6:15pm

Hi Ben,

Yes, I suppose bit-depth degradation might be a better description of
the sound, and it does happen over time. In my actual application, I’m
using a 10 min. buffer and not the 1 min. one in my test file, so the
problem is even more accute. In any case, I’ve uploaded a 1 min. test
sound to the web that you can download and hear the issue with. It is at:

http://www.people.virginia.edu/~pmt4u/testsnd.aif

After about 15 seconds of playback in the test patch, try hard x-fading
between the play~ and wave~ output (i.e., listen fully to one and then
the other), and the difference between the two should become quite
audible. It becomes more audible over time. I will check out the hi-res
objects you suggest, but I’m curious why this problem exists with play~
in the first place and if there is some sort of workaround? Many thanks.

Best,

Peter

#72695
Mar 16, 2006 at 6:42pm

You might compare it with the different interpolation modes on wave~.
(try interp 0, 1, 2) Mode 2 is high quality, mode 1 is default, mode 0
is off. Sorry, not a solution, but might reveal what’s going on.

Peter McCulloch

#72696
Mar 16, 2006 at 7:56pm

Hi Peter,

Upon reading the docs for the hi.res objects, it seems that it is a bit
resolution issue. I have replaced my core playback module, that used
line~, play~, and pong~ with the hi.res objects hr.line~, hr.play~, and
hr.wrap~. They appear to do the trick in both the test application I
posted to the list and my main application. However, they do appear to
incur the cost of higher CPU utilization, meaning my poly~ instrument
that uses these playback objects can’t have as many instances of them.

Btw, I did try playing with the interp modes for wave~, but interp 0,
while giving noticeably diminished quality, did not give the same sort
of effect as I was hearing with play~. Many thanks.

Best,

Peter

#72697
Mar 17, 2006 at 9:44am

If you use the phase related playback methods on longer sound files than
ca. 6 min 20 seconds you will run into that problem, and ist obvious,
dealing with higher resolution will need more CPU.
Most things you can do with play~ and wave~, you could also do with
groove~. As you just start the playback, and then the object runs on its
own, sample by sample. I guess redoing your approach with groove~’s
might save you the missing CPU cycles. You could use the groove~’s sync
outlet as you master if you need one. Though the resolution problem
would then arise there as well, but you might not need the high
resolution there. Depends on what you’re doing…

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#72698

You must be logged in to reply to this topic.