The new functions in 6.4 are going to be very handy.
Load a beat into a zone and this script should slice the beat and map it from midC.
The script deletes all zone except the first when running, so use an empty program.
The extra zones are deleted so you can adjust the threshold value and get new results and zones.
zones = this.parent:findZones()
function deleteSlices()
for i, zone in ipairs(zones) do
if i > 1 then zone:removeFromParent() end
end
end
if #zones > 1 then deleteSlices() end
zone = this.parent:getZone()
file = zone:getParameter('SampleOsc.Filename')
af = AudioFile.open(file)
threshold = 12
peak = 20 * math.log(af:getPeak(0, -1, 0), 10)
root = 60
onsets = af:getOnsets(0, -1, peak - threshold, 0, 10)
function cutSample()
for i, onset in ipairs(onsets) do
local newZone = Zone()
local sampleEnd = af.length
if i < #onsets then sampleEnd = onsets[i + 1] end
this.program:appendZone(newZone)
newZone:setName(zone.name .. ' ' .. i)
newZone:setParameter('SampleOsc.Filename', file)
newZone:setParameter('SampleOsc.SampleStart', onset)
newZone:setParameter('SampleOsc.SampleEnd', sampleEnd)
newZone:setParameter('ZoneType', 1)
newZone:setParameter('SampleOsc.Rootkey', root + i)
newZone.keyLow, newZone.keyHigh = root + i, root + i
end
zone:setParameter('SampleOsc.SampleEnd', onsets[1])
zone:setParameter('SampleOsc.Rootkey', root)
zone.keyLow, zone.keyHigh = root, root
end
cutSample()
Thank you very much, misohoza.
I had found a problem that skipping-strum in “Strumming.halmod” in my cheap environment.
But I’d fixed it. If there were somebody same probrem, try this.
– Replace “function waitForBeat” as see below –
function waitForBeat()
if not isPlaying() then
return 1
else
checkTimeSignature()
local position = getBeatTimeInBar()
if position == 0 then
return 1
else
position = position - 0.00001 -- adjust time (try change near this value)
local b, f = math.modf(position)
waitBeat(1-f)
local beatfactor = 2*BeatDiv
local step = beatfactor*math.ceil(position) + 1
if step > numberOfSteps then
step = 1
end
return step
end
end
end
If I did that now I would probably do some things differently. I would use spawn for the strumming. So that the time offset of individual chord notes doesn’t mess with timing. Then you can use simply waitBeat to wait for the next step. Also the syncing to host would only need to be done when the playback of the sequence starts. The waitForBeat function could be done more simply. I’d probably do something like:
position = (getBeatTime() / stepDuration) % numberOfSteps
waitBeat(stepDuration - position % 1)
And I would use stepmodulator instead of individual sliders.
I’ve created a footsteps instrument containing layers (surfaces) that get switched via key switches (notes from C-2 to C-1). I would like to add corresponding buttons for the every surfaces on a macro page. But there are no way to assing a note to a button. Is it possible to do so with a script? Can somebody help me?
Thank you!
Could you please explain it a bit more please? If I undestand correctly I need to add my data to that script. So if I have a layers like Tiles, Concrete and their keyswitches are C-2, C#-2, what and where should I add?
One would think, it wouldn’t be too hard for Steinberg to provide a filter “sandbox” where people can create their own curve sets and behavior… I wanted to emulate my Nord filters…
This would be cool, but the current integration of LUA focuses purely on controller and view. As HALion is still mainly an environment for developing huge instrument libraries, performance is important. This is why LUA controllers are only updated every few samples. As soon as we would put an interpreter into the signal chain, this would be even more expensive in CPU.
That said, HALion does already come with a wide range of filters built in. The default filter algorithm is bass preserving even in high resonances and has a huge frequency range. The range is much higher as many analogue filters out there.
So when you want to emulate a specific hardware, you first need to find out the range and if the signal is influenced by the resonance cutoff relation (beyond the obvious). Once you have some curves and values, you can choose a filter combination and script parameter remapping to match that hardware behaviour. Check out the RAST-A. VSTSound instrument library. It comes pretty close to the original hardware it is modelled on. There are some pretty convincing sounds in the demo videos.
There are some very clever people here obviously, this being the case, can any of you tell me if there is a way to get midi out of Halion once it enters? I know officially there isn’t (which i think is bullSh&t) but im hoping there is.