• Jocketor

    @whale-av I see what you mean. What i'm doing here, in broad terms, is;

    1. Upload any wavfile to an array, This goes through soundfiler and all that jazz.

    2. I run through the wavfile at the normal rate times 100 (so very fast), to get the data needed for soundfiler_info to send correct values to resize the next array....

    3. ...which is a new array that is ready to recieve the data of the wavfile being run through a FFT-chain. This array has the size of wavfile-time in deciseconds and plots out the magnitude values of a chosen frequency range over the time of the song (here's why i asked for the metro-timeline-array setup). This array plots it's values continiously during the course of the FFT-analysis. This is the part that currently happens in real-time and if this could be sped up in Pd using tabread4~ without getting skewed values from the FFT-analysis, which is happening right now, then that is something that i'd like to explore.

    So yes - the original data is being read from an array. I'm not looking to be able to read data while this is all happening, at the end of the day I just want to get the correct values from the FFT, arranged sequentially during the duration of the chosen track, as fast as possible to then pack it and send it over OSC.

    Always appreciate your input and knowledge!

    posted in technical issues read more
  • Jocketor

    @whale-av Yeah - i've also started experimenting with using phasor (well, phasorshot really) to read the signal using tabread4~ instead of tabplay~ which i use to analyse the signal in real-time. It all "works", but by using tabdump to print the values of the array after processing the wavfile I can clearly see that I get different values compared to when doing it in real-time. Somehow it seems that upping the rate of the phasor seems to make it go faster than how my plotting to the array can handle. I don't know if plotting using a faster metro would solve this. Again, might have to analyse in real-time, but doing it on smaller chuncks simultaneously to save time.

    "Although having slept on this..... I guess it can be done almost instantaneously if you analyse the saved audio file outside of the audio domain." Could you explain what you meant there? Sorry, i'm slow. :p

    posted in technical issues read more
  • Jocketor

    @weightless Also, if you're interested in the patch I can share it. I have to do some cleaning-up first though, it's more spaghetti than needed be right now!

    posted in technical issues read more
  • Jocketor

    @whale-av Of course. So simple! I knew I was overthinking things. Big thanks for helping me yet again!

    @weightless Thanks for chiming in! Yes, you are correct in describing what i'm doing. Thanks for suggesting that external, i'll have a look at it, even though i've succeeded in what I set out to do.

    Now to figure out a way to do the FFT-analysis faster than real-time to circumvent having to play through a whole track.... Might have do divide the track by chunks in C# and multithread each chunk to seperate instances of the patch, to then reorder the indexes with their values in a list. I'll figure something out, thanks for all your help!

    posted in technical issues read more
  • Jocketor

    Hi Pd-people!

    I'd like some advice on how to set up tabwrite to write values for each index of an array while moving forward through them at a set pace of time. I feel like i'm making it more complicated than it needs to be, and so i'd love some input.

    The concept of time feels very straightforward when recording audio data to an array, say by using adc~, in which the time to move through it is defined by a samplerate. But since I want to work with control values as actual numerical values I can't quite figure it out.

    What I'd like to use it for is to write amplitude values of summed group of FFT blocks that are read from another array, and write these to each index during the duration of the playing file. Right now I've only managed to constantly update the same index, that being index 0, so how do i move it forward in time from there? The arraysize is set to match the actual numbers of seconds in the given track.

    I hope I've made my question clear, my head is kinda spinning around this patch by now. I'd love to explain it further if needed be.

    GIF.gif

    These concepts is a continuation of a patch i discussed here, and got some great input; https://forum.pdpatchrepo.info/topic/11084/analyze-audio-file-from-table-detect-bpm-and-or-amplitude-within-a-spectrum

    Thanks for discussing!

    posted in technical issues read more
  • Jocketor

    @whale-av Katjaa is indeed a Pd mastermind. I had not read that article before, so thanks for that! Great stuff.

    I've actually made some progress in my endeavours. After loading a wavfile to an array, running it through the FFT analysis and writing the results to a new array i'm using tabdump together with unpack to get out my individual values containing the amplitude for seperate indexes in any given moment. What needs to be done is to store these values in a sequential order to create somewhat of a timeline, either by writing them down to a new array or by using list, i'm not sure yet. I'm actually planning to create a new thread here discussing the idea of writing to an array while continuously moving forward through the indexes in a set timefreame, to create a timeline.

    Ergo; I've abandoned the idea of accurately deciding on a BPM by using FFT to analyse a wavfile. I'm sure it can be done, and i've some progress on the subject, but it's very hard to do reliably. For my purposes I also find that I can do just aswell with using FFT to determine when "events" happen in different ranges of a spectrum, and as long as I can store these moments in time to an array/list I will be able to create what I set out to do.

    Always open for more discussion on the subject, so big thanks for everyone who got involved!

    posted in technical issues read more
  • Jocketor

    @weightless Thanks! I've read that article, and while it's the most promising publication for helping me figure out what I want, the author uses a few abstractions called poltorec~ and rectopol~ that they seemingly wrote themselves. To be honest I couldn't make sense of it even though the article mentions a workaround. I might just have to spend a few hours dissecting that article again, because the things in there seem very close to what i'm pining for here.

    Again, huge thanks!

    posted in technical issues read more
  • Jocketor

    In case anyone is interested in progress - I'm still trying to set up a FFT-chain that i'm happy with. Different articles online all seem to have their own steps with regards to things like normalizing the signal, and I feel like i'm not all after the re-synthesis part of ifft/rifft as i'm only looking to analyze audio from an array, not do any processing on it.

    While I am doing FFT on a wavefile loaded into an array and visualizing the FFT:d signal in a new array, i'm still at a loss on how to extract the data that I want. Ideally i could somehow group the indexes, say per 100 blocks, so around 5 groups if i'm using a blocksize of 512, and look at how they are outputting using bonk~ or something of the sort. Right now i'm using either tabdump or tabread from the FFT-array, coupled with unpack to get individual indexes, but since there's 512 of them it's just not practical. Overall i'm having trouble finding any examples online on where FFT is used to get control-value information rather than as a part of the audio signal.

    I'm still up for more discussion if anyone of you out there are intruiged!

    posted in technical issues read more
  • Jocketor

    @whale-av Thanks for replying!

    Agreed, it is not a very simple thing to set up in Pd. However, since BPM-calculation of an audio file isn't terribly complex to get going in more traditional syntax (We've looked at rough prototypes of it in C#) i'm honestly surprised that I can't find more examples of it in Pd.

    Things that I can get immediately upon loading an audio file to an array is basic info such as sample size and length of file in samples. Using these it should be fairly simple to get a length of the file in MS, which in turn should allow me to at least guesstimate a BPM. From there, being able to use FFT, bandpassing or maybe even fiddle~ to distinguish between different forms of instruments playing would just be a huge bonus. (Again, even FFT seems to be easier to set up in C# than what I've had success with in Pd.) For the sake of argument you could imagine that this would be used for a very basic rhythm game such as the likes of Guitar Hero.

    If all we wanted to do was to beatmatch to pre-defined music tracks then we'd be set - i'd just use a form of a click track derived from the actual track like you suggested, write that to an array that spans the length of the song and then read back from it during playtime. Being able for users to load the own music would give such an increased value though.

    We've been inspired by the VR game Audioshield, in which the BPM tracking on user-defined music works "fairly well".

    Audioshield:

    Again, thanks for engaging! Hopefully this could at least lead to some cool discussions :)

    posted in technical issues read more
  • Jocketor

    Hi Pd-people!

    I'm currently working with a VR-games studio that possibly wants to create gameplay that would depend on the player doing this in sync to background music. I'm currently looking into Pd to see if this is something I could do within it.

    Things that are on my wishlist;

    1. Being able to analyze a audio file from a table to estimate tempo

    2. Be able to differentiate between things such as a kickdrum and a lead guitar by using the likes of FFT or very steep bandpassing

    3. Take this information and store it in a seperate array that has a size that matches a phasor cycle with the lenght of the audio file. (Does this request makes sense?)

    I know that this inquiry is an immense one and I don't expect to be able to solve all of these things, if any. But if anyone feels like they could give any tips to point me in a direction that could possibly produce something close to my wishlist I would really love you.

    Thank you for your time, loving these forums!

    posted in technical issues read more
Internal error.

Oops! Looks like something went wrong!