Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/17/2015 in all areas

  1. Hallöchen zusammen! @Thomasch. Die 2.Folge vom CC2 findest du hier: Es gibt wieder viel neues zu berichten. Hier gehts zu den News: http://www.cczwei-forum.de/cc2/thread.php?threadid=5878&threadview=0&hilight=&hilightuser=0&page=23 Stand der Dinge: Mit Neo und Morpheus war ich heute in der Matrix und tauche gleich wieder ein Kleiner Scherz. Wer den Science-Fiction Klassiker Matrix nicht kennt hier zur Film Info: http://de.matrix.wikia.com/wiki/Matrix_Wiki Diese Woche arbeite ich wieder an der Modulationsmatrix. Keine leichte Sache Aber Dank einiger Tips aus dem Mutable Forum will ich das mit Hilfe eines Zweidimensionale Daten Arrays versuchen umzusetzen. Was ist ein Zweidimensionale Daten Arrays: http://www.c-howto.de/tutorial-arrays-felder-zweidimensional.html Modulationsmatrix im DE:Generator Wie man auf dem Bild erkennen kann, besteht das Daten Array aus 6 Reihen (Slots) mit jeweils 3 Datenfeldern (Source, Destination, Amount). Der Zugriff auf ein Datenelement in der Modulationsmatrix erfolgt mit einem Zeilen- und Spaltenindex. Unter C sieht das zB dann so aus: amount = (slot_array[2][2]); // load lfo1 amount Die Berechnung eines Modulationsknoten besteht im wesentlichen aus der Multiplikation von Source- und Destination-Werten. Um die Berechnungen schnell auszuführen, habe ich Inline-Assembler Routinen verwendet. Mit Inline-Assembler kann man kleine optimierte Assembler Routinen direkt in den C-Code einbetten. // LFO1 => VCF Modulation -------------------------------------------- temp_cv = U16ShiftRight4(Env2.value_); // convert 16Bit Envelope to 12Bit PWM-Control for Filter-Cutoff amount2 = (slot_array[2][2]) << 1; // load lfo1 amount *2 modul2 = lfo1_out * amount2 >> 8; temp_cv = U16U8MulShift8(temp_cv,(255-modul2)); // set Filter Cutoff -------------------- CV_VCF_Cha1 = temp_cv; CV_VCF_Cha2 = temp_cv; // Inline-Assembler Routinen (avr-gcc) ------------------ static inline uint16_t U16ShiftRight4(uint16_t a) { uint16_t result; asm( "movw %A0, %A1" "\n\t" "lsr %B0" "\n\t" "ror %A0" "\n\t" "lsr %B0" "\n\t" "ror %A0" "\n\t" "lsr %B0" "\n\t" "ror %A0" "\n\t" "lsr %B0" "\n\t" "ror %A0" "\n\t" : "=r" (result) : "a" (a) ); return result; } static inline uint16_t U16U8MulShift8(uint16_t a, uint8_t b) { uint16_t result; asm( "eor %B0, %B0" "\n\t" "mul %A1, %A2" "\n\t" "mov %A0, r1" "\n\t" "mul %B1, %A2" "\n\t" "add %A0, r0" "\n\t" "adc %B0, r1" "\n\t" "eor r1, r1" "\n\t" : "=&r" (result) : "a" (a), "a" (b) ); return result; } Die Schwierigkeit in der Programmierung besteht jetzt darin, die einzelnen Modulationsknoten in der Matrix zusammen zu führen. Daran arbeite ich jetzt... Bis bald und eine schöne Wochen wünscht euch der Rolf aus Wuppertal Die Schwierigkeit in der Programmierung besteht jetzt darin, die einzelnen Modulationsknoten in der Matrix zusammen zu führen. Daran arbeite ich jetzt... Bis bald und eine schöne Wochen wünscht euch der Rolf aus Wuppertal
    1 point
  2. Hey Thorsten, this is a good way to do it. I tried it along with the nth-Parameter Track you just implemented. Along with that it is a great thing :smile: Nonetheless, i think about a way to let tracks interact with each other. I have not found a solution or possible workflow for that. But i try to find one. Maybe a good idea about that will come up in the future. Thank you for your reply, greatly appreciated. Cheers
    1 point
×
×
  • Create New...