Thursday, 24 March 2016

Arduino - flashing a LED - basic program - delay function.

This is the basic code that everyone learns as their first arduino project
The blinking LED
It uses the delay function.
 
This function is good for many cases, however it has a disadvantage that it can slow up the program.
However, for this sketch, its perfect.
 
 
The setup:
The cathode (short leg) of the LED connects to GND
The resistor is 220 Ohm
The anode connects to  pin 7 in this case.
 
 Here is the basic Code
 
void setup() {
// put your setup code here, to run once:
pinMode(7, OUTPUT); // configure the pin as an output
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(7, HIGH); // turn LED on
delay(1000); // wait 1 second
digitalWrite(7, LOW); // turn LED off
delay(1000); // wait one second
}
 ---------------------------------
-------------------------------------
 
 

Midi - 3.5mm

There are 2 standards of the traditional MIDI connector to TRS (Tip-Ring-Sleeve) cable.
Both standards use pins 2, 5 & 4 of the DIN connector. 
(female DIN to male TRS)
These are called Type A & Type B.
One extra connector type uses a mono minijack.
This is referred to as Non-TRS, TS, or sometimes Type C


TRS Midi A

Korg (Electribe 2 and SQ-1, SQ-64, NTs-1), Little Bits, Make Noise (O-coast), Moog Subharmonicon, Line 6 MIDI Mobilizer, AKAI (force, MPC Touch), Critter & Guitari Organelle M,  IK Multimedia (iRig), Roland T-8, J-6,E-4 , Twisted Electrons (Acid8 MKII, TherapSid MKII), Westlicht Performer,
Teenage Engineering (OP-Z with oplab, Pocket Modular 16), SQUARP (Rample), Dirtywave (M8),
Dreadbox ( Lil’ Erebus), Intellijel (the MIDI breakout for their palette cases)
use TRS MIDI A.

The DIN schematic above is of a female type... like the pic on the right

tip to pin #5
ring to pin #4
sleeve (earth/ground/shield) to pin #2

This particular configuration makes it easy for connection between a Make-Noise O-Coast & the Korg SQ-1 for example.
You only need a 3.5mm stereo jack to connect them to each other.




---------------------------------------------------------------------------------------------------------

TRS MIDI B

Arturia (e.g. Beatstep Pro and Keystep, Microfreak) and early Novation (e.g. Circuit, Circuit MonoStation and Launchpad Pro) , Music1010 (MX4, blackbox, bitbox, synthbox), EOWAVE (Quadrantid Swarm), 
Flame (Quad CV Recorder, µQMCV), Pittsburgh Modular (Liveforms SV-1),
Analogue Solutions (Treadstone), Polyend's Tracker, Erica Synths Drum Sequencer & Future Retro (MIDI BUS), Malekko (SYNC), Faderfox SC4 & PC4, Five 12 Vector sequencer, Twisted Electrons (Crazy8) use the alternate ‘TRS MIDI B 

Note: Later Novation products like the Launchkey Mini (mk3) and  Launchpad Pro (mk3) use type A.
tip to pin #4
ring to pin #5
sleeve (earth/ground/shield) to pin #2

This particular configuration makes it easy for connection between a Arturia BeatStep Pro & the Music 1010 Synthbox for example.
You only need a 3.5mm stereo jack to connect them to each other.

==============================
To complicate things a bit more the Arturia beatstep pro uses another trs-din cable for the sync/clock adapter. It's got a black 3.5mm plug.
Don't mix this with the midi cable which is grey.


tip to pin #3
ring to pin #1
sleeve (earth/ground/sink) to pin #2
------------------------------------------------------------------------------------
Some modules such as
ALM/Busy Circuits, Shakmat Modular, Elektron (Samples) and Michigan Synth works (MSW)
support both A & B standards.
 
The 3.5mm jack can be switched between differing 3.5mm MIDI configurations 
by reversing the jack connector on the rear of the module.”
 
On the MSW  mBrane for example,
“Rev1.1 of the device … features PSImidi which allows ANY type of TRS MIDI cable to 
be used on the input.”

---------------------------------------------------------------------------------------- 

Type C

Also referred to as TS and Non-TRS
Expert sleepers (DJ1000, ES-5, ESX-8GT), Beatstep (original), MFB (Nanozwerg pro & SEQ-01 Pro)
 
This connects using just two points: Tip & Sleeve.
The tip connects to pin 4 of the midi DIN 
The Sleeve connects to pin 5 of the DIN. (sink or earth)
 

Links
+ Midi association

Monday, 21 March 2016

Deluge - factory reset

Factory reset

  

Almost all of the settings menu settings are stored in the Deluge’s internal memory,
as opposed to the SD card. To restore the Deluge’s default factory settings, switch it on

while holding down on the select knob. The numeric display will briefly blink “RESE”, indicating
that the reset has been performed. 

Saturday, 19 March 2016

If Statements , AND, OR, Equal & not Equal - Arduino

 This is all about "If Statements" in the Arduino world.
These are only executed , based on a condition
 
The if statement checks for a condition and executes the following statement or set of statements if the condition is 'true'.
 
 
 
Check out this old circuit about pots:
 
 I'll be modifying this with a if statement.
 
 

The code:
----------------
// if statement exercise
// if voltage is above 4V, the LED lights

// set up variables

int myPin=A2;
int readVal;
float V2;
int dT=250;

int redPin=9;

void setup()
{
  Serial.begin(9600);
  pinMode(myPin,INPUT);
  pinMode(redPin,OUTPUT);
 
}

void loop()
{
  readVal=analogRead(myPin);
  V2=(5./1023.)*readVal;
  // converts to a voltage -- remember to place the decimal
  // points after the 5 & 1023 ... these may be floating points
 
  Serial.print("Potentiometer Voltage is ");
  Serial.println(V2);
 
  if(V2>4.0){
    digitalWrite(redPin, HIGH);
  }
  if (V2<4.0) {
    digitalWrite(redPin, LOW);
  }
 
  delay(dT);
}
------------------------------------
Here is a variation of the if statement using equal (==)
and not equal(!=)
 

 if(V2==5.0){
    digitalWrite(redPin, HIGH);
    // "==" is equal
  }
 
  if (V2!=5.0) {
    digitalWrite(redPin, LOW);
    // != is not equal
 
----------------------------------------------------------------------
 Compound Conditionals
You can also use AND , OR

 if(V2>2.0 && V2<3.0){
    digitalWrite(redPin, HIGH);
    // "&&" is and
  }
 
  if (V2<2 || V2>3) {
    digitalWrite(redPin, LOW);
    // "||" is OR
  }
 
  delay(dT);

 ----------------------
if you are combining great than and equal, you don't use "=="
eg:
 if(V2>=2.0 && V2<=3.0){
    digitalWrite(redPin, HIGH);
    // "&&" is and
  }
 
  if (V2<=2 || V2>=3) {
    digitalWrite(redPin, LOW);
    // "||" is OR
--------------------------------------------
 
 
Thanks to Paul McWhorter for the great video.

 ---------------------------------
-------------------------------------

Thursday, 17 March 2016

analogRead - Arduino

 The Arduino can read analog voltages.
It can be used to help analyse circuits.


This can only be done with the analog pins (A0 to A5)

In this example I'll use pin A3
 

Open your serial monitor.

We are getting the number 238
This is not a voltage
It's the scaled number between zero & 1023
I call this the readValue.
It's a 10bit number (1024 is 2 to the 10th)

0V = 0
5V = 1023

You can test this is we move out test probe to measure the reading @ the 5 volt rail.
We would expect a reading of 1023.
This is exactly what we get.
 
To calculate the voltage from the readValue use this formula.

Voltage  = (5/1023) x ReadValue

thus in this example,  V = (5/1023) x 238 = 1.163

The code:
------------------------------------------------
// declare your variables
int readPin=A3;
int V2=0;
int delayTime=500;

void setup()
{
  pinMode(readPin,INPUT);
  Serial.begin(9600);
}

void loop()
{
  V2=analogRead(readPin);
  Serial.println(V2);
    delay(delayTime);
}
----------------------------------------------------------

A useful variation of the program would be for the monitor to display the value in Volts.
To do this we need to do a few changes:
Add a new variable (readVal)
V2 must be a float
 
 readVal=analogRead(readPin);
  V2=(5./1023.)*readVal;
 

 The improved code:

------------------------------------------------
// declare your variables
int readPin=A3;
int readVal;
float V2=0;
int delayTime=500;

void setup()
{
  pinMode(readPin,INPUT);
  Serial.begin(9600);
}

void loop()
{
  readVal=analogRead(readPin);
  V2=(5./1023.)*readVal;
  Serial.println(V2);
    delay(delayTime);
}
-------------------------------------------------

Thanks to Paul McWhorter for his great inspirational videos
 
 
 ---------------------------------
-------------------------------------
 

Wednesday, 16 March 2016

ARP 2500 - My Resonator Addiction

Some videos using the beautiful 1047 filter/resonator.


The ARP has a combination of LP, BP, HP & notch.
All filter outs are available simultaneously. It very beautiful for obtaining timbres.
esp when Q is turned up. It's so resonate that a pulse applied to the input with make the filter ring.

The Korg Resonator works differently to the ARP as far as I understand.
The PS 3100 uses 3 bandpass filters.

The original video with the unaltered ARP sample is here:

...

 Most synths use a LP filter with a sharp cutoff (24dB) with moderate resonance (Q=10, or 20dB peak).
The ARP specs for this filter claim a resonance from zero to 54dB (or Q between 1/2 and 512).
The filter's bandpass response is a single pole, 6dB.
This is similar to natural acoustic resonators like drums, horns, pipes & strings.


Bundenna to Otford hike - NSW

 I did this hike around 2004.





 
















































For more travel postcards click here: