Amplitude analysis of .wav file and cue points

Status
Not open for further replies.
Hi.

I'm doing a project on the Teensy 4.0 where I want to load a .wav file, perform amplitude analysis and place 16 cue points throughout the file. I've only done one small project on the Teensy before this.

Is this possible and are there examples in existence?
 
What kind of amplitude analysis do you have in mind? Peak level of the whole .wav file or RMS value of shorter part or...? The Teensy audio library has a number of analysis functions.
About the cue points: if I understand this article correctly than cue-points are not added to the original wav file but stored in a separate file in the DJ software. That file then contains time-stamps of the cue points of that particular wav file.

Paul
 
Thanks for your answers.

In regard to what amplitude analysis I mean, I'd like to experiment with setting 16 cue points in a wav file both based on the lowest and highest peaks, maybe have 2 modes (high peak and low peak cue points). The point is to make a generative sample slicer of sorts, suitable for Jungle etc.
 
I'd probably suggest teensy might not be the best platform for this. Assuming you're using DJ software such as Serato, you'd need to load the .wavs onto an SD, plug that in, get it to do your analysis, and then re-write the file, get it back onto the card, back to the computer, and into your library. Seems like a lot of extra steps, whereas I'd be inclined to write something in python or C++ to do this all on the computer (because those are the languages I know). I would imagine you can find all kinds of libraries on the internet to do this sort of thing.

and then the question would be figuring out how your software of choice stores and uses this data. I *think* Serato stores all this on the individual .wav file. You can find key/BMP/beat grid information written in the .wav file, but I can't see how/if the cue point information is in there. You might find someone has figured this out, or you could try doing a before/after comparison to the file to see if it changes when you add a cue point. Of course, it's possible the software files the cue point data somewhere else, in which case you might have to do a little digging/googling to find out where this is and how to modify it.

After that, it's a simply case of just editing files accordingly.
 
but I can't see how/if the cue point information is in there
That's what I didn't know either but Pete's links in his message showed that it is feasible.
I just tried it. Using Goldwave, I inserted 2 cue points:

GW_add2cuepoints.png

saved the .wav file, closed the file and re-opened that file, this time using AVS audio editor.
It shows the 2 cue points ["markers" as AVS calls them] that I just set and stored in the .wav file:

AVS_markers.png

Paul
 
No, no way with the current code. It would be needed to add resampling there.
But you can change the samplerate of the whole library. This has side-effects.
 
That's what I didn't know either but Pete's links in his message showed that it is feasible.
I just tried it. Using Goldwave, I inserted 2 cue points:
Paul

Well, I've been silly enough to be looking at .mp3 files (Serato uses .mp3 for its libraries) which is why the info about .wav doesn't match!

Thanks! I'll give it a try. Are there ways also to change the tempo of wav playback?

are you going to use the teensy for playback as well, or software from a PC?
Doing it on the teensy is probably possible, but that's a big bit of code, whereas I dont know of any DJ software that doesn't allow you to change the tempo of a track.
 
are you going to use the teensy for playback as well, or software from a PC?
Doing it on the teensy is probably possible, but that's a big bit of code, whereas I dont know of any DJ software that doesn't allow you to change the tempo of a track.

I hoped to do this with Teensy and the Adafruit Neotrellis. The plan was to load a wav from SD, then dynamically place cue points in the file that could then be triggered from the Neotrellis pad. Possibly adding a sequencer to it later (thus the BPM question). But it seems this is not as simple as I thought.
 
Last edited:
I think, particularly as a second-ever project, it might be a bit much, but don't think for one second you shouldn't give it a go if you fancy it!

The teensy-trellis combo is a big winner in my book. You could always get started making a simple midi controller, and then tackle some other bits later on.
 
Thanks! I'll give it a go and if I get totally lost (which I probably will), I might have the Teensy-trellis functioning as a MIDI controller and build the slicer in JUCE instead :)
 
Status
Not open for further replies.
Back
Top