summaryrefslogtreecommitdiff
path: root/lily/note.cc
blob: 2b1a8c447b3b69faedc4b86086054a4cd38c8277 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
  could use cleanup
 */
#include <ctype.h>

#include "my-lily-lexer.hh"
#include "string.hh"
#include "real.hh"
#include "debug.hh"
#include "musical-request.hh"
#include "command-request.hh"
#include "music-list.hh"
#include "identifier.hh"
#include "varray.hh"
#include "text-def.hh"
#include "parseconstruct.hh"



String *
get_scriptdef (char c)
{
    String s;
    switch (c) {
    case '^' : s = "marcato";
	break;
    case  '+' : s = "stopped";
	break;
    case '-' : s = "tenuto";
	break;
    case  '|':  s = "staccatissimo";
	break;
    case  'o' : s = "";
	break;
    case '>' : s = "accent";
	break;
    case  'v' : s = ""; 
	break;
    case  '.' : s = "staccato";
	break;
    default:
	assert (false);
    }
    return new String (s);
}

Request*
get_script_req (int d , General_script_def*def)
{
    Musical_script_req* script_req_p = new Musical_script_req;
    script_req_p->dir_i_ =d;
    script_req_p->scriptdef_p_=def;
    return script_req_p;
}



Request*
get_stemdir_req (int d)
{
    d = sign (long (d));
    Group_feature_req * gfreq_p = new Group_feature_req;
    gfreq_p->type_str_ = "vdir";
    gfreq_p->value_str_ = String (d);
    return gfreq_p;
}
Request*
get_hshift_req (int i)
{
   Group_feature_req * gfreq_p = new Group_feature_req;
    gfreq_p->type_str_ = "hshift";
    gfreq_p->value_str_ = String (i);
    return gfreq_p;
}
    
Request*
get_grouping_req (Array<int> i_arr)
{
    Measure_grouping_req * mr_p = new Measure_grouping_req;
    for (int i=0; i <i_arr.size();) {
	mr_p->elt_length_arr_.push (Moment (1, i_arr[i++]));
	mr_p->beat_i_arr_.push (i_arr[i++]);
    }
    return mr_p;
}