0
$\begingroup$

How to change command:

g:=(f,n) -> seq( subs(x=i, f) mod 12, i=1..n)?

Maple says: Error, illegal use of an object as a name...

I try to create a melody generator that creates desired length of sequence of pitch numbers as output, when you have as input: function( function of x) and length of sequence.

for example: seq(modp(12, subs(x = i, x^2)), i = 1 .. n), but then Maple says: Error, unable to execute seq.

But for example with this: f := proc (g) options operator, arrow; round(g) end proc; a := seq(mod(f(i*log(i+1)), 12), i = 0 .. 30), you get( output):

g -> round(g)

0, 1, 2, 4, 6, 9, 0, 3, 6, 9, 0, 3, 7, 10, 2, 6, 9, 1, 5, 9, 1, 5, 9, 1, 5, 9, 2, 6, 10, 3, 7

1 Answers 1

0

These work for me in Maple 16.01, pasted in as either 1D Maple Notation or as 2D Math input.

restart:  g:=(f,n) -> seq( eval(f, x=i) mod 12, i=1..n):  g(round(x*ln(x+1)),16);                                      1, 2, 4, 6, 9, 0, 3, 6, 9, 0, 3, 7, 10, 2, 6, 9  seq(modp(eval(round(x*ln(x+1)), x = i), 12), i = 1 .. 16);                    1, 2, 4, 6, 9, 0, 3, 6, 9, 0, 3, 7, 10, 2, 6, 9 
  • 0
    It assigns to `A` a 16-by-2 Matrix, whose first column consists of the integers from 1 to 16, and whose second column contains the result from calling `g` in that way. The Matrix is constructed from two 16-by-1 column Vectors.2013-01-30