SynthMaker

Sample Player/Looper Zoom?

Archive · 2011 13 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

attic ·

On the Sample Player/Looper here on the wiki. [old link]

How would you make the wav graph zoomable in/out while still retaining the correct start and end marker positions visually and for sample playback? Or maybe I should put it this way, I would like to use a very long wav file so I need to zoom in for better placement of end and start marker positions. What are my options?

Thanks

philter5 ·

there is a old example somewhere here in the forum.... couldn´t find it now. it was a wave player mod with zoom, but i cant remember if it was with Start/stop points or not. perhaps you should have a look at the multi stage envelope project, there is a noce zoom feature built in.

infuzion ·

philter5 wrote: perhaps you should have a look at the multi stage envelope project, there is a noce zoom feature built in.

That is vector objects, while IIRC sample visuals are raster.

trogluddite ·

infuzion wrote: That is vector objects, while IIRC sample visuals are raster

The wave display is drawn with a 'GraphDraw' - not raster, but lots of vectors, if you feed it only a small float array, it will still fill up the view area, 'interpolating' the points with lines and shading.

There's a clue to how to zoom - you can use a 'Float Array Section' to extract only a small part of the graph data that comes out of the 'MinMax' primitive. The extracted section will then fill the draw area, effectively zooming in on the data.

However, there's a catch... The MinMax is dividing the sample data (mem) into blocks (step = wave length / 256) - so that the float arrays are kept to a reasonable size (only 256 data points in this case). This will limit how far you can zoom in - you will very quickly just see straight lines joining a handful of graph points. For example, to zooming in to the first 10% of the wave, you would use an array section including only the first 26 data points from the array - already not enough detail for a view that size. To zoom in to the level of individual samples (e.g. to get a zero crossing spot on), you would need to set the min/max step size to one - but then your float array will be enormous - and when zoomed fully out, the DrawGraph will use a lot of CPU to try and squeeze thousands of points into a tiny box.

I would suggest having a play with array sections, and various MinMax 'step' setting to see what the performance is like before going too far into the nitty gritty of the start/end marker calculations etc.

infuzion ·

hmmm... perhaps the only way is to read the WaveArray into audio stream, then interpolate, then re-read? Might have to bug Malc to make a new primitive if we can't find a good solution.

trogluddite ·

infuzion wrote: Might have to bug Malc to make a new primitive if we can't find a good solution

Yes, a 'mem section' primitive could be a handy thing. A 'mem' primitive shouldn't be much more than a pointer to the location of the first byte and a length count - a primitive to point to a sub-section of that should be pretty trivial to concoct

Still, worth experimenting to see where the worst bottlenecks would be with what we have. Given SM's poor GUI performance, my hunch is that re-calculating the MinMax may be cheaper than trying to plot too many points - so maybe the key is to make the MinMax step a function of the zoom setting - i.e. a bigger step size when zoomed out, Limiting the frame rate to 10-15Hz shouldn't be too much of a compromise for this application either.

Jay ·

here's something along those lines from Exonerate! mem section

Is that what you are after?

Best Regards

attic ·

I really appreciate you all taking a look at this! The multi stage envelope project was the first thing I tried to use as a start point but I ran into issues trying to figure out how to get the loop points synced with the wav graph expansion. I'm not good at the SM thing yet as my job eats all my time but learning as quick as I can afford. I was starting to think this was to much to ask on the forum and then a bunch of reply's today. 🙂 Thank you.

Here is how far I got but I suck at this so I concluded I wouldn't be able to do this one myself. At least not yet. I'm just not knowledgeable enough at this point and trying to mess with stuff above my level of skill. Basic concepts escape me, like how do I scale one set of numbers against another keeping their ratio intact A:B=C:D in the green section? I'm sure that should be obvious to me and a dumb question.

Spaghetti for miles and a mess, hope its not to crazy in there for you.. Sorry the pitch shifting code amongst other things isn't in there, it will make it to the forum one off these days.

@Exonerate That's a good example. Maybe that would work with loop points? I will have to play with it. @Trogluddite Yeah the zero crossing point is one thing I'm after but also just to be able to set loop points tighter for long files.

Given SM's poor GUI performance, my hunch is that re-calculating the MinMax may be cheaper than trying to plot too many points - so maybe the key is to make the MinMax step a function of the zoom setting - i.e. a bigger step size when zoomed out, Limiting the frame rate to 10-15Hz shouldn't be too much of a compromise for this application either.

@Infuzion If I understand what you are saying, I think you are right.

Really appreciate the you all looking at this.

infuzion ·

attic wrote:

http://www.box.net/files/0/f/153475623/Osm Could someone verify that you can get at the file also? It was to big for the forum.

Can't see the image & can't get to the file.

attic ·

Edit Fixed. That means the picture here wasn't showing also. Midi Spec & Dsp Links

Come to think off it I haven't gone through this schematic to make sure there are not any modules from the registered users forum. Maybe this should be moved? It belongs in help but I think I need to check this!

The .osm that is attached at the bottom is the kind of zoom functionality I'm looking for. Of course I'm looking to do it on the wav graph with loop points remaining entact on zoom. I found it somewhere on forum.

I cant verify where everything in the module I posted earlier came from. I'm sure it would be fine to give it to anyone that has replied to this so far.

So thats philter5 infuzion trogluddite Jay pm me and I will give you a link.

..

nix ·

I have done a bucketload of work on a wave editor. I pm it you 🙂 It has zoom & scroll ++ edit- I had twin GPUs when I made this, it worked then. U need some serious graphics grunt to run it it turns out. It does zoom, but redrawing hangs a normal system. I'm working on it now to run on my i3 lappy. So yeah, hopefully I can fix it to not run on a 2020 system edit2- I will clean up the whole .osm attic, so it doesn't give u a headache looking at my spaghetti

cyto ·

trogluddite wrote: ...you would need to set the min/max step size to one - but then your float array will be enormous - and when zoomed fully out, the DrawGraph will use a lot of CPU to try and squeeze thousands of points into a tiny box.

Would it make sense to "resample" (to a more manageable size) the float array going into the DrawGraph primitive?

-cyto

nix ·

the zoom works by changing the width on the 'graph lines', by changing the window area into 'area to float'>'float to area', and using a multiplier on x axis. Cheers

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.