Wednesday, 30 July 2014

quick experiment with chipKit DP32 timers

quick experiment with chipKit DP32 timers

#include <sys/attribs.h>
#define WAVE_SAMPLES 256
uint16_t a;
uint16_t b;
uint16_t d;
uint16_t inc;
boolean c;
boolean togg;
uint16_t sineData [WAVE_SAMPLES]; // void setup() {   Serial.begin(19200);   initTmr();   pinMode(A2, INPUT); //   pinMode(13, OUTPUT); //LED   sine ();   } void loop() {   uint16_t aIn =analogRead(A2);   inc=aIn>>2;   d=sineData[a];   // if(c !=togg){   // Serial.println(a);   // Serial.println(d);   // Serial.println("inc");   // Serial.println(inc);   //   // //Serial.println("togg");   // //Serial.println(togg,DEC);   // } //   c=togg; } // call interrupt handling vector extern "C" {   void __ISR(16, ipl6) int1Handler(void)   {     togg= !togg;     analogWrite(13, d); //a++;     //     //     a++;     a+=inc;     if(a>=WAVE_SAMPLES)       a-=WAVE_SAMPLES;     IFS0CLR = 0x80000;// Clear the T4 interrupt flag Bit 19     //   } } void initTmr(){   //   T4CON=0x0; //Stop timer and clear registers   T4CONSET = 0x0070; // set prescalar 1:256   TMR4 = 0x0; //Clear Timer 4 register   PR4 = 0x1D1; // set timer to 465   IFS0CLR = 0x80000;// Clear the T4 interrupt flag Bit 19   IPC4SET = 0x00000016;// Interrupt priority 5, 2   IEC0SET = 0x80000;// Enable T4 interrupt Bit 19   T4CONSET = 0x8000;// Enable Timer4 } void sine (){   uint16_t i;   for(i=0;i<WAVE_SAMPLES;i++){     b = 127*sin((2*PI/WAVE_SAMPLES)*i);     b+=127;     sineData [i]=b;   } }

Tuesday, 29 July 2014

Dub && Wise Synth

*some decoupling capacitors 100nFclose to the analog pins should be added.

My initial intention was to create something focused for the soundsystem culture. This turned out to be much more difficult than i thought .
Dub siren/Elec tom synth/And oscilattor+ MAD Lfos (some trying to recreate some of the sounds in a synare that Jah Shaka got us all used to)...All this synthesized on the fly with the help of some wavetables (all created during the start up)
Pots for :
-Oscillator wave selector ( Sine,cosine  Saw, Inverted Saw, Square wave, triangle and 1 extra slots for now )
-LFO rate
-LFO modulator type select ( Any of the above tables, plus a few more specific and tailored options)
* Both attack and release can interact with the LFO
- Mode selector ( Dub Siren, Sound effects " a la Synare", Elec-Tom synth)

This video is just as an update on the proceedings.
Here i am using the Arduino Due.
Due to its complexity, i ended up re-writing the whole code from scratch and fresh to suit this specific idea.
Already started porting a similar idea to the chipKit DP32, and Pinguino and an Xmos version also soon to come, subject to availability of spare time.