 So this is actually the first time for me that the GitHub Cop Pilot gave a better response than GPT-4. So over here we try to normalize the power with each frequency band because this display can see this number showing absolute values. We want them all to be saved between 0 and 1. By the way this is the only case where I actually get a different note before I was getting C3, F3, B3, E4 and for this was at 5 seconds of A, G. I get the C sharp instead of C. That's not good enough. We want way more variability in the notes. That's what we will be addressing today. GPT-4 was suggesting doing it manually instead of using math mean marks functions only when prompted to use math mean marks. It's producing the same response as the GitHub Cop Pilot. Check if GitHub Cop Pilot made any other changes to have this normalize power. It's making other changes as well. That's just the structure of it, isn't it? And we can insert it into the code. Yes, we calculate mean marks straight from the array and let's comment this out quickly. Let's try it out. And the same notes played. Check if that code is actually working and let's console log it. Don't need this comment. Console log in max power. What is it? 6C? Yeah, it's doing it for each band, which is clear. Okay, some errors as well. That doesn't look right. It's doing it for the whole spectrum. Let me turn this off. Right, this is better. So we'll have a 12.96 and then the next power, yeah, will be just under 12 in the whole spectrum turned off by default. We can do it in HTML. We'll do this with GitHub Cop Pilot. Yeah, this switch. Can explain this for us quickly. I assume that's the default value. How to change default? Just remove the checked attribute. Let's try this. Yeah, control five. Check the values. Yeah, mean power is around zero. Max power 396, that makes sense. Then we have 196. Yep, that makes sense. Get some errors as well. Frequency undefined in JavaScript, line 86. All right, so this duration is one by default. I think we're setting it at 2.5. A volume should be fine. Getting an invalid frequency. That's interesting. What is the frequency? It's just missing. Normalize powers, map noise. We get the nodes. So the nodes to frequency conversion. A potential doesn't work. Yeah, this node to frequency conversion might be producing something funny. And let's call this Frick, then return Frick. That's right. We want to monitor Frick, log a console that can generate a, will return node and the frequency component. Let's do that. See where the error is coming from. Node C3, that's a different error. Frequency, P3, frequency, 4, frequency, getting nodes and frequency conversion seem to work fine. Then getting something undefined. It's a bit odd. So technical issue I can hear the nodes being played. So what that error is coming from? Well, I know where it's coming from. You know why I'm getting it. It's currently converging the nodes to frequencies. So that's happening. I thought I'm already doing this. And the error went away. Yeah, I was getting the same nodes. I'm sure for channel 4 it's not working, but it's just to check. Delta should be in 155 or something. Power. Yeah, it's this one here, 163. 163 and the second one is 31. It's that one there. So let's let's see it. Just scroller. Always get the same nodes playing, which is not great. App nodes, always the same. Even after automatically varying a mean and max power, use some help. With this one, remain the same after normalization region. It suggests that the issue might not be with the normalization process, but rather with the how EEG data is being interpreted and all mapped to musical nodes. Review the EEG variability. Yes, it does vary quite a bit. Control F5. And varying the volume. So we vary the volume we've amplitude there. That kind of makes sense. So there is enough variability. Check the function. And let's explain it with GitHub co-pilot. What to do to say. Function is responsible for converting EEG data fashion. It begins by normalizing power. Function maps each normalized power to musical nodes using map power node. Mapping is done within the specific range of nodes for each type of brain wave. For example, Delta waves are mapped to nodes between C3 and E3. Yes, that's normalization is not great enough, is it? Yes, if we're always getting C3, F3, B3, 4, it's always in the low side of the range. So there's not enough variability. But we're already doing this. But we're already doing a look rhythmic and log. No, not that type of log should be math. Log is scale. It's not cool. I'm pretty sure we had something. So we're not looking at the Python script anymore. And we're trying to do as much as possible in JavaScript. Yeah, I thought we already have a nonlinear mapping, but we have the normalized powers. We're already doing that. I don't know what you're talking about. Map power to node. Yeah, this bit has to generate this function. This one would not be using get node range to then get node index. Every time you ask it something about having another function, do we have to have another function? Can we just modify the existing ones? It's passing integer. Already have it then get node range. Change the code to enhance sensitivity. Something went wrong. Let's try this one and get the GitHub co-pilot working as well. It's not generating anything. Okay, now this is a cheat. It's common previous function out. So we're explaining the range of the nodes alpha, beta, you do log, map nodes, get them to a log there. So it's the same nodes still, 34. Yeah, just doing the first, the first nodes. There's some sort of perceived warning change, but that's actually not changing. You're getting the same nodes. So we tried increasing the range. We actually long that variability. Do we have a console? We do have a console. No, we had one that we manually saved. But we do that. I get it probably. Those work of K, remove those logs for now. Yes, this too, we expect much normalize powers. And the normalize powers are super low one zero six. Yeah, so there's not much variability in the normalize powers. It's scaling from zero to one. It seems like obviously the problem is that the change in normalize powers is too small. So this function is currently not being used. Why? Nothing to hallucinate because it suggests that this change, that also means we have to revet to the previous version of map e.g. data to nodes, something seems to have gone wrong. So we're revet it back. But the range, right, this is increasing the range as well as it. Okay, we're doing the square root already elsewhere. We're doing it already. Can expand the range here though. C3, E6, E3, E6, 3, 6. Okay, so this is HL4. This is no seizure. This is the seizure. And the nodes, yeah, almost the same. So yeah, so the variability between the nodes is still too small to our liking. Here it varied quite a bit. Yeah, we have those edge problems as well when you get to the end. Just try quickly. Yeah, that's a lot of noise. Maybe it sounds like music to you. I don't know. Let me know. We're doing a non-linear mapping. This range is not large enough. I don't know anything about music. So it's hard for me to tell how large this range is. Yeah, I'm pretty sure we don't have enough variability in the power, which is odd considering there is quite a bit of variability there. Yeah, I think I know what the problem might be. The power, yeah, should be probably something like 0 to 3000 instead of automated. What does that mean? Why are we doing this again? Let me just place this with it, rewrite the function or explain it. This is all very odd. And it obviously didn't work because it's returning all 0.5s. I was actually generating some noise. I'll return the previous one. We'll just try something more simple. Instead of this to just 0, because that should be 0, about 3000. Right, getting a bit more variability there. And we know that it's about 4 or 5. It's a channel 7. So this should be seizure. This should be no seizure. The noise is actually quite different. So yeah, we're having a problem with that last value there. What does it sound on a different channel? Yeah, that seizure really sounded different. Yeah, so seizure has this lower frequencies. So it was seizure. No seizure. Yeah, I don't feel getting much out of it. Does it sound like music to you? Probably highly unlikely. I don't know. It's a quite subjective music perception, isn't it? Yeah, that didn't work. Okay, that updated function that you generated did not work. It's giving a lot of errors. Now the range now seemed to be better. Getting variable nodes when scrolling through the EEG data. Can we make sure we have a non-linear mapping? Should it work correctly without errors? Yeah, of course. What's it suggesting? Is this another function? No, I already have that suggesting changing it back to... I don't think this will work. Give it a quick go. Let's do Shadow 5. No, it doesn't work. Normalize power. Revet, revet. Check that it's working again. We'll make any changes. Say which channel do you like? Actually quite different. Do you have something up? Yes, we are checking that it is correct or incorrect. I mean, it's highly subjective in this case. So this is how the whole things sound. Now the question is what your window size is. Make it very small. Say one second. Does it sound like music? My second favorite thing is having issue with this scroll. It's too jumpy. Scroll is too jumpy from html scroll, meanmax step. Let's make this step one. Yeah, let's make it two. Sorry for that. Strive step of two. Can you hear this? Horrible. Like when the nodes are transitioning between one another. Yeah, the duration. This duration default should be say 0.5 play frequency, step volume, next duration 0.1. Yeah, it's when the transition is not great. Transition is not great. Hold the input there. Just play the frequency. Same here. And in default volume should be good. Duration 0.1. Yes, it's trying to, GPT4 is trying to change the normalized power function that doesn't work. On linear mapping in the map power to node. Yes, we could use instead of square root, can use a power using exponential function or node index when it transforms power. Should have said that this is missing or it doesn't. It used to work better. As the transition between nodes is really bad, that's something to fix. So just keep playing until it's changed. Yeah, maybe that's what we can try next time. Just send the prompt for the duration of the node being played. Can we make it so it continuously plays until the scroller is changed again. So essentially when we load the page, nothing happens. When we start scrolling, the node is played until we move the scroller again. Yeah, that sounds good. But why do I have a feeling this code would not work? Still in development, but we, as you can tell, it's doing something kind of useful, which is loading this EEG that has a seizure in it, epileptic seizure. This is pure EEG, like the highest quality you can get. It's from an implant, from 16 implanted cells, implanted electrodes sitting on top of the brain, eight on the left, eight on the right. Now we want to, this tool allows you to do the noising and other things, but there's another feature we wanted to play sound, which it does. We haven't published it yet. So when you load the page, by the way, it won't show you the whole spectrum because we're taking, essentially turning power in each frequency band, delta, theta, alpha, beta into a corresponding musical node. So you select your channel, scroll through the stuff, and then write in the comments if this sounds like music to you, or if you like it or not. If you don't like it, you have to make a suggestion as to how to improve it. You can change your window size and the like. Next time we'll be trying to actually make it play continuously until you move the scroller again. So loading the page doesn't play anything. It's actually not allowed. The browser won't let us play anything. And select your channel to start playing. I'm gonna make it so it keeps playing until you move the scroller again. And then we'll play the new four nodes. We have an event, obviously, for the scroller input over here. Yes, that's the same. And then we're changing the play frequency function, this function, still have volume and duration as an input Y. Global oscillator. Current oscillator is a global variable that keeps track of the currently playing sound. In play frequency, before starting a new sound, the existing sound is stopped if current oscillator is not null. The file scroller event listener stops the currently playing sound and starts a new one based on the scroller's position. With this setup, when you load the page, no sound will play until you start scrolling. Once you scroll, the sound for the corresponding position will start playing and will continue to play until you scroll again. At which point the sound will change. Okay, we'll continue this next time. Bye for now.