Inspiration for a design 
http://www.synthtopia.com/content/2011/ ... ontroller/
http://www.gforcesoftware.com/products/ ... Controller

[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Geo Synthesizer app for iOS 


[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
SPI ADC mcp3008 
http://www.esologic.com/?p=

http://hertaville.com/2013/07/24/interf ... i-using-c/


[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
i2c msp430g2553 example 
https://github.com/wendlers

[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
ST MBED code repositories 
https://mbed.org/teams/ST/code/
https://mbed.org/teams/ST/code/Nucleo_read_button_interrupt/

analog in does not work
http://mbed.org/questions/4420/Problem- ... -AnalogIn/
https://mbed.org/questions/4504/The-AnalogIn-function-doesnt-seem-to-wor/

[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
SMT Soldering 


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
parse midi messages 

// parse midi message
void receive_midi(void)
{
while( ( buf_input_ptr & 0x0f ) != ( buf_input_prc & 0x0f ) )
{
// a new byte arrived
buf_input_prc++; // pointer to processed data
midi_in = buf_input[ buf_input_prc & 0x0f ];

if( midi_in >> 7 )
{
midi_event = midi_in & 0xf0;
midi_channel = midi_in & 0x0f;
midi_in_data_cnt = 0;
midi_key = 0;
midi_velocity = 0;
}

if( midi_event != 0xf0 )
{
// increase the counter as we parse data

// ****************************
//
// Channel Voice Messages
//
// ****************************
switch( midi_event )
{
case NOTE_OFF_EVENT:
switch( midi_in_data_cnt )
{
case 0:
printf_lcd_fb( "NOTE_OFF_EVENT" );
break;
case 1:
// key = parse_key ( midi_in_data );
midi_key = midi_in;
break;
case 2:
midi_velocity = midi_in;
printf_lcd_fb( "NOTE_OFF_EVENT; \nev: %d ch: %d; \nkey: %d\nvel: %d", \
midi_event, midi_channel, midi_key, midi_velocity );
break;
default:
printf_lcd_fb( "NOTE_OFF_EVENT\nextra data?!\ngot %d bytes more", \
( midi_in_data_cnt - NOTE_OFF_EVENT_BC ) );
break;
}
midi_in_data_cnt++;
break;

case NOTE_ON_EVENT:
switch( midi_in_data_cnt )
{
case 0:
printf_lcd_fb( "NOTE_ON_EVENT" );
break;
case 1:
// key = parse_key ( midi_in_data );
midi_key = midi_in;
break;
case 2:
midi_velocity = midi_in;
printf_lcd_fb( "NOTE_ON_EVENT; \nev: %d ch: %d; \nkey: %d\nvel: %d", \
midi_event, midi_channel, midi_key, midi_velocity );
break;
default:
printf_lcd_fb( "NOTE_ON_EVENT\nextra data?!\ngot %d bytes more", \
( midi_in_data_cnt - NOTE_ON_EVENT_BC ) );
break;
}
midi_in_data_cnt++;
break;

case POLYPHONIC_KEY_PRESSURE:
//printf_lcd( "POLYPHONIC_KEY_PRESSURE: %d, %d", midi_event, midi_channel );
break;

case CONTROL_CHANGE:
printf_lcd( "CONTROL_CHANGE: %d, %d", midi_event, midi_channel );
break;

case PROGRAM_CHANGE:
printf_lcd( "PROGRAM_CHANGE: %d, %d", midi_event, midi_channel );
break;

case CHANNEL_PRESSURE:
printf_lcd( "CHANNEL_PRESSURE: %d, %d", midi_event, midi_channel );
break;

case PITCH_WHELL_CHANGE:
printf_lcd( "PITCH_WHELL_CHANGE: %d, %d", midi_event, midi_channel );
break;
}
} else
{
// ****************************
// System Common Messages
// System Real-Time Messages
// ****************************
switch( midi_event )
{
/*
case SYSTEM_EXCLUSIVE:
printf_lcd( "SYSTEM_EXCLUSIVE" );
break;

case MIDI_TIME_CODE_QUARTER_FRAME:
printf_lcd( "MIDI_TIME_CODE_QUARTER_FRAME" );
break;

case SONG_POSITION_POINTER:
printf_lcd( "SONG_POSITION_POINTER" );
break;

case SONG_SELECT:
printf_lcd( "SONG_SELECT" );
break;

case RESERVED1:
printf_lcd( "RESERVED1" );
break;

case RESERVED2:
printf_lcd( "RESERVED2" );
break;

case TUNE_REQUEST:
printf_lcd( "TUNE_REQUEST" );
break;

case END_OF_EXCLUSIVE:
printf_lcd( "END_OF_EXCLUSIVE" );
break;

case TIMING_CLOCK:
printf_lcd( "TIMING_CLOCK" );
break;

case UNDEFINED3:
printf_lcd( "UNDEFINED3" );
break;

case START:
printf_lcd( "START" );
break;

case CONTINUE:
printf_lcd( "CONTINUE" );
break;

case STOP:
printf_lcd( "STOP" );
break;

case UNDEFINED4:
printf_lcd( "UNDEFINED4" );
break;

case ACTIVE_SENSING:
printf_lcd( "ACTIVE_SENSING" );
break;

case RESET:
printf_lcd( "RESET" );
break;
*/
}
}
}
}


[ add comment ] ( 1 view )   |  [ 0 trackbacks ]   |  permalink
MIDI Code definitons 

// ****************************
// midi code definitions
// ****************************

// http://www.midi.org/techspecs/midimessages.php
// m s g e
// Channel Voice Messages c h n l
#define NOTE_OFF_EVENT BIN(1,0,0,0,0,0,0,0)
#define NOTE_OFF_EVENT_BC 2 // Note Off event.
// 0kkkkkkk + 0vvvvvvv
// This message is sent when a note is released (ended).
// (kkkkkkk) is the key (note) number. (vvvvvvv) is the velocity.

#define NOTE_ON_EVENT BIN(1,0,0,1,0,0,0,0)
#define NOTE_ON_EVENT_BC 2 // Note On event.
// 0kkkkkkk + 0vvvvvvv
// This message is sent when a note is depressed (start).
// (kkkkkkk) is the key (note) number. (vvvvvvv) is the velocity.

#define POLYPHONIC_KEY_PRESSURE BIN(1,0,1,0,0,0,0,0)
#define POLYPHONIC_KEY_PRESSURE_BC 2 // Polyphonic Key Pressure (Aftertouch).
// 0kkkkkkk + 0vvvvvvv
// This message is most often sent by pressing down on the
// key after it "bottoms out". (kkkkkkk) is the key (note)
// number. (vvvvvvv) is the pressure value.

#define CONTROL_CHANGE BIN(1,0,1,1,0,0,0,0)
#define CONTROL_CHANGE_BC 2 // Control Change.
// 0ccccccc + 0vvvvvvv
// This message is sent when a controller value changes.
// Controllers include devices such as pedals and levers.
// Controller numbers 120-127 are reserved as "Channel Mode
// Messages" (below). (ccccccc) is the controller number
// (0-119). (vvvvvvv) is the controller value (0-127).

#define PROGRAM_CHANGE BIN(1,1,0,0,0,0,0,0)
#define PROGRAM_CHANGE_BC 1 // Program Change.
// 0ppppppp
// This message sent when the patch number
// changes. (ppppppp) is the new program number.

#define CHANNEL_PRESSURE BIN(1,1,0,1,0,0,0,0)
#define CHANNEL_PRESSURE_BC 1 // Channel Pressure (After-touch).
// (vvvvvvv) is the pressure value.

#define PITCH_WHELL_CHANGE BIN(1,1,1,0,0,0,0,0)
#define PITCH_WHELL_CHANGE_BC 2 // Pitch Wheel Change.
// 0lllllll + 0mmmmmmm
// This message is sent to
// indicate a change in the pitch wheel. The pitch wheel is
// measured by a fourteen bit value. Center (no pitch change) is
// 2000H. Sensitivity is a function of the transmitter. (llllll) are
// the least significant 7 bits. (mmmmmm) are the most
// significant 7 bits.


// System Common Messages
#define SYSTEM_EXCLUSIVE BIN(1,1,1,1,0,0,0,0)
#define SYSTEM_EXCLUSIVE_BC 65535 // more complicated, not supported yet
// stream ends with END_OF_EXCLUSIVE.

#define MIDI_TIME_CODE_QUARTER_FRAME BIN(1,1,1,1,0,0,0,1)
#define MIDI_TIME_CODE_QUARTER_FRAME_BC 1 // 0nnndddd, where:
// nnn = Message Type
// dddd = Values

#define SONG_POSITION_POINTER BIN(1,1,1,1,0,0,1,0)
#define SONG_POSITION_POINTER_BC 2 // 0lllllll + 0mmmmmmm
// 14 bit register, l is the LSB, m the MSB

#define SONG_SELECT BIN(1,1,1,1,0,0,1,1)
#define SONG_SELECT_BC 1 // 0sssssss
// (sssssss) specifies which sequence
// or song is to be played.

#define RESERVED1 BIN(1,1,1,1,0,1,0,0)
#define RESERVED1_BC 0

#define RESERVED2 BIN(1,1,1,1,0,1,0,1)
#define RESERVED2_BC 0

#define TUNE_REQUEST BIN(1,1,1,1,0,1,1,0) // Tune Request.
// Upon receiving a Tune Request,
// all analog synthesizers should
// tune their oscillators.
#define TUNE_REQUEST_BC 0

#define END_OF_EXCLUSIVE BIN(1,1,1,1,0,1,1,1) // End of Exclusive. Used to terminate
#define END_OF_EXCLUSIVE_BC 0


// a System Exclusive dump (see above).
// System Real-Time Messages
#define TIMING_CLOCK BIN(1,1,1,1,1,0,0,0)
#define TIMING_CLOCK_BC 0 // Timing Clock. Sent 24 times per quarter note when
// synchronization is required (see text).

#define UNDEFINED3 BIN(1,1,1,1,1,0,0,1)
#define UNDEFINED3_BC 0

#define START BIN(1,1,1,1,1,0,1,0)
#define START_BC 0 // Start. Start the current sequence playing. (This message will
// be followed with Timing Clocks).

#define CONTINUE BIN(1,1,1,1,1,0,1,1)
#define CONTINUE_BC 0 // Continue. Continue at the point the sequence was Stopped.

#define STOP BIN(1,1,1,1,1,1,0,0)
#define STOP_BC 0 // Stop. Stop the current sequence.

#define UNDEFINED4 BIN(1,1,1,1,1,1,0,1)
#define UNDEFINED4_BC Undefined. (Reserved)

#define ACTIVE_SENSING BIN(1,1,1,1,1,1,1,0)
#define ACTIVE_SENSING_BC 0 // Active Sensing. This message is intended to be sent
// repeatedly to tell the receiver that a connection is alive. Use of
// this message is optional. When initially received, the receiver
// will expect to receive another Active Sensing message each
// 300ms (max), and if it does not then it will assume that the
// connection has been terminated. At termination, the receiver
// will turn off all voices and return to normal (non- active
// sensing) operation.

#define RESET BIN(1,1,1,1,1,1,1,1)
#define RESET_BC 0 // Reset. Reset all receivers in the system to power-up status.
// This should be used sparingly, preferably under manual
// control. In particular, it should not be sent on power-up.


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
static int  
static int state = 0;

So if you need a variable that is only used within a function and only updated by that function and you need the value of that variable to remain for the next time that you call the function then you need to define it as a static variable.

[ add comment ]   |  [ 0 trackbacks ]   |  permalink
TI Series Launchpads 
http://www.ti.com/ww/en/launchpad/launchpad.html

[ 1 comment ] ( 6 views )   |  [ 0 trackbacks ]   |  permalink  |  related link

<<First <Back | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Next> Last>>