Discussion:
Help getting with lua: 'in' ; lecture notes 7 ; how is lua extensible
Luke
2018-11-05 02:32:34 UTC
Permalink
1. what does 'in' do in e.g. the following from lecture notes 6
[image: image.png]

2 lecture notes 7 "more about 'functions", slide 5'says

[image: image.png]
I have the following in the lua dema


[image: image.png]

3. the first set of lecture notes say[image: image.png]what does this mean?

To be specific, I am using lua as a middle layer, with a API designed' by
Brian Clarkson, of orthogonal devices, to an er-301 as the cpu. This is a
eurorack <https://en.wikipedia.org/wiki/Eurorack> synthesizer module for
manipulation and generation of audio and control voltages. I am wondering
if I can program lua to interface (I think is the right word) with CSound
code.

Apologies if I have sent this twice!

Thanks
Luke
Luke
2018-11-05 02:43:21 UTC
Permalink
Apologies, but I don't think all screen-grabs are showing up

The code in lecture 7, for my 2nd question, reads:

function add(...)
local sum = 0
for _, n in ipairs ({ ... }) do
sum = sum + n
end
return sum
end
df = derivative(function (x) return x * x * x end)
print(df(5))

and gives the output

input:8: attempt to call a nil value (global 'derivative')

The 3rd question I asked just quotes that

Lua is an extensible extension language, focusing on multi-language
development

Cheers,
Luke
Luke
2018-11-05 02:46:38 UTC
Permalink
Sorry but in fact the code example should read

[image: image.png]
And I get an error at 1e-4

I'm sorry.

Loading...