[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
user-defined predefined fretboard hash-table
From: |
Patrick Schmidt |
Subject: |
user-defined predefined fretboard hash-table |
Date: |
Fri, 12 Nov 2010 12:32:30 +0100 |
Hi all,
the following example doesn't compile with version 2.13.38:
\version "2.13.38"
\include "predefined-guitar-fretboards.ly"
#(define custom-fretboard-table-one (make-fretboard-table))
#(define custom-fretboard-table-two (make-fretboard-table
default-fret-table))
\storePredefinedDiagram #custom-fretboard-table-one
\chordmode { c }
#guitar-tuning
"3-(;3;5;5;5;3-);"
\storePredefinedDiagram #custom-fretboard-table-two
\chordmode { c }
#guitar-tuning
"x;3;5;5;5;o;"
<<
\chords {
c1 | d1 |
c1 | d1 |
c1 | d1 |
c1
}
\new Fretboards {
\chordmode {
\set predefinedDiagramTable = #default-fret-table
c1 | d1 |
\set predefinedDiagramTable = #custom-fretboard-table-one
c1 | d1 |
\set predefinedDiagramTable = #custom-fretboard-table-two
c1 | d1 |
}
\set predefinedDiagramTable = #default-fret-table
<c e g c'>1
}
\new Staff {
\clef "treble_8"
<<
\chordmode {
c1 | d1 |
c1 | d1 |
c1 | d1 |
c1
}
{
s1_\markup "Default table" | s1 |
s1_\markup \column {"New table" "from empty"} | s1 |
s1_\markup \column {"New table" "from default"} | s1 |
}
>>
}
>>
I compared the files in the patch on Rietveld (issue 2208048) with
the files in 2.13.38 and found differences:
declarations-init.ly
Rietveld:
#(define default-fret-table
(make-hash-table 101))
#(define chord-shape-table
(make-hash-table 29))
2.13.38
#(define default-fret-table
(make-hash-table 100))
#(define chord-shape-table
(make-hash-table 100))
predefined-fretboards-init.ly
Rietveld
% scheme function for copying/creating fretboard tables
#(define (make-fretboard-table . rest)
"Create a new fretboard table. @code{rest} is an optional table name.
If present, the new fretboard table starts as a copy of the fretboard
table @code{rest}."
(if (null? rest)
(make-hash-table 101)
(let ((source-table (car rest)))
(hash-fold
(lambda (key value tab)
(hash-set! tab key value)
tab)
(make-hash-table 101)
source-table))))
2.13.38
--
[There is no such function defined]
With these two changes the example compiles with 2.13.38 but I get
some strange results (no fretboards and weird chord names). See file
attached.
Is this a bug or did I do anything wrong?
Thanks for your help
patrick
- user-defined predefined fretboard hash-table,
Patrick Schmidt <=