From cd457011be1e053f154d1d78b0e733c131470dca Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 4 Oct 2022 21:46:41 +0100 Subject: now using soundxdb extract rather than database opcodes directly --- sonics/soundxdb.udo | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'sonics/soundxdb.udo') diff --git a/sonics/soundxdb.udo b/sonics/soundxdb.udo index c27b2bf..4e0ad61 100755 --- a/sonics/soundxdb.udo +++ b/sonics/soundxdb.udo @@ -78,7 +78,6 @@ endop */ opcode sounddb_getcollection, i[]i, S Scollection xin - itotalsize = 0 if (strindex(Scollection, ",") > 0) then index = 1 @@ -94,7 +93,6 @@ opcode sounddb_getcollection, i[]i, S itotalsize += ftlen(gixdb_collectionsfn[icollectionid]) endif od - idata[] init itotalsize iwriteindex = 0 index = 1 @@ -124,7 +122,7 @@ opcode sounddb_getcollection, i[]i, S od else - icollectionid = sounddb_getcollectionid(Stemp) + icollectionid = sounddb_getcollectionid(Scollection) idata[] tab2array gixdb_collectionsfn[icollectionid] igoto complete endif @@ -136,28 +134,6 @@ endop -/* - gixdb_pitchreference - has 127 * 4 entries. get start and end indexes for gixdb_pitchnotes by - index = (inote + (icollectionid * 127)) * 2 - - then values - iminindex table index, gixdb_pitchreference - imaxindex table index+1, gixdb_pitchreference - - then get the actual files which are between min and max indexes eg - - iselected = round(random(iminindex, imaxindex)) - ifileid table iselected, gixdb_pitchnotes - ipitchadjust table iselected, gixdb_pitchadjust - - - -*/ - - - - /* Get the nearest note in a filecollection, return the file ID and the pitch ratio adjustment required to the requested note. @@ -170,7 +146,7 @@ endop */ opcode sounddb_mel_nearestnote, ii, ii icollectionid, inote xin - irefindex = ((inote - $XDB_MINNOTE) + (icollectionid * 128)) * 2 ;, gixdb_pitchreference + irefindex = ((inote - $XDB_MINNOTE) + tab_i(icollectionid, gixdb_pitchrefoffset)) * 2 iselected = round(random(tab_i(irefindex, gixdb_pitchreference), tab_i(irefindex+1, gixdb_pitchreference))) ifileid tab_i iselected, gixdb_pitchnotes ipitchratio tab_i iselected, gixdb_pitchadjust -- cgit v1.2.3