Length Of Blank Sample


I have been playing around with the wave generator by It-Alien, and I wonder if there is a way to adjust the length of a blank sample before drawing starts?

I can’t seem to find anything to do so in the ‘Adjust Sample Properties’ section…

you could use add silence tool in order to define it

Yeah, I could do, but it seems like a bit of a work around to something that is included in every audio editor ever made.

Would be nice to have it in Renoise too…

IT was actually giving a hint to steal code from his slicer snippet and add it to the wave generator for that ;)

When I use the wave generator, it overwrites the length of the sound itself anyway, so it doesn’t seem like changing the length of the sound before using the tool actually makes any difference?

For example, even if I create a blank sound that is 500 samples long before I use the wave generator, after generating a 1 cycle A-4 note the resulting sound is now 100 samples long.

But if I change the number of cycles in the wave generator to 5, then it generates a sound that is 500 samples long.

So… if you want longer output (if you’re generating some waveform that will evolve over a period longer than 1 cycle, for example), set the number of cycles to a higher value.

While this would be a good feature to include in the wave generator, I was actually thinking it would be good to include in the Sample Editor as well, as standard.

dblue is of course right. I didn’t understand the purpose of the request until I read his message

Of course, I agree with you here as well. Insert silence is quite a simple and common function that would be useful to have ‘officially’ - even though the functionality would probably not be that different from It-Alien’s tool. My only suggestion there would be to have some extra options for “add silence at: selection start” and “add silence at: selection end”.

I actually already added that to it, but then I went ahead and broke remove silence =/

I don’t see any point in adding it “officially”, it’s no different than the script. And we are going to bundle some of the better and most used scripts into the release anyway.

I would remove all of those position options though and just insert silence at the edit cursor.

Well, I would argue to keep the additional options since they all have their purpose at certain times, especially since each user likes to work in a certain way. However, ‘insert silence at the edit cursor’ should definitely be the default action if nothing else is chosen, since it seems like the most obvious and common behaviour imho.

well, in renoise there is always a selection, so what I did (here is the mess in its current state (add silence works fine though)) is simply use that always: select nothing/all and the start/end/both option applies to the whole sample, otherwise to the selection. dunno about obvious, but once you know what it does I think it’s pretty much perfect.

can scripts even know where that is? I think there’s just selection or no selection, and a single click into the sample does not constitute one, there’s no way way for scripts to know abou it… could be wrong about this though.

“Thats a selection with no size.”

oh. for some reason I thought

sample_buffer.selection_start / end

could never be the same… but I have no idea why I thought that, haha! thanks.

hmm, probably because when you just click somewhere, selection_start / end get set to the whole sample. what gives?

It probably isn’t empty selection afterall. :P

well, have you tried it? it’s the same even zoomed in so far you know for a FACT it’s an empty selection, so just try it, then tell me the code how to read the edit position because I certainly tried to do this and failed.

Clearly is a selection of zero because cutting waveform doesn’t delete the sample when you have it all selected. If it was the same as having the entire wave selected then Cut would always remove the sample when you have just clicked to position the cursor somewhere.

This is exactly what does happen.

I can’t speak about the scripting behaviour since I have not experimented much with it yet, but if you do this in Renoise itself then cutting will remove the entire sample.

well, but it does actually? click anywhere, hit cut or copy, and it cuts or copies the whole thing?

the context menu items get greyed out, Renoise “knows” alright - and after all there there is this dotted line, too - but scripts don’t know, and currently don’t seem to have a way.

Nothing selected:

start: 1
end: 214390
end - start: 214389
no of frames: 214390

Clicking somewhere ( = a single dotted line, the “edit cursor” or whatever):

start: 1
end: 214390
end - start: 214389
no of frames: 214390

Selecting the whole wave:

start: 1
end: 214390
end - start: 214389
no of frames: 214390

selecting one sample

start: 82320
end: 82320
end - start: 0
no of frames: 214390

selecting two samples

start: 82320
end: 82321
end - start: 1
no of frames: 214390

the last two surprised my myself, I never really checked that and assumed the selection would be bigger by one in those cases. but other than that… as I orginally said.