** MUS171 #17 03 01 |
Miller: @0000 This is where we got last time, with the exception that I added some nice comments to try to make it clear what was going on. | es: @0000 |
@0015 We got as far as to make a recirculating delay network. And, I demonstrated that you could consider this either as a thing that does things in time or a thing that does filtering -- | es: @0015 |
@0030 which is to say changing the frequency content of a sound; in other words, making some frequencies loud and others less loud. So, to be overly pedantic, I'll just go ahead and re-demonstrate that quickly. So, here's noise: [noise] | es: @0030 |
Miller: @0045 And, here is noise recirculating. It's a recirculating delay; I'm going to recirculate the delay. Oh, the delay will be 10 milliseconds long, and I'll recirculate it, | es: @0045 |
@0060 multiplying by some number that's less than 1. Miller: So, we're going to multiply now by 88 percent. And, now what we're going to hear is a tone. [noise tone emphasizing 100Hz] | es: @0060 |
Miller: And, @0075 that tone, if I checked it on a piano -- which I don't have one of right here -- it would be at 100 Hertz. Because a 10 millisecond period corresponds to 100 cycles per second. Or, to put it another way, | es: @0075 |
@0090 anything that comes in to this thing is going to come out, and then come out again at 10 milliseconds later, and almost as loud. And then, again, 10 milliseconds yet later. | es: @0090 |
So, everything that comes in, it's going to come out, almost repeating itself, every 10 milliseconds, @0105 which will therefore sound like a thing that's at 100 Hertz. And, that would be true for delay times that go up to some 30 milliseconds, or tones that go down to | es: @0105 |
@0120 33 Hertz. [filtered noise varying] Miller: You can almost say [hums] down an octave there. Then, below that you can't really hear a pitch any more. [changing noise] | es: @0120 |
Miller: You just hear some kind of @0135 thing in time. So, now, getting rid of the noise and turning on the famous microphone. ... Is this going to work now? I didn't test this. Hello. [recirculating sound from microphone] | es: @0135 |
Miller: Oh, yeah! So, now @0150 this is a nice recirculating delay with voice coming in. And what you hear is echoes every 84 milliseconds, which is what? -- 12 times a second or something like that, which you hear as | es: @0150 |
@0165 an amount of time [snaps fingers] and not as a frequency. | es: @0165 |
If I make those echoes be close to each other in time, like 20 milliseconds away from each other, then you no longer hear that as [snaps] as a series in time, but instead you hear it as @0180 a nice pitch. And now we get...[tones generated by voice in microphone] "Sort of a poor-man's vocoder ..." | es: @0180 |
Miller: ... which is just me talking through a comb filter. A "comb" filter is just another word for @0195 a delay network that likes frequencies that are multiples of a certain fundamental frequency. In this case, this comb filter likes frequencies that are multiples of 50 because 50 Hertz corresponds to | es: @0195 |
@0210 20 milliseconds here. It's called a "comb filter" because if you look at the frequency response of this thing, considered as a filter, there's a peak every 50 Hertz, regularly. That looks like a comb of some sort. | es: @0210 |
@0225 Looking forward ... elaborating this idea in the future, we'll be able to design arbitrary filters with desired frequency responses. But, right now all I'm doing is reinforcing the | es: @0225 |
@0240 notion that this thing can be considered as a filter -- which is a thing which will take any sinusoid and then give you a sinusoid out at the same frequency, but perhaps at a different amplitude. That's a filter. Or, you can consider it as just a delay network, | es: @0240 |
@0255 which is a thing which makes echoes. | es: @0255 |
Those two things are really the same thing, except that they're psychologically different and the parameters that you put into it might make it act more like the one thing or like the other -- or seem like more like the one thing or the other. So, @0270 there's that. (Let's not even worry about that any more.) | es: @0270 |
Now what I want to do... Oh, yes, I do want to say one thing before I leave here, which is that this is a "linear time invariant" network, as the @0285 engineers will call it. And, what that implies is that if I put a nice sinusoid in, at any given frequency, like 50 Hertz -- nah, 100 Hertz -- out will come | es: @0285 |
@0300 a nice sinusoid of the same frequency that went in. [100Hz tone plays] | es: @0300 |
Miller: There's no way that a recirculating delay network -- or any kind of delay network that doesn't have time varying stuff in it -- can take a sinusoid of any given frequency and put out a sinusoid of @0315 some other frequency. (If you put a color of light into a filter, or into a prism, or any other optics like that, you get the same color light out, if it's monochromatic.) | es: @0315 |
That's a @0330 thing which we count on because it makes it possible for... Well, your ears seem to like to segregate sounds that come in by frequency, and so, if something sort of leaves frequency to where they are, it doesn't make different frequencies | es: @0330 |
@0345 out of incoming frequencies, then you can say that your ear might hear a very clear relationship between what goes in and what goes out. Maybe. I'm hopeful that that's true anyway. | es: @0345 |
Now, what I want to do is get into @0360 some practical stuff that you can do with delay networks. The first thing that I want to comment on is this: (Let's see. What I'm going to do is do a | es: @0360 |
@0375 "Save as," and start all over again, because for this next example, I actually want to make a non-recirculating delay.) | es: @0375 |
Instead, what I want it to do is have it @0390 be something where I can change the delay time. So, we'll call it "delay-time-change.pd" <<Saving ""3.01/2.delay-time-change.pd">>. There it is, and now we're going to make in non-recirculating which means I don't care about the gain any more... | es: @0390 |
... as it @0405 turns out. I don't care about listening to the original sound. I just want to take the original sound and throw it into the delay line. Let's rename the delay line, just so you can have both patches open at once if you want. | es: @0405 |
@0420 We don't need this pitch calculation anymore. Go away... Whatever that is down there get rid of it... OK, And then we're going to read with the delay time given. | es: @0420 |
@0435 And then we're just going to listen to it. Like that. So am I doing anything stupid? Find out soon. | es: @0435 |
And so I'll do the brutal thing of putting a sinusoid in. @0450 In fact I'll give it a nice 440 Hertz sinusoid. And now we hear: [tone starts] A 440. Very good. Actually... [tone fades out] make that a little bit louder at the | es: @0450 |
@0465 mixer so that I don't have to do anything funny. [tone starts] OK, and now we're going to change the delay time. OK, so a 440 Hertz sinusoid comes in and you hear it | es: @0465 |
@0480 20 milliseconds late. You don't hear the fact that you heard it 20 milliseconds late. It's coming out as a perfectly clean 440 Hertz sinusoid except that the phase is different. And that's just what that is. | es: @0480 |
Now we start changing the delay time though and we get something else. [tone begins to stutter] -- @0495 Which is ugliness. And the reason for that ugliness is very simple: It's just that if you change the delay time, it's the same thing as if | es: @0495 |
@0510 you were reading from a wavetable and you suddenly changed the location of the wavetable that you were reading from. That would make discontinuous change in the amplitude or in the signal. And you will hear that discontinuous change as a == ["zippered" tone starts] click. | es: @0510 |
@0525 Just to throw out a warning, of course if I was listening to noise ... [white noise starts] I could change this delay time | es: @0525 |
@0540 and you can't hear the click. Because there's no correlation between one sample of white noise and the next sample anyway. So the fact that you changed the place that you listen to it from doesn't | es: @0540 |
@0555 sound like anything different from how the noise sounds to start with. | es: @0555 |
I'm telling you this because you're going to make networks. And they're going to sound great because you're going to make them with some noisy signal like an overdriven electric guitar or something like that. And you're not going to know @0570 that you're actually doing this to your signal: ["zippered" tone starts] ... until [tone stops] someone with better ears or more experienced ears than you points it out to you or something horrible like that. | es: @0570 |
So test your stuff with @0585 sinusoids, which are the most punishing signal that you could possibly put through a thing. Even though it's the simplest signal too. So that you can tell whether your patch is clean or dirty. (Oh yeah let me get rid of this comment which is superfluous and this one too.) | es: @0585 |
@0600 Now. So let's make an application: What I'm going to do is take my nice incoming sound and I'm going | es: @0600 |
@0615 to listen to it... oh, great I'll do it here for clarity's sake. I'll do this with a microphone now just to annoy you all. ... What we're going to do is take the incoming | es: @0615 |
@0630 sound which is the microphone. I'm going to talk into the microphone and see if it's [voice begins being amplified] amplifying my voice correctly. OK great. Slight delay but that's all right. And now I'm going to give you a delayed copy of it: [amplified voice begins to be delayed] "Hello." | es: @0630 |
@0645 And now it's obviously far too late. So here's my voice and here's my voice ... and here's my voice delayed. But now I'm going to say, "Can I change this | es: @0645 |
@0660 delay time with the mouse and get away with it?" | es: @0660 |
So now I'm on a different delay. And well ... Never mind I thought it was going to be more forgiving than that. But my voice is already low enough and dull enough that @0675 changing the delay time is very, very bad and nasty. So I didn't succeed in demonstrating something where you can change the delay time and think it was clean -- and in fact wasn't. | es: @0675 |
-- I can do that and you don't hear @0690 the problem. | es: @0690 |
If you want to have a delay line where you can change the time, then you have to work. And the work that you have to do is really better described as Pd lore than described as anything theoretical. @0705 So now we're going to enter into Pd lore. Actually this is computer music lore, because if we were using some other software from Pd this would also be necessary and you would do almost exactly the same thing. And the same thing is this: | es: @0705 |
@0720 Before I do it right let me do it wrong another way. It's always fun to do things wrong. Let's make it change smoothly. I'm afraid I'm being repetitious here because I think I already showed you this for samples. But I'm going to take | es: @0720 |
@0735 this thing and just line it. So we'll say pack the thing with 100 milliseconds of packing. And then I'll make a nice line. And then I'll put the delread~ on. | es: @0735 |
@0750 Right. Sorry I'm really belaboring points here today but this is... [voice amplification starts] "Belaboring point." There's a delay and now I'm going to say 'ahh' and change the delay. So 'ahhhhhh'. -- Did NOT help. | es: @0750 |
@0765 OK the reason that didn't help is because the line is not an audio signal -- it's only updating every 20 milliseconds. And so you're just hearing 50 problems a second instead of however many | es: @0765 |
@0780 problems a second I was generating with the mouse. No better. | es: @0780 |
Watch Pd do something wrong just while I'm thinking of it. Really at this point, I got a nice error here. There's a @0795 signal coming out of this line, but delread~ doesn't want a signal, and so I got an error message here which you don't see very often. "Signal outlet connected to non-signal inlet (ignored.)" What that means is | es: @0795 |
@0810 this thing was line (without a tilde) which is a control object. And I was able to connect it, and then I changed it to something else that it wasn't able to connect, but it didn't have the heart to disconnect it because I might want to change it back.. | es: @0810 |
@0825 But, nonetheless, it's not working right now. This thing really should turn red and blink or something like that. | es: @0825 |
Also, by the way, you don't see this all the time because usually the order in which you do this is you get the object built, and then you try to connect it, and @0840 then Pd just won't let you connect it. That's probably the correct thing to do in that kind of situation. Anyway, you saw that happen. This is not going to work either. | es: @0840 |
Is there a version of delread~ @0855 that I could plunk a signal into? The answer is "yes." There's one called "variable delay." <<vd~>> (This started out in a different language where this wasn't such an ugly acronym.) | es: @0855 |
@0870 Variable delay is a delay object whose input expects a signal instead of a control message. And, | es: @0870 |
@0885 as a consequence of that, it does two things that delread~ does not do. The first thing is it's | es: @0885 |
@0900 willing to change its delay time every single sample. | es: @0900 |
Then there's another thing that immediately comes up which is that if you're going to be changing delay times from one to another in a continuous way, actually one sample of accuracy isn't enough to make the result clean. @0915 So variable delay has to interpolate the incoming samples to possibly simulate delays that are not an integer number of samples. So delread~, the non-interpolating | es: @0915 |
@0930 control-message delay, will always give you a delay that's actually an integer number of samples. And you can get pretty close to whatever delay time | es: @0930 |
@0945 you want, like within 20-ish microseconds, better than that maybe. | es: @0945 |
But variable delay, vd~, will actually make a four point interpolation of @0960 the stuff that's in the delay line. The delay line's actually a storage area. It will go and find four points and make a four point interpolation among those points to try to guess what the sample ought to have been that is | es: @0960 |
@0975 in between the samples and the delay line that corresponds to exactly the delay that you asked for. | es: @0975 |
The advantage, of course, is that the delay time is exact or as exact @0990 as floating point allows you to be. The disadvantage is that it costs more -- there's more computation involved. Also, if you do that, | es: @0990 |
@1005 that interpolation has its own frequency response which is not perfectly flat. So you will not get a signal whose spectrum is exactly the same. This thing, | es: @1005 |
@1020 because of the interpolation, will drop off in high frequencies somewhat. And that's a bad thing which you can control by raising your sample rate, but which is always going to be there whenever you interpolate. | es: @1020 |
However, going back to the good stuff, now what happens @1035 when I change the delay time is it does the right stuff. We have a delay going, and now we're going to start to change the delay. In fact, I'm going to say "ahh" and change the delay. "Ahh." [inflected] Ahhh. Good. | es: @1035 |
@1050 Now we have a wonderful patch that let's you generate other pitches than the pitch that you put in. That contradicts what I said before -- except | es: @1050 |
@1065 what I said before was you couldn't go changing anything in the network if you want sinusoids that come in to always come out of the same frequency. Now, I'm changing something -- it's no longer time invariant -- and as a result, that nice property of "stuff that doesn't change in time" | es: @1065 |
@1080 is no longer there, and now we're making other frequencies. | es: @1080 |
Well, what about that? @1095 Now that I've done that, I'm going to stop irritating everyone and go back to the sinusoid. Let's turn this down; turn on the sinusoid. | es: @1095 |
Here's the sinusoid. [tone sounds] It's 440 Hertz for you, again. Then if I listen to the delayed copy of it, [tone] @1110 same pitch, but of course if I change the delay time, [tone] I'm changing the pitch. Well, that's cool. | es: @1110 |
@1125 That should make you immediately think, "I can do all kinds of things with this. I can take someone who sings in a monotone and make them sing a melody or vice versa. I could take something that came out of melody and turn it into a monotone, things like that." Well, | es: @1125 |
@1140 you sort of can. In fact, I'm going to work toward that. | es: @1140 |
However, first off, it might be nice to have an idea about what that frequency is. In other words, how would you predict what that frequency should be? @1155 Why would you want to do that? So that you can get whatever frequency you want... | es: @1155 |
Oh, frequency: What comes out is a transposition of what goes in, so as in a sampler, it's probably appropriate to talk about what kind of transposition you're getting. @1170 That's to say what kind of change in the frequency or relative change in the frequency. -- What is the frequency multiplied by? That's a transposition. To make that painfully obvious, I'm going to throw in a | es: @1170 |
@1185 pair of oscillators, and you'll hear a nice interval which will be a fifth because I'm going to tune this one up to 660. | es: @1185 |
Let's see. Do we hear a fifth? Yeah. And now @1200 when I start playing it with a delay when I start messing the pitches up you will still hear that the pitches are related to each other. It's always a fifth moving up and down in parallel. That's the same thing as saying, | es: @1200 |
@1215 "Yeah, the frequencies all got multiplied by some constant or multiplied by some number rather than maybe added to some number like a ring modulation might have done to it or something like that. | es: @1215 |
"Multiplied by what number?" is the next question. @1230 To answer that I have to do something a little bit more... What's the right word? ...a little bit more "controlled" than this. Right now I'm just sort of mousing willy nilly at this number box. | es: @1230 |
@1245 But in fact what I should consider doing. ... | es: @1245 |
Oh, you know what? Let's save this. Oh no. It's OK. We'll set delay time. And now we have a way of making delay @1260 times up here. You know what? I'll call the delay time down here. And then I'm going to make some message boxes so I can do stuff. So I'm going to say, for instance ... let's jump to 100 and go up to... | es: @1260 |
@1275 We'll go to delay time of 0. Well, I can't really get down to 0 really. Am I going to tell you all this? I'm going to... All right. I'm just going to | es: @1275 |
@1290 cheat. I'm just going to ignore the problem. I'm going to go down the delay time to zero and I'm going to gradually go up to a delay of 1 second. How long am I going to do it? ... Take a second to do it. Oops sorry. That needs to be a pair. | es: @1290 |
@1305 All right. And now I will put in the nice sinusoid. So this is an alternative to that. So now I'm going to... This is the sinusoid. Oops sorry. | es: @1305 |
@1320 Let's get rid of this one again. | es: @1320 |
And now I'm going to start the delay line changing and you all know what you're going to hear, right? Uh, bad! -- A beautiful bad example. @1335 [laughs] That was not my plan. What did I just do? I just made the delay line shrink at exactly the same length that time was passing | es: @1335 |
@1350 in such a way as I slowed the thing down to stop it entirely. OK. This is wonderful but this is not what I really want to do. | es: @1350 |
Let's go up to one half second and take one second to do it. @1365 All right. And now we say: Now what you hear is for the period of one second it drops by an octave. | es: @1365 |
@1380 And what if I wanted to... OK So now you've seen two examples. One is I was able to stop it altogether and the other is I was able to slow it down by a factor of two. | es: @1380 |
Why did it slow down? Well, @1395 there are two moments in time here that might be appropriate to think of: One is the moment where the thing starts and one is the moment where where it ends. I'm thinking about time in... I'm thinking about so-called | es: @1395 |
@1410 "real time" that is the time at which the sound is coming out of the delay line. That's real time for us. A second real time passes while the delay time starts at nothing and goes | es: @1410 |
@1425 up to 500. But this line is being asked to jump to zero and then to ramp to 500. | es: @1425 |
In that second of time how much of that sinusoid do we hear? @1440 Well, ... At the outset you hear the sinusoid that is coming in at the same moment as you're | es: @1440 |
@1455 listening to it. A second later you're listening to the sinusoid as it had been one half second earlier than that, which is to say only one half second | es: @1455 |
@1470 after you started listening to it. So you succeeded in slowing the sinusoid down by a factor of two because you only heard the one | es: @1470 |
@1485 half second of it that went into the delay line between the original time -0 and the time a second later, -500. | es: @1485 |
@1500 Rather than trying to explain that better, I'll make another example which is this: Let's go to 100. Wait. What's a good number? | es: @1500 |
@1515 Let's go to 333 milliseconds--one third of a second. The delay starts at zero and then it ends up at one-third of a second. | es: @1515 |
So how @1530 much of the sinusoid do you hear? You hear the other two-thirds of the second of the sinusoid, which is to say: there's one | es: @1530 |
@1545 third of a second we haven't heard yet because at the end of the process the delay line is a third of a second long so we didn't hear the last third of a second of the sinusoid. You've only got the other two-thirds. So we all know what that is as an interval. It means going down to fifth. | es: @1545 |
So now @1560 when I whack this it goes down to fifth. So now if keep on whacking this I could get it down to a fifth and I could get it to stay there, right? Sort of.... | es: @1560 |
@1575 While we're at it. Now we have a nice tool for changing pitches. | es: @1575 |
So now we can listen. Let's see. I'll shut this up and I'll be me. Hello I'm talking. You'll hear me talking in fifth below @1590 the frequency that I'm speaking now. So I just made a nice wonderful object that transposes my voice down a musical fifth. Oh, yeah, I | es: @1590 |
@1605 played you already what it sounded like when I ring-modulated my voice, which made it an inharmonic sound, usually, because there might be some weird interval between the voice I was speaking in and the frequency of the ring modulator, back when I was ring-modulating my voice. We saw similar | es: @1605 |
@1620 things when we were doing frequency modulation two lectures ago. | es: @1620 |
And now what you're getting is a thing which is different from that. Because it takes the voice and maintains the @1635 relationshipss between the partials that were in the voice, but moves them all down proportionally by the same amount, so that their relationship stays the same. ... | es: @1635 |
... So that the partials going in have frequencies with @1650 ratios of one to two to three to four to five and so on, and those ratios are fixed, even though the frequencies of the partials are being multiplied each by two-thirds. | es: @1650 |
This is a favorite trick of Laurie Anderson's, if you've seen her perform. @1665 However, there's a little bit of a problem here, [sound] because if you listen, try to understand what I'm saying here. | es: @1665 |
First off there are clicks all the time because [sound] I'm having to change the delay time @1680 constantly. Oh, why don't I just never stop? I want the thing to go down a musical fifth, and I want it to last forever. So, we'll say, I don't know, | es: @1680 |
@1695 we'll go on for a million milliseconds, which is 20 minutes. And we'll do that over three million milliseconds, which is an hour. | es: @1695 |
And now I can talk for the ... @1710 better make the delay line really long now, right? Like instead of five seconds, maybe ... I don't know how long to make this before I run out of memory, but let's just live dangerously. | es: @1710 |
So, now we have @1725 five million samples of delay. Oh, it hates me. It's reaching for five million samples within memory right now. Is it going to succeed, or am I going to have to give up? | es: @1725 |
@1740 I hear my disk drive. ... [laughs] It did it. | es: @1740 |
OK, so we now have a delay line that has five million samples in it, [sound - echo] And of course you hear me only on the second delay line, because I'm @1755 only using whatever I asked for. But now, I can start giving you a lecture and it's all going to be all transposed down by a musical fifth. Everything would be perfect -- | es: @1755 |
@1770 except that there's one terrible problem -- it's that it's getting later and later and the whole lecture now will not last 80 minutes, | es: @1770 |
@1785 but would last four-thirds of 80 minutes, if I'm computing right, which is longer than we have in this room. [laughs] | es: @1785 |
@1800 Or, to put it another way, well duh, the delay time is getting longer and longer and longer. And now just for fun, "hello." We'll just give ourselves a bomb that will wake us up in a few seconds. | es: @1800 |
This is not a good way to do pifth-shift if you want to regard that as a real-time process. @1815 How would you ... OK, so maybe we should go back to the other thing and be continually resetting the delay time to smaller values, [sound] but | es: @1815 |
@1830 then of course the smaller values ... But then you couldn't do it without clicking. Right. So what would you do? The answer could be, you change it, but you shut it up while you're | es: @1830 |
@1845 changing it. And then you let it start off again. And now, let me try to explain this better: OK, so, going back to ... oh yes, and I'm going to do this two different ways, too, as I do a little bit too much of. ... Oh, you know what, | es: @1845 |
@1860 I can get rid of this delay line; I don't like what this is doing to my disk drive. So, I'm going to go back to using a reasonable amount of memory here. | es: @1860 |
OK. And you didn't see this, so I'm just going to erase this from the record. @1875 Right. I'm going to lose this idea. What we're going to do instead is make the delay line get quiet -- change to zero, and then get louder again and then start changing. | es: @1875 |
@1890 Let's see, let me even make a simpler example than this. OK. So, what I'm going to do is I'm going to ... So, I'm going to show you two different things: | es: @1890 |
OK, so first off, this was cool, and we're going to save it, @1905 and then we're going to do a "Save as", and we're going to go back to regular old ... How about 3.delay-time-change..., and then I'm going to make more ... going to make a ridiculous, file name ... | es: @1905 |
@1920 I'm going to use an envelope generator to change the delay time cleanly. <<Saving "3.01/3.delay-time-change-with-envelope.pd">> | es: @1920 |
So, now we're going to go back to delread~ . ... @1935 for simplicity's sake. So, we no longer have the right to put this line~ in here (and it's complaining to us, but I'm going to get rid of this.) Now, I'm going to | es: @1935 |
@1950 try to ... Yeah. OK, that's good. Let's get the number box out again. | es: @1950 |
OK, now we're back at the situation @1965 where ... [tone] we can't change the delay time without making the noises. So, what if I wanted to change the delay time, | es: @1965 |
@1980 but not have the bad noise? | es: @1980 |
The answer is we mute the sound and then once the sound is good and muted we change the delay time and then we unmute the sound. @1995 So to do that we're going to have to multiply it by a ramp generator in order to mute it. | es: @1995 |
@2010 (My disk drive is still is still churning after that five million point delay line. My computer has indigestion right now.) Oh right. | es: @2010 |
@2025 And now this line of course we know how to turn it off. We throw it a message that says go to zero and take some amount of time. I don't know how long--maybe 10 milliseconds. That again is a value that you're going to have to find | es: @2025 |
@2040 depending on what kind of signal you're throwing in. And then we have a nice thing to turn it on. OK. This is an on/off switch. See if this works so far. So there is sound. [sound] OK. | es: @2040 |
@2055 Idiot's delight right now. | es: @2055 |
So what we're going to do is every time this thing changes, we want to first say "zero" and then change it and then when we change it @2070 at the same time after its quiet we can then ramp the amplitude back up. So what will happen is after a delay of a second... So let's get a nice delay object out. Sorry | es: @2070 |
@2085 after a delay of... | es: @2085 |
OK. So what I want to do is I want to make does this: [sound] It mutes the thing, changes the delay time to whatever we want and then turns it back on. So @2100 whenever the number comes in we're not going to change the delay time at all right away. What we're going to do is we're going to...let's see... we're going to send a...just... | es: @2100 |
@2115 Sorry this is... I'm going to be a little bit pedantic here. | es: @2115 |
I'm going to send a bang off to this nice shut-up button. Now I have this wonderful network @2130 which has the property that when I try to change the delay time it just mutes it and it stays off forever, right? We don't have everything built yet. And then after a delay of ten... So we'll bang this delay of ten and then we'll turn it back on. | es: @2130 |
@2145 And now we have a wonderful patch that whenever we change the delay time it just turns the thing off and turns it back on which you can hear a little bit. [sound] | es: @2145 |
@2160 The only problem with this is that -- first off I can't really ramp very nicely with it because it has to mute and unmute it very, very quickly. It sounds ugly. But I can still change it like that. | es: @2160 |
@2175 It's yea OK. As long as I'm putting something complicated through we get away with that. But it didn't actually change the delay time. Nobody's talking to the delread and of course I can't just send the delay time in right away | es: @2175 |
@2190 because at the time I'm sending the delay in, it hasn't succeeded in muting yet. It sent this message to start muting but I really need this thing to come in ten milliseconds later after this thing has shut up. | es: @2190 |
So let's @2205 take the signal and store it and then when the del 10 is done is when we send the new value of the signal delay. | es: @2205 |
@2220 All right this is going to need a little bit of cleaning up before it is really powerful. But now we have something where we can change the delay time and it's smooth. | es: @2220 |
@2235 So now for instance and to prove you that the delay time is actually changing, I can now use it as real time thing: [sound] So now you hear this nice delay. And now the delay goes away. | es: @2235 |
@2250 And now the delay becomes a second. Oops. And now the delay is a second. And now it's very short. So now I can change delay times on my voice, and it won't make that ugly sound. | es: @2250 |
@2265 All right; so this is a good thing. This is a good way if you want to make yourself a delay effect to be able to change a delay time and not have people complain at you because it sounded ugly. | es: @2265 |
Now to go back: @2280 The previous patch, I actually got the variable delay object out and it's showing off Doppler shift. And then I was saying, "Oh it would be cool if you could use that Doppler shift thing to make a pitch shifter." That's to say a thing where I could sing in at some pitch now it becomes | es: @2280 |
@2295 a continuous singing at other pitch without having a delay time that was gradually either growing or shrinking. | es: @2295 |
So let's apply this principle to a variable delay line. @2310 So the variable delay is changing all the time. You can change the delay just fine without having badness. But the thing that causes badness is when you cause the delay time to change discontinuously, which you had to do periodically. | es: @2310 |
So let's see. @2325 Now what I need next is actually closer to this patch from the previous one. So I'll start with this one. OK now we're going to make a | es: @2325 |
@2340 proto pitch shifter. ... That's number four now. | es: @2340 |
@2355 We're being productive today. We might actually get up to five or six patches. <<Saving "3.01/4.proto-pitch-shifter.pd">> | es: @2355 |
OK so now what we're going to do is go back to variable-delay-land. That means we need to drive it with a nice line~ object. @2370 So this is no longer just going to bash a discontinuously changing value into a float. Instead we have a nice line~. And now what we're going to do... | es: @2370 |
@2385 The patch that I'm now going to make is for pedagogical purposes. I would not be likely to use this. I'm going to show you how to do this better. So what I have to tell you is I'm going to do something deliberately sort of OK, but this | es: @2385 |
@2400 is going to be replaced by something substantially better in a few minutes, OK. So, the not quite so great thing is this: We have this nice message box, for instance I had zero and I grew up to 333 in a second. | es: @2400 |
@2415 And this had the property that... so I'm just going to check this and make sure I'm still where I was. [sounds] So here we are. Now we have a thing that takes my words and bashes it | es: @2415 |
@2430 down a fifth, musical fifth. Oh, yeah. I have to remember by the way to tell you how to compute these numbers to do your own intervals because not every interval is a fifth, right? | es: @2430 |
And now what we're going do is, well everything was cool except that going back to the sinusoid again to demonstrate this. @2445 You hear a click every time you -- well you might hear a click depending on the phase -- every time you reset this thing. So that's bad, | es: @2445 |
@2460 but of course we now know what to do about that which is we just... OK shut this off while we're... We just send off a bang to the... | es: @2460 |
@2475 that's bad because that's going to make two bangs. Let's give ourselves a nice button. Yeah. | es: @2475 |
@2490 The button is going to mute the thing and it's going to set this new... No! It's not going to do that. It's going to happen after a delay, isn't it? Then | es: @2490 |
@2505 the button is going to set the delay off. So now what's happening is... Let's see if I can make this readable. ... It's not great. OK. Whenever I press the button what happens | es: @2505 |
@2520 immediately is the line~ gets muted and then what happens after 10 milliseconds is I restart this process of changing the delay line continuously and I unmute the output. | es: @2520 |
@2535 Now I have a bad but partly serviceable pitch shifter, which can shift us down a nice musical fifth. Except of course if I forget | es: @2535 |
@2550 to keep whacking the button eventually it goes back up. By the way, no matter what I put in here if I keep going in this way I will never do anything other than... Well, is this true? I can | es: @2550 |
@2565 transpose down in a clear way and get all sorts of intervals transposed downward. | es: @2565 |
Oh yeah, how about 200 then. @2580 There's a musical perfect third for you, want it? How would I make the thing transpose up? You can't go down from zero, so rather than do this you would start | es: @2580 |
@2595 at some value like 200 and ramp down to zero over time, so that the length of the delay line is decreasing instead of increasing. | es: @2595 |
And then we get... Anyone want to guess what interval we're going to get now? -- @2610 A perfect minor third up. OK. So, why did it go up? The delay time decreased -- it decreased from 200 down to zero, | es: @2610 |
@2625 so over the period of one second we quit hearing something that was 200 milliseconds old and gradually got to where we were hearing real time, at a delay zero. So we heard 1.2 seconds worth of sinusoid | es: @2625 |
@2640 in a mere one second of time which means we heard it at five... no, at six fifths at one and a fifth times the rate. | es: @2640 |
That's to say it's 1.2 seconds divided by 1 second worth of sinusoid @2655 that we heard over one second of time. We heard it 1.2/1 times too fast -- 1.2 times normal speed. In general, | es: @2655 |
@2670 if this amount of time is one second, then the amount that we hear is this minus this plus one... oh, plus one second. So this is actually a fifth of a second. So | es: @2670 |
@2685 in units, what we get is... the transposition is one plus, OK. One, because time is always moving forward, so if you do nothing at all | es: @2685 |
@2700 then you get as much out as you put in. | es: @2700 |
So it's one plus this minus this -- is the ratio by which the frequency went up. And if you give these @2715 three things names then you can make a formula. So, if the delay time is increasing, the pitch is going down if the delay time is decreasing the pitch is going up. | es: @2715 |
By the way everyone @2730 will immediately use the word "Doppler" to describe this. This is a sort of Doppler shift. This is the Doppler shift that corresponds to, not the one that you'd normally hear which is you're sitting on a park bench and an ambulance goes by. That's the source moving and you are the listener | es: @2730 |
@2745 and the delay time is the air. Simply the air carrying the sound from the signal source to you. | es: @2745 |
A better metaphor here is there's something emitting a sound that's fixed and you're moving -- because you're changing the delay @2760 of which you're listening to it. But at the same time that's Doppler shift. You can hear it if you're running around on a bicycle or something like that and listen to someone who's stationary blowing a car horn, however ... that doesn't happen as often as you're hearing | es: @2760 |
@2775 the horn stationary instead. | es: @2775 |
OK. But it's Doppler shift anyway. And this is the formula for Doppler shift too if you want. Should I tell you this? You can even have a Doppler shift that is @2790 so intense that it turns the sound around backwards. So imagine that someone was sitting here talking and what they were saying was so unpleasant that you were running away from that person at twice the speed of sound. | es: @2790 |
@2805 You all know the speed of sound, right. It's well, it's a foot a millisecond. 1,000 feet per second, roughly speaking. So, you're high-tailing it 2,000 feet per second away from your professor. And as a result, you're hearing everything that the professor is saying, backwards. | es: @2805 |
@2820 Because, you're actually ... the sound is sitting there in the air waiting for you to hear it, but you're traveling at twice the speed of the sound, so you're hearing the sound as it's getting further and further away, further and further down the delay line. Oh, we can even do that. Watch. | es: @2820 |
I can make @2835 this delay line do that, by saying, we're going to start with no delay at all, and then we're going to run two seconds of time away in one second. Let's see if I can do this. And then I say anything at all, like | es: @2835 |
@2850 "fruitcake." ... And nothing comes out. [sound] ... Fruitcake, and it didn't work, oh, I didn't put the comma in. Also, this is terrible, | es: @2850 |
@2865 I'm making all sorts of distortion, because I'm being sloppy about the sound OK now let's see. I hear something. Test. Test. What? [Echo] Oh, | es: @2865 |
@2880 I have speak before you start running away from me. ... | es: @2880 |
So, you're going to hear it forward then backward, like this. "Jelly beans." @2895 Oh, it didn't work. What's going on? Jelly beans. Jelly beans. ... "I'm changing my voice to go around backwards." | es: @2895 |
Oh, and that was feedback -- ignore that. @2910 So, that is a transposition factor of -1. In other words, I'm running the sound around backward by changing ... by making the delay line get bigger -- faster than | es: @2910 |
@2925 time is even moving. ... So, that was a slight digression. And so anyway, let's go back to this thing. | es: @2925 |
@2940 To make a very cheap pitch shifter, we would say metronome ... I don't know, chose some number of times a second we're going to do this. Maybe 10 times a second. ... | es: @2940 |
@2955 And now, everything that I do will be transposed. [sound] | es: @2955 |
@2970 OK. Transposer, pitch shifter. Very nice. This is kind of a bad pitch shifter, although it's working. ... Let's make | es: @2970 |
@2985 a slightly better pitch shifter by ... So, it's a little bad that the thing is actually dropping out completely. But what you | es: @2985 |
@3000 might wish to do is have two delay lines and be cross-fading them, so that the sound is continuously working, even when you wish be changing the delay line. | es: @3000 |
And you can do that, but maybe it would be better @3015 before we do that to prepare the example by changing the way we're doing this anyway ... in the following way. So, let's do a "Save As." | es: @3015 |
I'm going to switch now, instead of using a line~, to using @3030 a phasor to drive the delay time. Oh, yeah. And why? ... | es: @3030 |
@3045 you're going to be able to figure out why immediately when I show it to you. ... I'm going to quit doing this for now, because this is not really going to work for us. | es: @3045 |
@3060 So, for right now, I'm just going to cheat and say multiply by 1. That's to remind me that later on I'm going want to control the amplitude again. But meanwhile, I'm just going to drive the line~ with a nice phasor. | es: @3060 |
@3075 And it's going to have some nice frequency going in. | es: @3075 |
And if I just throw this right in, (I didn't even have a line~.) If we just throw this right in, it's going to vary between 0 and 1, which is going to be interpreted as @3090 milliseconds down here, which is not so great. So, we're going to have to change the range to something reasonable. And I will make that be a message box, too. <<actually connects a number box>>. And | es: @3090 |
@3105 at this point, I should say that I don't actually know what order this delwrite~, and this delread~ are occurring in. | es: @3105 |
@3120 It would be appropriate at this point to add a couple of milliseconds because there could be a 64 sample delay engendered by the fact that this delwrite~ might happen before this delread~. | es: @3120 |
There's other @3135 Pd lore that I'm going to avoid telling you about, how to force that into happening right. But now, I'm just going to add a nice delay, which ideally should be at least a couple of milliseconds. Maybe I'll take that away later and see if it hurts us. | es: @3135 |
@3150 And now, let's see, we'll go once a second, and we'll have it vary by, let's say, 200 milliseconds, and then we will throw a nice sinusoid in there, | es: @3150 |
@3165 which we listen to, and out comes:[sound] you all know it. And out comes, you all know it. So, it's going to be a if I got it right, [sound] down a minor, a major third. Tada. Ooh! | es: @3165 |
@3180 Bad example! This example, this was too good. | es: @3180 |
I can change the delay discontinuously by one second, and because there @3195 are exactly 440 cycles in this thing in a second I got away without any discontinuities at all. Don't try this at home -- Or let me show you what could go wrong if you did. Let's try 440 and a half. | es: @3195 |
@3210 Everything's going great. We're transposing, but there's a discontinuity every second when this phasor resets. | es: @3210 |
OK, so I'll go back to 440 @3225 to pretend it's working nice. And now I have a nice continuous control over the pitch shift. | es: @3225 |
@3240 And, in fact, the shift of the pitch I can compute, I think. ... so this number is really a fifth if it's in seconds -- it's 200 milliseconds. (Oh, this is interpreting its input as milliseconds.) So what's | es: @3240 |
@3255 happening now is: So the phasor is happening in an amount of time, which is one over this, and it's happening and it's changing by this amount every time. | es: @3255 |
So @3270 the transposition that comes out ... The transposition factor is one if there's nothing happening at all. That's to say, when the phasor isn't moving at all. But if the phasor is moving the thing | es: @3270 |
@3285 is being increased by 1 ... (Sorry, that's the 1 which is just oneness because time is passing.) | es: @3285 |
1 minus the product of the phasor frequency and the phasor amplitude. So in this case @3300 it's one minus one fifth because this is in Hertz and this is in milliseconds, so this is really 0.2, so this is one times 0.2, which is one fifth, and one minus one fifth is four fifths, which is down | es: @3300 |
@3315 a major third. OK. Now you know how to compute, no matter what this is, what it should do. Let's see: [sound] | es: @3315 |
So this is now one minus two fifths, which is three fifths, which is a major sixth. @3330 Oh yeah. Let's play the original here. OK. | es: @3330 |
@3345 All right? Yeah. So, transposition equals 1 minus product of phasor frequency and phasor amplitude. | es: @3345 |
@3360 And then you can work that backward any way you want. Now the next thing is ... let's get rid of the clicks. Oh, you don't hear the clicks because I fudged it here, but now if I change either this frequency or this. | es: @3360 |
@3375 Oh, yeah. Oh, minus three means the phasor's phasing backwards, of course. If I change this, I might be | es: @3375 |
@3390 changing the delay time by an amount that's not an integer number of cycles and as a result I'm getting clicks, which is kind of bad. So I do have a thing that can continuously change frequency -- | es: @3390 |
@3405 But it's clicking like all get-out and that's not something that I want. | es: @3405 |
Another thing about this is, of course, since the delay is ranging between zero and 121 or whatever this range is, there's going to be a delay @3420 between when you do something and when you hear it, which could be a problem. For instance, when I start loading my voice in or actually click into it. There's a delay there. So I've got the transposition OK, but I've | es: @3420 |
@3435 got delays as well. | es: @3435 |
The delay's actually varying between zero and 121 milliseconds. So that's OK. We can make this number be as small as we want. Let's make it 10 milliseconds. @3450 So here's the sinusoid again to test this. So now by the time I give it enough frequency to give it a decent transposition I've had to drive this value up | es: @3450 |
@3465 high because this value is small and the transposition is controlled by this product. | es: @3465 |
As a result, I have more and more problems, more and more discontinuities per second. So there's going to be a trade off @3480 in pitch shifting between the size of the delay I'm willing to tolerate and the speed of changing it that I'm willing to tolerate. In fact, it's going to become even clearer that this is a trade off | es: @3480 |
@3495 when I fix it so that it doesn't click anymore. | es: @3495 |
So to fix it so it doesn't click anymore -- and this I think has already happened... Ehat's a good way to take a nice phasor and turn it into a signal that will @3510 shut up right when the phasor jumps from 1 back down to 0, or in this case jumps from zero to one because I'm running it backwards? There are a lot of possible answers to that. | es: @3510 |
One thing is you can design a parabola that goes from @3525 zero up and then back down to zero as you go from 0 to 1. The thing that people do most often -- that I see, anyway -- is they use just the best quadrant they can | es: @3525 |
@3540 find of the nice cosine function. "Quadrant"'s the wrong word. So cosine, if you feed it zero you get one out. This is cosine of (2 pi of its input), or cosine of its input, in cycles. | es: @3540 |
@3555 So from minus a quarter to positive a quarter the cosine goes from zero back down to zero. That's one half cycle of the cosine and it's the one half cycle that's positive. There's another half cycle that's negative that comes right after that or before it. | es: @3555 |
@3570 So how do I get that nice cycle out of this phasor, or half cycle out of this phasor? | es: @3570 |
This is going from zero to one and I want to go from minus a quarter to a quarter. So, in general, if you want to change the range of something first you decide how big you want the range to be and multiply it by that: @3585 So I want the range to be a half big because it has to reach from minus a quarter to plus a quarter and then I have to subtract a quarter to get it in the right place. Let me | es: @3585 |
@3600 say that more clearly: So, this varies from zero to one. Now it varies from zero to a half. And, now it varies from zero minus a quarter to a half minus a quarter -- So, it goes from minus | es: @3600 |
@3615 a quarter to plus a quarter. Now we just run this thing through it, and then we just multiply. Ooh. And, it doesn't let us connect, because Pd is cool and that times ones said, "I want control inputs there" -- which I don't any more. OK. | es: @3615 |
@3630 Let's go back to something reasonable: 10th of a second; a Hertz. Here's the sound going in. [tone plays] And, here's the sound going out. [different tone plays] | es: @3630 |
@3645 Pretty good. Hmm, would be pretty good if it weren't changing its amplitude all the time. Well, | es: @3645 |
@3660 there are ways of dealing with this. Certainly the way that's easiest to describe to deal with this is the following: | es: @3660 |
Let's see. I'm going to take these things and get @3675 them out here. You'll see why in a second. Let's make another one of these things, and let's make it run out of phase from this one. So that, whenever this one is quiet, the other one is loud and vice versa.[tones playing] | es: @3675 |
Miller: @3690 So, how do you do that? OK, so this is all good review stuff. How do you make a phasor that's a half cycle out from this phasor? This goes from zero to one, | es: @3690 |
@3705 so we could always say, add a half. That means we go from a half up to one and a half. And, then if we wrap~ that... | es: @3705 |
@3720 Then if we say "wrap~", then... This warrants explanation: | es: @3720 |
So, this goes from zero to @3735 one. This goes from a half to one and a half. This wrap~ leaves the part that goes from a half up to one, but then the part that goes from one up to one and a half becomes a straight line segment that goes from zero to a half. | es: @3735 |
@3750 Draw this out on a piece of paper if you don't believe me, but the result is just line segments, the same as this. But, this thing changes value discontinuously whenever this thing crosses a half, because that's when this crosses one, and that's when the wrap~ | es: @3750 |
@3765 changes its mind about what integer to subtract. | es: @3765 |
So now, we've got ourselves a nice out of phase phasor. And, we can use our out of phase phasor. (Let's see. I'll need to be compact here. Maybe I @3780 just don't have to be so compact. Let's move this stuff out of the way somehow. Don't need that any more, move this whole thing over. Now do I have room | es: @3780 |
@3795 to have another one of these? Not quite yet.) | es: @3795 |
So, I'm just going to take this whole thing, including the multiplier, and make another copy of it running out of phase. @3810 And, I'm going to reuse these number boxes, like this. So that I'm multiplying and adding by the same numbers as before. | es: @3810 |
@3825 I could clean this up, but don't know how. The right thing to do would be to do this and move things around, but maybe this is clearer for now. | es: @3825 |
OK. So, now we have two @3840 transposers and one of them is jumping when the other one is being stable. The jumping one, of course, has been faded out in order to allow it to jump. So, one is always fading in while the other is fading out. | es: @3840 |
@3855 Oh, yes. In listening to just the first one to start with: [tone sounds] | es: @3855 |
It's doing that for us. Let's try to make them faster. On the other one, if we listen to it alone, is doing something similar... [tones playing] @3870 Whoops -- except I have to repeat these things because I didn't put them in the objects yet. And now, if you add them together... | es: @3870 |
@3885 We get something that's not quite as variable in time. It's not perfect, but it's a little bit better. And now, again, we can continuously vary the pitch that's coming out. | es: @3885 |
@3900 We can also drop the amount that it's changing the delay by. Of course, in that case, we have to move the phasor faster in order to get | es: @3900 |
@3915 a fixed transposition. OK, so let's go back to listening to the voice: So, this is close to the classic pitch shifting algorithm. | es: @3915 |
@3930 So, now we're shifting pitch and we have decently small delay and a reasonable transposition. | es: @3930 |
@3945 And, we can go up, like this, and so on, like that. And we can make silly sounds by transposing up an octave or two, which I won't get into. It will sound like a chipmunk. | es: @3945 |
So, this is a classic kind of a patch @3960 you could call a "pitch shifter." People frequently call these harmonizers, but the word "harmonizer" is a brand name, so call it a "pitch shifter" if you want to be generic. | es: @3960 |
Let me just show you @3975 where this shows up in the help browser because you might care how to compute appropriate numbers to stick in the phasor and the delay line yourselves. Of course, I did all that | es: @3975 |
@3990 work, and if I were a good didactic person I would make you all do this work too. But instead I'm just going to show you how you find the answer. You go down to the delay examples and you find the... there's a delay | es: @3990 |
@4005 G09.pitchshift. And just get this patch out. And this is a fabulous patch which... <<Loading <<"audio.examples/G09.pitchshift.pd">> -- Well anyways, I think it's fabulous. Which plays... [sound plays] | es: @4005 |
@4020 plays a nice bell. [sound] | es: @4020 |
That's Johnathan Harvey's bell sound there -- And lets you transpose it. @4035 Any number of well OK... it's computed in half tones. OK now, let's turn this thing off | es: @4035 |
@4050 so I can talk about it. OK. So here, the only thing that I've added to what I just showed you, here's the phasor and and the wrap~ and all the good stuff that you just saw. The only... Yeah, I did exactly the same thing. | es: @4050 |
@4065 Oh, I did this in the opposite order, sorry. Work it out; it's the same deal. The thing that I changed here was that I actually went to the trouble of figuring out what frequency you would give this phasor | es: @4065 |
@4080 in order to get a transposition that you would specify in half tones -- which is the western unit for pitch shift. So here, for instance, if I say I want to go up seven half tones, | es: @4080 |
@4095 that means I want to play it 1.5 times, well almost 1.5 times the normal speed. | es: @4095 |
So a ratio of a fifth, a musical fifth is seven half tones. So C, @4110 C#, D, D sharp, E, F, F sharp, G -- seven -- seven half tones. That's this 7 right here and that is a factor of roughly one and a half and how do you figure out what | es: @4110 |
@4125 you should feed the phasor? Well, you're going to multiply the phasor by some number which is here called the "window," that's this number here. | es: @4125 |
@4140 Let's see if I can show it to you in the old patch. | es: @4140 |
Here's a help browser, go over here. So, I multiplied the phasor by this number which is the range of delay change and @4155 once the units were fixed, 1 minus the product of this and this was the transposition as a factor. So, if I give you the transposition as a factor then you can do that algebra backward and that will tell you what | es: @4155 |
@4170 you should feed the phasor as a frequency if you already also know this delay change -- which here I'm calling the window size in milliseconds. | es: @4170 |
So, if I set this to a 100 milliseconds say, that's a tenth of a second, @4185 then this number here is a tenth. Here I'm correcting to seconds from milliseconds, so here's the delay time in seconds... This is the delay change in seconds. | es: @4185 |
@4200 And if I wanted to change by this factor that means I have to add in frequency .498 to it, so I subtract one to get that by .498. And then | es: @4200 |
@4215 because rising delay times transpose down, I have to multiply by -1, or to put new way, I have to subtract what I'm going to get here to get the transposition. So I'm going to | es: @4215 |
@4230 need to run the phasor backwards to transpose up. | es: @4230 |
So, in fact I have to transpose it by this number times 10 because this number is divided by this number in seconds. @4245 And what's this? This is taking half tones and changing it into a factor and this number is the logarithm (to the base 2) of one twelfth. | es: @4245 |
@4260 You can compute that; you can pull out your pocket calculator -- if anyone still has one of those -- to find that out for sure. I didn't do this in my head, I pulled out a calculator to get that number. | es: @4260 |
So this now is one of those @4275 that I just showed but packaged and engineered in such a way that you can get any desired transposition which you specify in half tones. And as before, there is this wonderful trade off: | es: @4275 |
@4290 Let's listen to it. [sounds begin] If I want a fixed... let's see, you can't change. (I'm sorry. I'm going to just turn DSP on and off here to control this | es: @4290 |
@4305 because I can't have the volume control and these things up simultaneously.) But now, if I want to do the same thing... Oh right, when you hear this you hear a sort of... [plays sound] Well, you don't hear the real problem here. | es: @4305 |
@4320 The problem here is going to be that since there are two delay lines that are different by one half of this window size, 50 milliseconds. Everything that happens in it happens twice, 50 milliseconds apart -- which if we were putting voice through this it would be an annoying thing. | es: @4320 |
@4335 However if you try to fix that by making this delay time itself smaller, then you can watch here it has to make the thing run faster to get the same transposition. I'll make a big 20, say and then it has to multiply this | es: @4335 |
@4350 by five. And now we're getting the same transposition... [plays sound] That was interesting. | es: @4350 |
That sounds modulated @4365 because this thing is changing so quickly that this envelope is raising the amplitude of it this many times a second. That's causing amplitude modulation of sound which we hear as frequency | es: @4365 |
@4380 aliasing. -- Which I guess in the bells, since the bell is inharmonic anyway that's not such a clear example. ... | es: @4380 |
... as I can make out of my voice. Let's do that. Since after all it is computer I @4395 can tell it do anything I want to. Let's just use me instead of the bell now for a minute or two. And now let's see. We turn it on. And now you're listening to your [sound modification] professor transposed. | es: @4395 |
@4410 And now if I make a nice big window you can get a decent clean sound. [sound] "Ahhh".... Not great. But anyway it's only changing one and a half Hertz now. | es: @4410 |
@4425 So it's not terribly messed-up. [sound] "Dohhh". Still pretty messed-up. | es: @4425 |
But anyway also if I make a speech into it. Hello this is speech. You can hear that everything is replicated twice -- s twentieth @4440 of a second apart. Actually clicks are even better than speech for this. That's messed-up clicks coming through because there are two copies of every click because I had to make two of these delay lines because they are crossfading in and out in order to | es: @4440 |
@4455 cover for the fact that they're having to change discontinuously while this is going on. | es: @4455 |
So then I make this delay time smaller but then this number has to get higher and then you get another problem. This is transposition but... @4470 I don't know why I'm getting away with this. ... Well this contradicts what I'm trying to tell you. I was able to get | es: @4470 |
@4485 outrageously small delays here. | es: @4485 |
"Ohhh"..... Yeah. But it's just inharmonic now -- although you can't really hear it. You can't really hear the inharmonicity. I have to play it with an instrumental sound @4500 and I don't have an instrument handy. But this would be a problematic setting too because this number is too small which is pushing this is pushing this frequency too high to be good. | es: @4500 |
So either this number is too large or this number is too large and you will never get both of them @4515 simultaneously small with such a crazy transposition. People usually use pitch shifters with small transpositions like a half tone or a whole tone like this. And then you can get both this number and this number decently | es: @4515 |
@4530 small simultaneously like maybe this-ish. Those are almost kind of reasonable numbers to be feeding in to both of these inputs. But for larger transpositions you have to either get a ridiculous window size | es: @4530 |
@4545 which is the maximum size of the delay or a ridiculous frequency of interchange and you will get gradually more and more aliased sounds as you do this. | es: @4545 |
All right. So in the interest of @4560 time I'm going to skip over the rest of the lore of making cool things out of delay lines although there are other cool things that you can make out of delay lines. I will just mention the existence of one of them because | es: @4560 |
@4575 it's a good thing: You can make artificial reverberators out of delay lines. I do want to save this and I'm going to close that to get it out of here. | es: @4575 |
@4590 I'm going to go back and get my help browser and just go get something that shows off a nice reverberator, just so that you know it can be done. | es: @4590 |
There are library reverberators even in Pd Vanilla which you can get. @4605 But this one is the pedagogical reverberator which just shows how you make reverberations. Here's the test input again. Let's see. This patch is | es: @4605 |
@4620 designed in such a way that you make this pitch move around and it shuts up when you stop moving the thing because... well you'll see why. Now we're going to reverberate it | es: @4620 |
@4635 and we're going to hear reverberation. And reverberation sounds like this: You can guess how I might have done this. It's recirculating delay lines. | es: @4635 |
@4650 But the standard recirculating delay line has a limitation in that you either make a delay line real short and you get frequency response funniness or you make a delay line really long and then you hear | es: @4650 |
@4665 individual echoes. | es: @4665 |
Here... Let's use me again... Here you don't have that trouble so much. @4680 So now let's see: Now you have me being reverberated. But you don't so much hear... Sorry that's not going to be good. You don't so much hear individual delays -- although this is not a perfect one -- as much as you just hear | es: @4680 |
@4695 reverberation -- That is to say sound that's sticking around after the sound, like it would in a real room. And the way you do it, not to put too fine a point on it, is you have bunches of delay lines | es: @4695 |
@4710 reading and writing in a complicated network which you have to think hard about. | es: @4710 |
This is all explained in gory wonderful detail in the book why this thing works and why it's stable and how you would design it. @4725 All I'm going to do is just sort of say this exists. Go find out how to do it yourself, or if you just want reverb just say "reverb two" <<rev2~>> for instance, -- | es: @4725 |
@4740 I'll give it a nice big nonsensical argument just to make the box big. Now you get a nice reverberator with inputs to control various things about it. And there is a nice help thing on there. | es: @4740 |
This is nice abstraction which I built just for making @4755 a reverberation in case you just want a reverberation. It's there for you to use. rev1~ is experimental and strange. rev3~ is higher quality than rev2~. | es: @4755 |
@4770 There's a collection of three reverberators that you can choose from. And get the help window and check them out if you want to find out how to use them. And the theory is in the book; and I'm going to skip it because we have many other things to | es: @4770 |
@4785 find out about. | es: @4785 |
... We have many other things to deal with than this and it's now time to stop. Next time I have to start talking about filters, which are the other point of view on delay lines where you in fact @4800 might find yourself designing delay lines with a specific frequency response in mind. | es: @4800 |