Selection f(samples)

GoldWave general discussions and community help
Post Reply
HpW
Posts: 7
Joined: Mon Jun 11, 2012 7:48 am

Selection f(samples)

Post by HpW »

Why selecting samples from 0...4096 is really 1..4096 ??

Hp
DougDbug
Posts: 2074
Joined: Wed Feb 16, 2005 3:33 pm
Location: Silicon Valley

Re: Selection f(samples)

Post by DougDbug »

It's a computer/programming tradition to start counting at zero. If you are addressing memory there truly is an address zero location in hardware and in an audio file sample zero also exists. i.e. with 4 bits we can count from binary 0000 (decimal zero) to 1111 (decimal 15 or hexadecimal F).
HpW
Posts: 7
Joined: Mon Jun 11, 2012 7:48 am

Re: Selection f(samples)

Post by HpW »

DougDbug wrote:It's a computer/programming tradition to start counting at zero. If you are addressing memory there truly is an address zero location in hardware and in an audio file sample zero also exists. i.e. with 4 bits we can count from binary 0000 (decimal zero) to 1111 (decimal 15 or hexadecimal F).
OK, I am a programmer too :D

with your binary example 0000 to 1111 we have a count of 16.

Goldwave from 0...4096, would have a count of 4097, really uses 1...4096 as a count of 4096

or I am wrong :D

Hp
Moonmist
Posts: 30
Joined: Sat May 16, 2009 3:24 pm
Location: The Milky Way Galaxy

Re: Selection f(samples)

Post by Moonmist »

HpW wrote:
DougDbug wrote:It's a computer/programming tradition to start counting at zero. If you are addressing memory there truly is an address zero location in hardware and in an audio file sample zero also exists. i.e. with 4 bits we can count from binary 0000 (decimal zero) to 1111 (decimal 15 or hexadecimal F).
OK, I am a programmer too :D

with your binary example 0000 to 1111 we have a count of 16.

Goldwave from 0...4096, would have a count of 4097, really uses 1...4096 as a count of 4096

or I am wrong :D

Hp
Hi I know what you mean, and here's why it does that... each sample is like a staircase step... the index (sample) number is the beginning of each step... since the finish marker is placed at the end of the step it gives you one number higher.

Here's a small example, with 4 samples (with "_" being the staircase step of each sample):

0_1_2_3_4

so if you put the finish marker before the fourth sample it would be on "3", but if you selected all 4 samples then the finish marker would now be on "4" so it says "4"! :)

Hopefully this makes sense to you, or you at least understand what the program is doing now! :)
Post Reply