Saturday, 26 November 2016

Polyfusion - Sound A Round

 Polyfusion QP-1 Sound-A-Round Quad Panner.
 

Extremely rare. there were only a couple of hundred ever made. It is the Holy Grail for Polyfusion modular synth owners 
 
There is an auto and manual mode.
 
It features a joystick for real time manual control.
This allows you to move the sound from any quadrant to any other quadrant forward,  reverse, up down, etc. 
 
Automatic mode uses a built in LFO to automate panning,
 

It can also be used to redirect CV signals in your modular synth.
 
 It was made famous by Pink Floyd, who used it in their live shows to pan audio.
They used a quadraphonic sound system.
 

Thursday, 17 November 2016

LED blink Program using interrupts

 The classic LED blink program uses delay.
 
This version uses interrupts
 
Still flashes LED 13
 
 

Here is the code

/*
 * This is a interrupt version of the classic blink LED sketch
 */

// pins
const int led_pin = PB5; // PB5 is the same as pin 13


void setup() {
 
  // set LED pin to be a output
  DDRB |=(1<< led_pin);// using port B
 
}

void loop() {
 PORTB ^= (1<< led_pin);
 delay(200); // turns LED on/off
 

}
 
//7777777777777777777777777777777777777777

DDRB - The Port B Data Direction Register
 

Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports:

  • B (digital pin 8 to 13)
  • C (analog input pins)
  • D (digital pins 0 to 7) 
 Port B pins can be either in or output.


Each port is controlled by three registers, which are also defined variables in the arduino language. 
The DDR register, determines whether the pin is an INPUT or OUTPUT. 
The PORT register controls whether the pin is HIGH or LOW.
The PIN register reads the state of INPUT pins set to input with pinMode(). 
 
 
 
Links
 
 
 
 
 

Tuesday, 15 November 2016

Arduino Binary Counters & MIDI - Super basic program

Though this is not directly related to music, but I think its good to know a little about bytes & bits.
Arduino's are digital devices and only understand computer language.
When you attach an analog voltage to one of the pins, it's translated into zeros and ones by a ADC.
 
Midi notes are also all about zeroes and ones. They are digital signals.


Here is a Decimal/Binary/Octal/Hex conversion table 

Binary numbers are zeros and ones. You can think of them like switches being on or off.
MIDI notes take the form of these binary numbers.
They can be divided into two types: command bytes and data bytes. 

Command bytes are always 128 or greater, or 0x80 to 0xFF in hexadecimal. 
If you convert these numbers to binary, you will see they range between
 10000000 to 11111111..... that is, the first number (MSB or most significant bit) is always a one.
This is how it knows its a Command byte.
These include things like note on, note off, pitch bend, aftertouch, continuous controller, channel pressure, .

Data bytes are always less than 127, or 0x00 to 0x7F in hex. 
If you convert these numbers to binary, you will see they range between
 00000000 to 01111111..... that is, the first number (MSB or most significant bit) is always a zero.
This is how it knows its a Data byte.
These include things like Pitch, Velocity , pitch bend amount & loudness.

MIDI commands are further broken down by the following system:

The first half of the MIDI command byte (the three bits following the MSB) sets the type of command. More info about the meaning on each of these commands is here.
10000000 = note off
10010000 = note on
10100000 = aftertouch
10110000 = continuous controller
11000000 = patch change
11010000 = channel pressure
11100000 = pitch bend
11110000 = non-musical commands

The last half of the command byte sets the MIDI channel. All the bytes listed above would be in channel 0, command bytes ending in 0001 would be for MIDI channel 1, and so on.

All MIDI messages start with a command byte, some messages contain one data byte, others contain two or more (see image above). For example, a note on command byte is followed by two data bytes: note and velocity.

--------------------------------------------------------------
Getting back to building the counter.
 This is a simple binary counter.
Just 4 LEDS., 4 resistors(330 ohms).
We use 4 digital pins.
Pretty basic, so a great learning tool.
 
Make sure that the longer lead (positive) of each LED is the one you connect to the Arduino pin and that the resistors connect the shorter lead (negative) to the GND rail.
 
I'll use digital pins 2, 3, 4, 5 
 
--------------------------------------------------------------

This is the initial code to test that the circuit works:
All 4 LEDs should light up

// variables
int pin2=2;
int pin3=3;
int pin4=4;
int pin5=5;  

void setup()
{
  // commands
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pin4, OUTPUT);
  pinMode(pin5, OUTPUT);
}

void loop()
{
  // I want to step through each number from zero to 15
  // then I want to repeat
  digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
 
}
 

 
 --------------------------------------------------------------------------
 
The final code
Each number is written individually
This is really just an basic exercise on how to turn on/off LEDs in sequence.
A simple delay is added between each number
 
 
 
 // variables
int pin2=2;
int pin3=3;
int pin4=4;
int pin5=5;  
int waitTime=100;

void setup()
{
  // commands
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pin4, OUTPUT);
  pinMode(pin5, OUTPUT);
}

void loop()
{
  // I want to step through each number from zero to 15
  // then I want to repeat
 
  //0
  digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //1
  digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //2
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //3
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //4
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //5
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //6
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //7
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //8
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //9
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //10
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //11
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //12
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //13
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //14
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //15
  digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
}




Link
+ http://www.multiwingspan.co.uk/arduino.php?page=led5
 
 ---------------------------------
------------------------------------- 

Monday, 14 November 2016

3trins to banana breakout box


The 3trins mini patchbay is wonderful but at times difficult to see (esp in low light).
And I'm a big fan of bananas. .. they are stackable and fast.


My initial attempts were to build a permanent panel.
Soon ditched this in favour of one that I can plug in and remove when I like.


I'm using mini bananas:

Links:
https://www.muffwiggler.com/forum/viewtopic.php?p=2387506#2387506

Sunday, 13 November 2016

Step Edit - Electribe 2 (blue/grey)

 This is the method for editing individual steps in a pattern.
These are a bit like the per step parameter locks you will find on devices like
Electron synths
 
There are 4 types of edit available:

1. STEP Number
2. Note
3. Gate
4. Velocity
 
To enter STEP EDIT mode press
Menu/enter
Use the <    > till you get to STEP EDIT 
STEP EDIT is 24/28
 
 -------------------------------------------------
1. STEP Number
This Selects the step that you'll edit.
Range : . [1.01... 4.16]
 
Either turn the main value knob 
or press the target step (the 1-4 buttons select the bar)

It will be displayed like so:

Step : 1 : 01

1= first bar
01= first step 
 
----------------------------------------
 
2. Note
Specifies the note number of the target step
Range: {C-1...G 09]
Default : C 04
 You can record up to four note numbers in each target step.
 
-------------------------------------
 
3. GATE TIME
 This is the length of each step. 
For example, if the gate time is "96," the duration of the note is exactly as long as a single step.
 
Range:  [ 00...96, TIE]
 
If you specify "TIE," 
the oscillator, EG, and modulation are not retriggered if the next step has the same note 

-----------------------
 
4. Velocity
This is the strength of a note.

Range: [001...127]
 
 
 
 
 





Friday, 4 November 2016

TM1637 4-digit 7-segment display

There are many different display modules that use a TM1637 IC from Titan MicroElectronics.
The color, size, dots, and connection points can vary widely, but as long as they use the TM1637,
 most should work.
 

A naked  4-digit 7-segment display will use 12 pins on your arduino.
The TM1637 cuts this down to 4.
 

The 4 connections are 
VCC 5V/3.3V
GND
CLK (clock)
DIO (Data I/O)

CLK & DIO are connected to any arduino digital pins.
It's your choice.
 
Each display is actually a collection of 7 LEDs
The individual segments are labelled A to G
By setting each LED to high or low, we can turn them on/off
 
The TM1637 module includes four 0.36 segment 7-segment displays.
 
You’ll need to use a library or two.
 
Which one depends on the type of module you have.
Avishay Orpaz has written a great library for TM1637 displays, the TM1637Display library.  
 These require this compiler directive to be placed in your code:
// Include the library
#include <TM1637Display.h>

I have another TM display that uses the Grove library

You need to put this into your code:

// include the grove.seeedstudio library 
#include <TM1637.h> 
 And then define the pins
 
// Define the connections pins
#define CLK 2
#define DIO 3
 
Next, we need the function  
TM1637Display(). 
or
 TM1637 tm(2, 3);

This function requires two parameters:
the CLK pin and the the DIO pin.
TM1637Display display = TM1637Display(CLK, DIO);
OR 
 TM1637 tm(2, 3);
The code depends on the type of display you have.
Before you buy it, research what library it needs. 

The main functions include:

  • setSegments() – Set the raw value of the segments of each digit
  • showNumberDec() – Display a decimal number
  • showNumberDecEx() – Display a decimal number with decimal points or colon
  • setBrightness() – Set the brightness of the display
  • clear() – Clear the display
 Here is a simple display sketch.
It's actually the basic example in the ARDUINO IDE. 
 
These TM1637 Driver examples work well.
They all use the 
#include <TM1637.h> 
//************************** 
 code 1
This refers to displays that use the  #include <TM1637.h> library
To set the brightness, pass in a value between 0-7 into tm.setBrightness(); 
tm.display(); will display a character on the display. 
You are restricted to just 4 characters. 
Simply type in any alpha-numeric characters you wish. 
 

//*******************
#include <TM1637.h>


// Instantiation and pins configurations
// Pin 3 - > DIO
// Pin 2 - > CLK
TM1637 tm(2, 3);

void setup()
{
    tm.begin();
    tm.setBrightness(4);
}

void loop()
{
    // Display Integers:
    tm.display(1234);
    delay(1000);

    // Display float:
    tm.display(29.65);
    delay(1000);

    // Display String:
    tm.display("PLAY");
    delay(1000);
    tm.display("STOP");
    delay(1000);
}
//*******************************************************
  
Links
+ https://www.makerguides.com/tm1637-arduino-tutorial/
+ https://www.instructables.com/Tutorial-How-to-4-Digit-Display-Interface-With-Ard/ 
+ https://www.youtube.com/watch?v=6W7tycX-F1o&t=64s 
+ https://www.youtube.com/watch?v=l6QoGsdHzfM
 
 ---------------------------------
-------------------------------------

Monday, 31 October 2016