-
dfkettle
Great effort for someone new to Pd!. I haven't tried using it yet, but I see a couple of things that could be changed. First, it also uses the 'unauthorized' library (I assume that's where [spigot~] is supposed to come from. If you want to eliminate that dependency (since it seems you're not using anything else from that library), you could just replace [spigot~] with [*~], which will do the same thing by multiplying the signal by zero or one.
Also, you don't really need 8 copies of the "row" sub-patch; you can make it an abstraction by putting it in a separate file and using creation arguments. You may not have learned about creation arguments yet if you're new to Pd, but they can make your life a lot easier by avoiding a lot of duplicate code. Notice the '$1' in the screen print above. It represents the first creation argument ($2 would represent the second, etc.).
And finally, I had to add [declare -lib ceammc] to the top-level patch, or the objects in the Ceammc library wouldn't be loaded. This may be a quirk of the Windows version of Pd, I'm not sure (I don't own a Mac). But I've found that the [declare] object is needed for some external libraries, although not all. I've never been able to figure out why some libraries require it and others don't. Seems it isn't necessary on a Mac. I like to add it anyway, to make the patch more self-documenting and to remind myself which externals are required.
-
dfkettle
@Il-pleut Beware of 'academia.edu'. Whatever you do, don't register on their site, or you'll start getting all sorts of spam from them, with subjects like "Are you the author of blah-blah-blah?".
https://www.reddit.com/r/AskAcademia/comments/bsuxe6/what_exactly_is_academiaedu/
-
dfkettle
@whale-av said:
@dfkettle That's unfortunate.
Maybe try Asio4All...... https://www.asio4all.org/....... as a universal driver for Pd and Audacity.
It will have a settings window...... individual for each application..... so try to keep them as identical as possible.
It will give you lower latency and allow you to use multiple soundcards so it can be useful anyway.
David.I don't think that's an option for Audacity, at least not under Windows. It uses PortAudio for all three "hosts" (MME, Windows DirectSound or WASAPI), as you can see in the screen capture above. I have to confess that I don't really understand the difference between audio "host" and "driver", though, as they're called in Audacity. Maybe there's a way to tell Audacity to use ASIO4All, but I don't know how. I already have ASIO4All installed, I use it with other programs.
-
dfkettle
So I tried a three-way comparison. I played the file back in Audacity, my patch and WIndows Media Player. None of them matched, they all varied in frequency, although Audacity and WMP came the closest to matching. Any thoughts on that?
-
dfkettle
@ddw_music said:
At this point, I'm pretty well satisfied that Pd's behavior is fine, and your patch is doing the right thing. So the real point of this test is to find out the boundaries of Audacity's correct behavior, not really anything else.
Likewise, although I'm a little surprised, given that Audacity has been around for so long, and since I'm playing back at the same sample rate no interpolation is required. It's just sending the sample data in blocks to the audio driver or host. Maybe something to do with the latency setting? I'm just letting it default, I've never played around with it before.
-
dfkettle
I'm going to create another file in Audacity at a SR of 48000, then try playing it back at 48000 in both. Maybe I'll have better luck. I'll also try using a different driver (audio host?) in Audacity.
-
dfkettle
@ddw_music said:
@dfkettle said:
Edit: My audio interface is running at 44,100 (a Steinberg UR22), and so are Audacity and Pure Data.
@ddw_music I ran your test patch and it seems that 'phasor~' runs a tiny bit slow on my machine
Nope.
Pd's control block resolution is 64 samples. [timer] can report only on 64 sample boundaries.
Now... what is 44100 / 64? ... It's 689.0625.
This is not an integer.
Therefore there is no way, at 44.1 kHz, that a number of control blocks can add up to exactly one second.
When I did it in the morning, my internal soundcard supports only 48 kHz... which is a multiple of 64.
Gotcha. I changed the SR to 48000 and now the test shows exactly 1000 ms.
There will be no deviation in pitch based on the divisibility of the sample rate. That isn't how soundcards work.
even though the CPU usage is only fluctuating between 5 and 15%.
That isn't how soundcards work either.
I know that, but I thought maybe the CPU might be too busy and the data wasn't being sent to the audio interface fast enough. So I checked the CPU usage in the Windows system monitor.
-
dfkettle
@seb-harmonik.ar said:
@dfkettle ok well it seems like other people have had the exact same problem on windows with audacity and you're assuming the only reason why your sound settings are messed up is explicitly changing the sample rate. If you read the posts you'll see that one person had to reinstall some audio drivers. Sometimes OSs and programs don't work together exactly as they should.
So I'm starting to think this could be a driver issue. In Pure Data, I have the choice of using MMIO or ASIO. I was using MMIO (ASIO doesn' seem to work at all). In Audacity, I have the choice of using MME, Windows DirectSound or Windows WASAPI (all of which use PortAudio); I was using MME. Could this explain the problem? It would make sense to use the same host for both, but they don't seem to offer the same choices, so I'm forced to use different ones.
-
dfkettle
@seb-harmonik.ar said:
Now, the issue is not so much recording in Audacity as it is playing back in Audacity. Did you look at the link I posted above and the link from other David? What is your current system device playback sample rate?
edit: to clarify, it could very well be that audacity is generating plucks for 44,100 samplerate but playing them back at a higher one.I don't know why it would play back at a higher rate, unless I changed the SR, which I didn't.
Edit: My audio interface is running at 44,100 (a Steinberg UR22), and so are Audacity and Pure Data.
@ddw_music I ran your test patch and it seems that 'phasor~' runs a tiny bit slow on my machine, even though the CPU usage is only fluctuating between 5 and 15%. I ran the test several times, and it consistently reports 999.909 instead of 1000. Would that be enough to cause a perceptible drop in pitch? I'm not sure of the arithmetic to figure that out.
Edit: Actually, I guess this means it's running faster, right?
-
dfkettle
I'm not sure how many of these comments are addressed to me or the other David, but in any case, I'm getting a little confused. To get back to my original post (and ignoring the issue of guard points, which I know is important but not really relevant to my question), I'd like to reiterate:
-
I didn't use Audacity to record anything, I just used it to create a sound file with one of the built-in UGEN's (create a new track, then click on 'Generate->Pluck...' in the toolbar). Really, the file could have originated anywhere, and whether or not there were timing inaccuracies when it was created is completely irrelevant. I'm just comparing the way it sounds when played back in Audacity vs. when it's played back in my Pure Data patch.
-
Someone asked me "how much is it off by"; I'm not sure how to answer that, except to say that it sounds about one semi-tone higher in Audacity than it does in Pure Data, although I don't have a very good ear for pitch. (If the problem was in Audacity, wouldn't the frequency be lower in Audacity than in Pure Data or is that an over-simplification?)
-
I don't think I mentioned this, but I'm running both on the same computer, a HP-P6230F (with a quad-core processor running at 2.60 GHz running Windows 10 64-bit). I was going to provide a link to the specs on the HP web site, but they seem to have removed the page (it's an old computer). I'm running Pure Data 0.53.2, 64-bit, and Audacity 3.2.5, 64-bit.
-
Also not previously mentioned, I tried running Pd in both real-time and non-real-time mode, but it didn't seem to make any difference.
I appreciate everyone's help, but can we limit the discussion to my original question and ignore other issues like guard points, interpolation (which I don't think applies to my question, since I'm playing the file back at the original speed) and problems related to recording in Audacity? They probably deserve a thread of their own, anyway.
-