Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Erik Strand
attiny44a_blink
Commits
f736b4e0
Commit
f736b4e0
authored
Nov 14, 2018
by
Erik Strand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up midi test
parent
cf382268
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
81 deletions
+5
-81
midi_test.c
midi_test.c
+5
-81
No files found.
midi_test.c
View file @
f736b4e0
//
//
sampler
.c
//
midi_test
.c
// based on hello.ftdi.44.echo.c
//
// 115200 baud FTDI
character echo, with flash string
// 115200 baud FTDI
MIDI controller
//
// set lfuse to 0x5E for 20 MHz xtal
//
// Neil Gershenfeld
// 12/8/10
// Erik Strand
// 11/
6
/2018
// 11/
13
/2018
//
// (c) Massachusetts Institute of Technology 2010
// This work may be reproduced, modified, distributed,
...
...
@@ -29,7 +29,6 @@
#define pin_test(pins,pin) (pins & pin) // test for port pin
#define bit_test(byte,bit) (byte & (1 << bit)) // test for bit set
#define bit_delay_time 8.4 // bit delay for 115200 with overhead
//#define bit_delay_time 31.82 // bit delay for 31250 with overhead
#define bit_delay() _delay_us(bit_delay_time) // RS232 bit delay
#define half_bit_delay() _delay_us(bit_delay_time/2) // RS232 half bit delay
#define char_delay() _delay_ms(10) // char delay
...
...
@@ -132,46 +131,7 @@ int main(void) {
// 120 ticks per quarter note
const
struct
MidiEvent
events
[]
=
{
// Stagefright
/*
{0, note_on, 40, 100},
{60, note_off, 40, 100},
{60, note_on, 40, 100},
{120, note_off, 40, 100},
{120, note_on, 40, 100},
{180, note_off, 40, 100},
{180, note_on, 42, 100},
{240, note_off, 42, 100},
{240, note_on, 43, 100},
{300, note_off, 43, 100},
{300, note_on, 43, 100},
{360, note_off, 43, 100},
{360, note_on, 44, 100},
{420, note_off, 44, 100},
{420, note_on, 44, 100},
{480, note_off, 44, 100},
//{480, note_on, 45, 100},
//{540, note_off, 45, 100},
{540, note_on, 45, 100},
{600, note_off, 45, 100},
{600, note_on, 45, 100},
{660, note_off, 45, 100},
{660, note_on, 47, 100},
{720, note_off, 47, 100},
{720, note_on, 48, 100},
{780, note_off, 48, 100},
{780, note_on, 48, 100},
{840, note_off, 48, 100},
{840, note_on, 51, 100},
{900, note_off, 51, 100},
{900, note_on, 51, 100},
{960, note_off, 51, 100},
*/
// Bb
// Bb major 7
{
0
,
note_on
,
58
,
100
},
{
30
,
note_on
,
62
,
100
},
{
60
,
note_on
,
65
,
100
},
...
...
@@ -181,34 +141,7 @@ int main(void) {
{
180
,
note_off
,
62
,
100
},
{
180
,
note_off
,
58
,
100
},
{
240
+
0
,
note_on
,
58
,
100
},
{
240
+
30
,
note_on
,
61
,
100
},
{
240
+
60
,
note_on
,
64
,
100
},
{
240
+
90
,
note_on
,
67
,
100
},
{
240
+
180
,
note_off
,
67
,
100
},
{
240
+
180
,
note_off
,
64
,
100
},
{
240
+
180
,
note_off
,
61
,
100
},
{
240
+
180
,
note_off
,
58
,
100
},
{
480
+
0
,
note_on
,
60
,
100
},
{
480
+
30
,
note_on
,
64
,
100
},
{
480
+
60
,
note_on
,
65
,
100
},
{
480
+
90
,
note_on
,
69
,
100
},
{
480
+
180
,
note_off
,
69
,
100
},
{
480
+
180
,
note_off
,
65
,
100
},
{
480
+
180
,
note_off
,
64
,
100
},
{
480
+
180
,
note_off
,
60
,
100
},
{
720
+
0
,
note_on
,
60
,
100
},
{
720
+
30
,
note_on
,
63
,
100
},
{
720
+
60
,
note_on
,
65
,
100
},
{
720
+
90
,
note_on
,
69
,
100
},
{
720
+
180
,
note_off
,
69
,
100
},
{
720
+
180
,
note_off
,
65
,
100
},
{
720
+
180
,
note_off
,
63
,
100
},
{
720
+
180
,
note_off
,
60
,
100
},
// sentinel
// sentinel event
{
65535
,
note_off
,
50
,
100
},
};
...
...
@@ -229,15 +162,6 @@ int main(void) {
current_tick
=
0
;
event_index
=
0
;
PORTB
^=
led_pin
;
/*
while (events[event_index].tick <= current_tick) {
put_char(&serial_port, serial_pin_out, events[event_index].status);
put_char(&serial_port, serial_pin_out, events[event_index].note);
put_char(&serial_port, serial_pin_out, events[event_index].velocity);
++event_index;
}
*/
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment