| Thanks; will loo tomorrow as about to crash
> hi -
>
> i am working on some examples for the array opcodes, and i think i found
> a small bug in maxarray. it looks like the last index of the array is
> not set to the scaled values, but remains as it was:
>
> kArr in maximum range 0..100:
> kArr[0] = 88.287296
> kArr[1] = 29.134176
> kArr[2] = 92.571065
> kArr[3] = 11.490893
> kArr[4] = 0.550669
> kArr[5] = 50.381339
> kArr[6] = 61.456018
> kArr[7] = 86.741879
> kArr[8] = 89.724718
> kArr[9] = 56.144580
> kArr in range 0..1
> kArr[0] = 0.953448
> kArr[1] = 0.310621
> kArr[2] = 1.000000
> kArr[3] = 0.118889
> kArr[4] = 0.000000
> kArr[5] = 0.541518
> kArr[6] = 0.661868
> kArr[7] = 0.936653
> kArr[8] = 0.969068
> kArr[9] = 56.144580
>
> this is the output from the code below. best -
>
> joachim
>
>
>
>
>
>
> ; Select audio/midi flags here according to platform
> -n
>
>
>
> ;seed 0
>
> instr 1
> ;create an array with 10 elements
> kArr[] init 10
> ;fill in random numbers and print them out
> printks "kArr in maximum range 0..100:\n", 0
> kIndx = 0
> until kIndx == 10 do
> kNum random 0, 100
> kArr[kIndx] = kNum
> printf "kArr[%d] = %10f\n", kIndx+1, kIndx, kNum
> kIndx += 1
> od
> ;scale numbers 0...1 and print them out again
> scalearray kArr, 0, 1
> kIndx = 0
> printks "kArr in range 0..1\n", 0
> until kIndx == 10 do
> printf "kArr[%d] = %10f\n", kIndx+1, kIndx, kArr[kIndx]
> kIndx += 1
> od
> turnoff
> endin
>
>
> i1 0 0.1
> e
>
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |