(USE WITH THE MODULE: patt/songtracker) a songtracker to create songs a song is divided into parts where each part is divided in bars, bars in measures and measures in steps. Each part has it's own settings for: -nominator (steps in measure) -denominator (rate within the measure based on main tempo) -amount of measures within a bar -amount of bars within the part -whether the part loops back to another part (repeating several parts as a whole) -which part to loop back to -how many times this loop has to be performed before going further to the next part after the loop. (don't loop back within another loop, otherwise it will loop endlessly) the remaining controls set the last part of the song and whether the song will repeat after the last part has been played These two modules should be able to setup whole songs (hopefully) Remco van der Most BSD table.axh 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 PExch[PARAM_INDEX_attr_legal_name_preset+i],array[part+i]+(!(i==5)?1:0),0xFFFD); } if(DO){DO=0;} } if(inlet_copy2next&&!copy){ copy=1; for(i=0;i<8;i++){ array[part+i+8]=array[part+i]; } } else if(copy&&!inlet_copy2next){copy=0;} if(inlet_copyfrom&&!from){ from=1; for(i=0;i<8;i++){ array[part+i]=array[i+(inlet_from<<3)]; } } else if(from&&!inlet_copyfrom){from=0;} loop=param_loopparts; max=param_lastpart-1; array[part]=param_preset-1; array[part+1]=param_nominator-1; array[part+2]=param_denominator-1; array[part+3]=param_measures-1; array[part+4]=param_bars-1; array[part+5]=param_loopback; array[part+6]=param_loop2part-1; array[part+7]=param_loops-1; total=0; for(i=0;i<8;i++){ total+=array[part+i]; } if((!(ptotal==total))&&(param_part>param_lastpart)){ PExParameterChange(&parent->PExch[PARAM_INDEX_attr_legal_name_lastpart],param_part,0xFFFD); } ptotal=total;]]> (USE WITH MODULE: patt/songsetup) A tracker consisting of several counters that uses the stored table of the "songsetup" module to play a song. The integer outputs give the "counter position" or "counter maximum" of the respective counters. These are seperated into: -independent outputs for the different counters (steps/measure, measures/bar,bars/part,parts/song) and their own maximum steplength. -combinations of 2,3 or 4 counters and their combined maximum steplength. By controlling pattern and preset generators/controllers with these outputs, these two modules should be able to setup whole songs (hopefully) Johannes Taelman BSD counter.axh 0) && !rtrig) { for(i=0;i<5;i++){ cnt[i]=0; } cnt[3]=inlet_reset2part>0?inlet_reset2part-1:1; rtrig = 1; start=1;} else if (!(rst>0)){ rtrig=0; } int part=cnt[3]<<3; outlet_clock=0; if(run>0){ int32_t frq; MTOF(inlet_tempo,frq) frq=frq>>2; phs+=frq*(attr_memory.array[2+part]+1); if(phs>0){ outlet_clock=1;} if ((phs>0) && !ntrig) { cnt[0] += 1;//steps cnt[0] if(start==1){ cnt[0]=0; start=0; } if (cnt[0]>=(attr_memory.array[part+1]+1)) {//measure cnt[1] cnt[0] = 0; cnt[1]+=1; if (cnt[1]>=(attr_memory.array[part+3]+1)) {//bars cnt[3] cnt[1]=0; cnt[2]+=1; if(cnt[2]>=(attr_memory.array[part+4]+1)) { if(attr_memory.array[part+5]==0) {//loopback off cnt[3]+=1; } else {//loopback on if(cnt[4]<(attr_memory.array[7]+1)) { cnt[3]=attr_memory.array[part+6]; cnt[4]+=1; } else { cnt[3]+=1;cnt[4]=0; } } cnt[2]=0; } } } ntrig=1; } else if (!(phs>0)) {ntrig=0; } } if(cnt[3]>=attr_memory.max){ if(attr_memory.loop>0){ for(i=0;i<5;i++){ cnt[i]=0; start=1; } } else{run=0; for(i=0;i<5;i++) { cnt[i]=0; } start=1;} } outlet_run=run; if(run>0){ Sc=cnt[0]; Sm=attr_memory.array[part+1]+1; Mc=cnt[1]; Mm=attr_memory.array[part+3]+1; Bc=cnt[2]; Bm=attr_memory.array[part+4]+1; Pc=cnt[3]; Pm=attr_memory.max; } outlet_step=Sc; outlet_maxstep=Sm; outlet_measure=Mc; outlet_maxmeasure=Mm; outlet_bar=Bc; outlet_maxbar=Bm; outlet_part=Pc; outlet_maxparts=Pm; outlet_preset=attr_memory.array[part]; outlet_sm=Sc+Mc*Sm; outlet_smmax=Sm*Mm; outlet_smb=outlet_sm+Bc*Mm*Sm; outlet_smbmax=outlet_smmax*Bm; outlet_smbp=outlet_smb+Pc*Bm*Mm*Sm; outlet_smbpmax=outlet_smbmax*Pm; outlet_mb=Mc+Bc*Mm; outlet_mbmax=Mm*Bm; outlet_mbp=outlet_mb+Pc*Mm*Bm; outlet_mbpmax=outlet_mbmax*Pm; outlet_bp=Bc+Pc*Bm; outlet_bpmax=Bm*Pm;]]> no -8 -8 1818 1096