I created a new version of this. Unfortunately the staff does not show
because of the loop to listen for input. I am not sure where to precede
from here. Check it out if you have time. It all works if I were to put
in the melody and then run the script but if I allow the script to run
with the .denemo file it causes denemo to not show the staff at all.
Denemo does not hang however.
Jeremiah
On 07/14/2011 03:27 AM, Richard Shann wrote:
On Wed, 2011-07-13 at 22:52 -0500, Jeremiah Benham wrote:
On 07/05/2011 08:37 AM, Richard Shann wrote:
On Tue, 2011-07-05 at 10:34 +0100, Richard Shann wrote:
Looking at your example, I wonder if a somewhat different approach to
storing the melody might be good. It could be stored as a normal
denemo
score, but with each note having a directive that alters its display
so
it doesn't show the pitch or accidental.
I have just been playing around with this:
If you execute this:
(d-C)
(d-DirectivePut-chord-graphic "test" "CrossSign")
(d-DirectivePut-chord-override "test" DENEMO_OVERRIDE_GRAPHIC)
(d-D)
(d-DirectivePut-chord-graphic "test" "CrossSign")
(d-DirectivePut-chord-override "test" DENEMO_OVERRIDE_GRAPHIC)
(d-E)
(d-DirectivePut-chord-graphic "test" "CrossSign")
(d-DirectivePut-chord-override "test" DENEMO_OVERRIDE_GRAPHIC)
You get hidden notes C, D, E which still play but cannot be seen.
Perhaps then I should create another script to generate the above based
on a denemo score?
That is easy - load the score then move the cursor to each CHORD and
execute the directive put commands - I think Nils may have a one-liner
to apply a given procedure to every chord in a movement. My recent
scripts (e.g. fix slurs called by CheckScore) do this sort of traversal
of a score.
How would this approach deal with accidentals. Sure
the key signature would accommodate changes in name (like value (d-C)
really meaning cis,,) I haven't tested that.
accidentals are ok, it just hides the chord.
If you put the cursor on the first note and hold down the Control key
while playing in on a MIDI keyboard the cursor will advance only when
you play the right note. (This is the Checking mode for MIDI in)
I like that idea. I am attaching an implementation of your idea above. I
can see writing in the (c-D)(c-D) would get tedious. Should I write a
script to export this list from a denemo score? Could I possibly do
something like (d-Open "filename") go through the file and
yes - see above - you would create a procedure to be executed on each
CHORD, as I say Nils probably has one, perhaps also with a test
procedure (ie for-each-object-in-score test dothunk) which does dothunk
if test is true until there are no more objects, and then returns to the
original position.
put this on
each note:
(d-DirectivePut-chord-graphic "test" "CrossSign")
(d-DirectivePut-chord-override "test" DENEMO_OVERRIDE_GRAPHIC)
Richard
Jeremiah
Richard
<?xml version="1.0"?>
<score xmlns="http://denemo.sourceforge.net/xmlns/Denemo" version="5">
<scheme>(d-MoveToBeginning)
(use-modules (ice-9 optargs))
(define TwinkleDictation::acceptable_input (list "a" "b" "c" "d" "e" "f" "g"))
(define (EducationGames::GetAcceptableKeyInput acceptable_list)
(let (
(input 0)
(getinput 0))
(set! getinput
(lambda ()
(set! input (d-GetKeypress))
(if (not (or (boolean? input) (member input acceptable_list)))
(getinput))))
(getinput)
input))
(define (HideNotes)
(d-DirectivePut-chord-graphic "test" "CrossSign")
(d-DirectivePut-chord-override "test" DENEMO_OVERRIDE_GRAPHIC))
(define (Next)
(if (d-NextObject)
(begin
(HideNotes)
(Next))))
(Next)
(define (CheckNote)
(if (string=? (d-GetNoteName) (EducationGames::GetAcceptableKeyInput TwinkleDictation::acceptable_input))
(d-DirectiveDelete-chord "test"))
(CheckNote))
(d-MoveToBeginning)
(CheckNote)
</scheme>
<scoreheader-directives>
<directive>
<tag>ScoreTagline</tag>
<postfix>tagline=""
</postfix>
<override>32</override>
</directive>
</scoreheader-directives>
<paper-directives>
<directive>
<tag>PrintAllHeaders</tag>
<postfix>print-all-headers = ##t
</postfix>
<override>32</override>
</directive>
</paper-directives>
<lilycontrol>
<papersize>a4</papersize>
<fontsize>20</fontsize>
<orientation>1</orientation>
</lilycontrol>
<movement-number>1</movement-number>
<movement>
<edit-info>
<staffno>1</staffno>
<measureno>11</measureno>
<cursorposition>-1</cursorposition>
<tonalcenter>0</tonalcenter>
<zoom>100</zoom>
<system-height>100</system-height>
<page-zoom>100</page-zoom>
<page-system-height>100</page-system-height>
</edit-info>
<score-info>
<tempo>
<duration>
<numerator>1</numerator>
<denominator>4</denominator>
</duration>
<bpm>120</bpm>
</tempo>
</score-info>
<staves>
<staff id="id0"/>
</staves>
<voices>
<voice id="id1">
<voice-info>
<voice-name>voice 1</voice-name>
<first-measure-number>1</first-measure-number>
</voice-info>
<initial-voice-params>
<staff-ref staff="id0"/>
<clef name="treble"/>
<key-signature>
<modal-key-signature note-name="C" mode="major"/>
</key-signature>
<time-signature>
<simple-time-signature>
<numerator>4</numerator>
<denominator>4</denominator>
</simple-time-signature>
</time-signature>
</initial-voice-params>
<voice-props>
<number-of-lines>5</number-of-lines>
<transpose>0</transpose>
<instrument></instrument>
<device-port>NONE</device-port>
<volume>127</volume>
<midi_prognum>0</midi_prognum>
<midi_channel>0</midi_channel>
<hasfigures>0</hasfigures>
<hasfakechords>0</hasfakechords>
</voice-props>
<measures>
<measure>
<chord show="true" id="id2">
<duration base="quarter"/>
<notes>
<note id="id3">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id4">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id5">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id6">
<duration base="half"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id7">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id8">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id9">
<middle-c-offset>7</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id10">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id11">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id12">
<duration base="half"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id13">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id14">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id15">
<middle-c-offset>4</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id16">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id17">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id18">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id19">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id20">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id21">
<middle-c-offset>7</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id22">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id23">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id24">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id25">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id26">
<duration base="half"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id27">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id28">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id29">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id30">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id31">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id32">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id33">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id34">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id35">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id36">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id37">
<middle-c-offset>7</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id38">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id39">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id40">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id41">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id42">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id43">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id44">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id45">
<middle-c-offset>4</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id46">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id47">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id48">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id49">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id50">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id51">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id52">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id53">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id54">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id55">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id56">
<duration base="half"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id57">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id58">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id59">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id60">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id61">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id62">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id63">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id64">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id65">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id66">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id67">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id68">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id69">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id70">
<duration base="half"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id71">
<middle-c-offset>7</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id72">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id73">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id74">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id75">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id76">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id77">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id78">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id79">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id80">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id81">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id82">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id83">
<middle-c-offset>7</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id84">
<duration base="half"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id85">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id86">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id87">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id88">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id89">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id90">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id91">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id92">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id93">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id94">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id95">
<middle-c-offset>7</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id96">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id97">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id98">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id99">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id100">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id101">
<middle-c-offset>5</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id102">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id103">
<middle-c-offset>4</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id104">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id105">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id106">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id107">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id108">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id109">
<middle-c-offset>8</middle-c-offset>
</note>
</notes>
</chord>
</measure>
<measure>
<chord show="true" id="id110">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id111">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id112">
<duration base="quarter"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id113">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
<chord show="true" id="id114">
<duration base="half"/>
<directives>
<directive>
<tag>test</tag>
<graphic_name>CrossSign</graphic_name>
<override>4</override>
</directive>
</directives>
<notes>
<note id="id115">
<middle-c-offset>6</middle-c-offset>
</note>
</notes>
</chord>
</measure>
</measures>
</voice>
</voices>
</movement>
</score>
_______________________________________________
Denemo-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/denemo-devel