 Still, on this EEG2 musical version, can I get stuck with this one? Sending like too many requests when scrolling, which is a bit annoying. Now, the idea is that I want to convert this EEG into music. It should be pretty straightforward. Maybe not. It depends. So you look at it, and this becomes a bit too slow. Yeah, it's the seizure there. Checking our CPU is in performance mode. That should be fine. There's a problem with edges, edge conditions on that thing. Essentially, it do not work. Now, the whole thing is we also have this test HTML. It just takes a frequency and generates a sine wave. Sounds like that. Sorry if it was too loud. Essentially, what we want to do now is combine the two. So we want to extract the frequency from here for a certain time window and translate it into a sinusoid and keep playing it. Yeah, we also want something interactive. So when you change the position within the file or window size, the algorithm will change as well. So it feels like you are generating music. So this code is working fine, playing sine wave in a browser. Now I want to, instead of having this frequency component there, frequency value, I want to extract it from the EEG first and then play the sound as we go. Probably eventually get rid of this button. So it's more interactive. Don't need the button. So how to do it? EEG is from an application. It's this one here. It's also not greatly responsive. Yeah, once something more responsive and hopefully it will appear on the side sometime soon, soonish. I'm thinking should we use this one? Yeah, I'm thinking starting from scratch. No, it's before we start from scratch and get very complicated, too complicated. It might actually go for this one and then remove the spectrogram and replace it with audio generation. How does that sound? The other way, third way. So first one will just continue from where we left off. Second way is taking this and restructuring, removing the spectrogram and adding audio generation options. The third way will be starting off going with this code here, an actual sound generator. Didn't realize how simple this was because before we were trying to use MIDI, Web MIDI if it's a JavaScript but apparently you don't need it. This structure of this thing became rather too complicated. Question if this one can be made a bit faster as well. I don't know, there's this lag when I actually click on the screen to when the response, to when the chart is changing and they're changing in a different manner as well. The spectrogram is more, just a bit more responsive. Actually, maybe not. Yeah, now I'm not clicking anything, it's still going. Why do I have 7% dropped frames? This is actually happening when I'm using the tool. So that's not cool. Yeah, when I'm, because it's affecting my live stream. I'm doing the live stream of the same server. Yeah, you can see more frames are being dropped. It's not good. It's using too much data. I thought this data meant to be loaded already. Yeah, we have to change this to actually not take effect unless you release the mouse. So if you scroll through that like crazy, it would not affect anything. Yeah, similar to those. The CGJS should be fast scroller. You can run it locally. Using this up by, it's much quicker on a local server. It's kind of obvious, but yeah, why did one is not doing anything? Yeah, I should have been doing everything on a local server. That's not affecting my internet connection. Okay, I literally don't know why we have those twice. Each one of them has its own problems. Need to then mix and match certain things for it to work better. Anyway, we don't need all the MIDI stuff. That's for sure. Need to make all the applications lighter. Don't use too many resources. Okay, so that's the test code that's working. Okay, that's the one generating. That sounded a specific frequency. Can we add the frequency slider to the code? I'm not sure it's that in our application. Let's try this quickly. It feels like one of those old school student projects. And I also want to start this one again. So probably when they convert the EG to music just to generate the frequency components. And still continuous play without the button. So essentially the frequency to change when the slider is changing, but the tone being constantly playing. So this one should be pretty straightforward. Yeah, we don't want any buttons. Oh, it's generating forever. Save this one for a sec. Right now from this frequency, network error, let me continue. There's only a regenerate option. If the goal is to play a continuous tone that changes with the EEG data input, consider integrating the tone generation with the EEG data fetching functionality, dynamically adjusting the tone based on the incoming EEG data. In the app, I actually need that slider, but the frequency meant to be changing depending on the frequency of the EEG. Is there a slider or the frequency is actually changing based on the EEG signal? Process the EEG data. Analyze or process the EEG data to determine how it should affect the tone generation. So I'm going to try this one again. So I'm going to try this one again. Process EEG data. Analyze or process the EEG data to determine how it should affect the tone's frequency. This might involve calculating averages, detecting peaks, or applying other signal processing techniques. Continuous tone generation, like in the slider example, initialize and start an oscillator outside of any eventlessness that it plays continuously. Real-time data handling. If the EEG data is streamed in real-time, you need to establish a mechanism, like web sockets, for continuous data transmission. Data processing, the way you interpret EEG data continuously changing tones can be disorienting or uncomfortable for users. Ensure that there are controls to start, stop, or adjust the audio output. This approach assumes a more complex integration between EEG data and audio output, requiring a good understanding of both EEG signal processing and audio synthesis. Yes, there are a couple of things. One is that we, if we have a small window size, we can then be generating the sounds by moving the scroller through the file. There is a longer segment we want to break it into segments by regenerating multiple tones consecutively. The second option is probably a better one. At this stage, we might continue next time. Bye!