Been working slightly on this and got something that is currently very destructive but some interesting results from a quick play last night.
Load a sample into a Instrument Sample slot. Create as many empty sample slots as you need (couldn’t work out how to do this with the API and ViewBuilder currently defeats me too!)
Running this script from the Terminal will then copy the sample from current slot to all available slots and give each a different Vol, Pan and Finetune setting (not truly as currently have no internet at home so only way I could think to generate spread but restrained values was trig functions on os.clock…
[details=“Click to view contents”] --[[===================================================================================
Unison Generator
Author: Dale Powell (Kazakore) <dj_kaza>
Version: 0.1
===================================================================================]]–
– Variables
– Locals within Function
local rns = renoise.song()
local ins = rns.selected_instrument_index
local samp = rns.selected_sample_index
local unison = #rns.instruments[ins].samples
–[[ Create Slices - CAN NOT BE MAPPED ACROSS KEYBOARD!
for i=0 , unison do
rns.instruments[ins].samples[1]:insert_slice_marker(1)
end ]]–
–[[Create New Instrument (at current +1) -COME BACK TO THIS LATER
rns.insert_instrument_at(rns.instrument[ins+1])
–]]
– Copy Sample across multiple sample slots
for i=1 , unison do
rns.instruments[ins].samples[i]:copy_from(rns.instruments[ins].samples[samp])
– Add keyzone for each sample
– rns.instruments[ins]:insert_sample_mapping(rns.instruments[ins].samples[i])
– Add unique Pan to each Sample.
rns.instruments[ins].samples[i].panning = (math.cos(i * os.clock(i))/2 +0.5) --How can I find random without internet!
– Add Volume to Each
rns.instruments[ins].samples[i].volume = (math.sin(i * os.clock(i)) + 1.2)
– Add Finetune to each.
rns.instruments[ins].samples[i].fine_tune = (math.cos(i * os.clock(i)) *127)
end
[/details]
And for niceness here is a blank, 8 slot Instrument will full Zone spread for each sample:
Click to view contents
<?xml version="1.0" encoding="UTF-8"?>
Samples
Unison Blank
0
0
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
1.0
0.5
48
0
0
false
false
false
16
Cut
Cubic
Off
false
0
0
true
false
0
true
true
48
0
119
0
127
1
true
true
48
0
119
0
127
2
true
true
48
0
119
0
127
3
true
true
48
0
119
0
127
4
true
true
48
0
119
0
127
5
true
true
48
0
119
0
127
6
true
true
48
0
119
0
127
7
true
true
48
0
119
0
127
false
Curve
true
12
0
71
Off
128
Curve
97
0.0
Unipolar
0,1.0
12,1.0
24,0.40000000596046448
48,0.40000000596046448
96,0.0
Off
3
27
0
Off
3
27
0
false
Curve
false
0
0
48
Forward
128
Curve
49
0.0
Bipolar
0,0.5
12,1.0
36,0.0
48,0.5
Off
3
27
0
Off
3
27
0
false
Curve
false
0
0
48
Off
128
Curve
49
0.0
Bipolar
0,1.0
2,0.5
48,0.5
Off
3
27
0
Off
3
27
0
3
false
Curve
false
0
0
71
Off
128
Curve
97
0.0
Unipolar
0,0.75
Off
3
27
0
false
20
80
100
false
Curve
false
0
0
71
Off
128
Curve
97
0.0
Unipolar
0,0.20000000298023224
Off
3
27
0
false
20
80
100
0
0
1.0
true
Bus #01
L+R
true
-1
true
-1
-1,-1
false
-1
-1
false
0
ext. MIDI
0
-1
-1
0
8000
Now I do need help with getting the API to create empty Sample Slots as I couldn't do it.
Also how to generate new ZoneMaps completely flummoxed me too! The below I thought was meant to do something along those lines:
[quote="E.H.V.A.H. SDC, post:10, topic:31924"]
Well, some ideas like this had been in another thread, but I think it's easier to do it manually.. Also, I didn't come very far yet with Renoises ViewBuilder.. nonetheless, with probably the simplest tool ever,
Layer All, the workflow could be:
[/quote]
But my experiments with it it doesn't seem to be doing as I expected it would!
So please how to use the "rns.instruments[ins]:insert_sample_mapping()" command as I really couldn't quite get my head around it.
Then maybe some help with a GUI and tightening up the maths so people can select their own ranges
(EDIT: Changed Code for Spoiler tags.)