06 Sep 2001 04:43:36 UTC
- Distribution: Lutherie-FretCalc
- Module version: 0.30
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (1 / 0 / 0)
- KwaliteeBus factor: 0
- License: unknown
- Activity24 month
- Download (6.05KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionDSPARLING Douglas Sparling
Lutherie::FretCalc - Calculate stringed instrument fret locations
use Lutherie::FretCalc; my $fretcalc = Lutherie::FretCalc->new($scale_length); $fretcalc->in_units('in'); $fretcalc->out_units('in'); my $fret = $fretcalc->fret($fret_num); my @chart = fretcalc($num_frets);
Lutherie::FretCalcprovides two methods for calculating fret spacing locations for stringed musical instruments.
fret()will find the distance from the nut for a given fret number.
fretcalc()will generate an array containing the fret locations for the given number of frets.
- new ( SCALE_LENGTH );
This is the constructor for a new Lutherie::FretCalc object.
SCALE_LENGTHis the numeric value for the scale length to be used for the calculation. The default value for scale length is 25. The unit can be set with the
out_units()methods. The default is 'in' (inches).
- scale ( [ SCALE_LENGTH ] )
SCALE_LENGTHis passed, this method will set the scale length. The default value is 25. The scale length is returned.
- num_frets ( [ NUM_FRETS ] )
NUM_FRETSis passed, this method will set the number of frets. The default value is 24. The number of frets is returned.
- fret_num ( [ FRET_NUM ] )
FRET_NUMis passed, this method will set the fret number. The default value is 12. The fret number is returned.
- in_units ( [ IN_UNITS ] )
IN_UNITSis passed, this method will set the in units. The default is 'in' (inches). The in unit is returned. 'in' - Inches, 'mm' - Millimeters
- out_units ( [ OUT_UNITS ] )
OUT_UNITSis passed, this method will set the out units. The default is 'in' (inches). The out unit is returned. 'in' - Inches, 'mm' - Millimeters
- calc_method ( [ CALC_METHOD ] )
CALC_METHODis passed, this method will set the calc method. The default is 't' (tempered). The calc method is returned. 't': tempered - power of $i/$tet (default), 'ec': classic - 17.817, 'es': Sloane - 17.835, 'ep': Primative - 18
- tet ( [ TET ] )
TETis passed, this method will set the tones per ocatave. The default is 12. The number of tones per ocatave is returned. This value is only valid when using calc_method = 't'.
- half_fret ( [ FRET_NUM ] )
FRET_NUMis passed, this method will calculate the half fret for this fret number. Valid values are 1, 6, 8 and 13. Only used with
dulc_calc(). A comma separated list of half frets is returned.
- fret ( [ FRET_NUM ] )
Calculate the distance from the nut to the fret number. A scalar containing the fret location for
- fretcalc ( [ NUM_FRETS ] )
Calculate fret locations for given scale length, number of frets, calc type and tet. An ordered array containing fret locations from 1 to
- dulc_calc ( )
Calculate fret locations for mountain dulcimer. Number of frets is set at 14. Half frets may be added by using
half_fretfunction. Valid half frets are 1+, 6+, 8+ and 13+.
num_fretswill be ignored when using
dulc_calc. A hash containing fret locations from 1 to 14 is returned.
Doug Sparling, email@example.com
Copyright (c) 2001 Douglas Sparling. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Lutherie::FretCalc, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Lutherie::FretCalc
For more information on module installation, please visit the detailed CPAN module installation guide.