Close
0%
0%

Synchronia♥Duet

Synchronia♥Duet, a Musical Instrument built for two!

Similar projects worth following
305 views
0 followers
It takes a great deal of time and practice for two people to play music together, especially if they are not well trained in the musical arts. Enter the Synchronia♥Duet. By introducing the concept of a two linked keyboards, musically arranged in an 3D Matrix (Harmony vs. Time/Melody vs. Time), the instrument takes advantage of the division of labor, assigning one job to one player, coordinating and combining their efforts into one unified musical output. Watch the demo at https://www.youtube.com/watch?v=9EVpVKju1uM

PSUEDOCODE
==========

'----------------------------
'  Synchronia--Duet 0.0.7
' (C)2018 Thomas R. Mahanna
'----------------------------

'CONFIGURE HARDWARE I/O (ATMEGA2560 in the Case of the Prototype)

'Configure Communication

Open Serial1 For Binary As #0		'Serial Connection to PC
Open Serial2 For Binary As #1           'MIDI Out / QUNexus In
Open Serial3 For Binary As #2           'UNZTRUMENT I/O

'DIMESION VARIABLES

'Serial Input Variables

Dim SerialInbyte As Byte
Dim SerialFlag As Bit
Dim QuNexusInbyte As Byte
Dim QuNexusFlag As Bit
Dim UntzInbyte As Byte
Dim UntzFlag As Bit

'MIDI Variables

Dim MIDICh as byte
Dim Timbre as Byte
Dim Status As Byte
Dim Data1 As Byte
Dim Data2 As Byte
Dim StrumDelay As Byte
Dim ChordArray(4) as Byte
Dim ScaleArray(5) as Byte
Dim Vel as Byte
Dim Pedal as bit
Dim Notes(5) as Byte

'Main Variables

Dim I As Byte
Dim ChordType As Byte
Dim OldChord As Byte
Dim Root As Byte
Dim OldRoot As Byte
Dim OldChordButton As Byte
Dim OldRootButton As Byte
Dim ButtonHold As Bit
Dim Offset as Byte
Dim Temp as byte

'DEFINE IRQ HANDLERS

On Serial1 PCSerial_isr
On Serial2 Qunexus_isr
On Serial3 Untz_isr

'ENABLE INTERRUPTS

Enable IRQ0
Enable IRQ1
Enable IRQ2
Enable Global Interrupts

'DEFINE / DECLARE SUBROUTINES

Declare Sub Midiout(byval Ch As Byte , Byval Note As Byte , Byval Vel As Byte)
Declare Sub Midipatch(byval Ch As Byte , Byval Patch As Byte)
Declare Sub Mastervolume(byval Vol As Byte)
Declare Sub Allnotesoff
Declare Sub ProcessUntzButton

'MAIN

' Entering Main Loop

For I = 0 To 15
   SerialOut #2 , I                      'All Chord Buttons Off
   Waitms 1
Next

For I = 76 To 79
   SerialOut #2 , I
   Waitms 1
Next

For I = 92 To 95
  SerialOut #2 , I
  Waitms 1
Next

For I = 108 To 111
   SerialOut #2 , I                      'All Trellis Root Buttons Off
   Waitms 1
Next

Chordtype = 0
SerialOut #2 , 140
OldChordButton = 12

Root = 0
SerialOut #2 , 204
OldRootButton = 76
Offset = 48                             'Octave 4 * 12

Call ProcessUntzButton

MIDICh = 1                              'Set MIDI Output Channel
Timbre = 0                              'GM Piano [0]
Vel = 96                                'Velocity
StrumDelay = 40                         'Spread Between Notes (mS)
Pedal = 1                               'Pedal off

SerialOut #1 , &HB0
SerialOut #1 , &H7B
SerialOut #1 , &H00                      'All Notes Off

SerialOut #1 , 176
SerialOut #1 , 7
SerialOut #1 , 64                        'Set Volume to 96

Call Mastervolume(64)                   'Set Volume to 96
Call Midipatch(midich , Timbre)         'Change MIDI Intrument Timbre

Do
   '// PROCESS UNTZTRUMENT
   If UntzFlag = 1 Then
      Select Case UntzInbyte

      '// Button Release
            Case 12
               ButtonHold = 0
            Case 13
               ButtonHold = 0
            Case 14
               ButtonHold = 0
            Case 15
               ButtonHold = 0

            Case 16 to 127
               If Pedal = 0 then
                  Call MIDIOut(MIDICh , ChordArray(1) , 0)
                  Call MIDIOut(MIDICh , ChordArray(2) , 0)
                  Call MIDIOut(MIDICh , ChordArray(3) , 0)
                  Call MIDIOut(MIDICh , ChordArray(4) , 0)
               End If

      '// Chord Selection
           Case 140
               Chordtype = 0            'Major
               SerialOut #2 , OldChordButton       'Turn old chordtype button off
               SerialOut #2 , UntzInbyte 'Turn new chordtype button on
                If UntzInbyte > 127 Then
                  OldChordButton = UntzInbyte - 128
               Else
                  OldChordButton = UntzInbyte
               End If
               Buttonhold = 1
               Call ProcessUntzButton
           Case 141
               Chordtype = 1            'Minor
               SerialOut #2 , OldChordButton       'Turn old chordtype button off
               SerialOut #2 , UntzInbyte 'Turn new chordtype button on
               If UntzInbyte > 127 Then
                  OldChordButton = UntzInbyte - 128
               Else
                  OldChordButton = UntzInbyte
               End If
               Buttonhold = 1
           Case 142
               Chordtype = 2            'Sus4
               SerialOut #2 , OldChordButton       'Turn old chordtype button off
               SerialOut #2 , UntzInbyte 'Turn new chordtype button on
               If UntzInbyte > 127 Then
                  OldChordButton = UntzInbyte - 128
               Else
                  OldChordButton = UntzInbyte
               End If
               Buttonhold = 1
           Case 143
               Chordtype = 3            'Dom7
               SerialOut #2 , OldChordButton       'Turn old chordtype button off
               SerialOut #2 , UntzInbyte 'Turn new chordtype button on
               If UntzInbyte > 127 Then
                  OldChordButton = UntzInbyte - 128
               Else
                  OldChordButton = UntzInbyte
               End If
               Buttonhold = 1

           '// Root Selection
           Case 204
               SerialOut #2 , OldRootButton       'Turn old root button off
               SerialOut #2 , UntzInbyte 'Turn new root button on
 Root = 0 'Root...
Read more »

Pseudocode.txt

The Following is a pseudocode listing of the Synchronia-Duet Firmware. It can be readily adapted to any compiler.

plain - 22.22 kB - 10/05/2018 at 12:03

Download

  • 1 × Adafruit HELLA UNTZtrument!
  • 1 × ARDUINO Mega256
  • 1 × Sparkfun Musical Instrument Shield
  • 1 × Sparkfun MIDI Shield
  • 1 × McMillen QuNexus MIDI Keyboard

View all 6 components

  • Project Log 10/6/2018

    Thomas R. Mahanna10/06/2018 at 08:30 0 comments

    Project Log 10/6/2018

    ===================

    Here is a block diagram of the Synchronia♥Duet:

    The CPU (ATMEGA2560) has 4 Serial I/O Ports. Comm1 is connected to the PC via USB. Comm2 Input is connected to the MELODY KEYBOARD while Comm2 Output shuttles DATA to the MIDI Out Port. Comm3 i/o communicates with the Harmony Keyboard, an Adafruit HELLA Untztrument.

  • PSEUDOCODE For Synchronia♥Duet Firmware

    Thomas R. Mahanna10/05/2018 at 14:09 0 comments

    The Following is a pseudocode listing of the Synchronia-Duet Firmware. It can be readily adapted to any compiler.
    
    
    PSEUDOCODE
    ==========
    
    '----------------------------
    '  Synchronia--Duet 0.0.7
    ' (C)2018 Thomas R. Mahanna
    '----------------------------
    
    'CONFIGURE HARDWARE I/O (ATMEGA2560 in the Case of the Prototype)
    
    'Configure Communication
    
    Open Serial1 For Binary As #0		'Serial Connection to PC
    Open Serial2 For Binary As #1           'MIDI Out / QUNexus In
    Open Serial3 For Binary As #2           'UNZTRUMENT I/O
    
    'DIMESION VARIABLES
    
    'Serial Input Variables
    
    Dim SerialInbyte As Byte
    Dim SerialFlag As Bit
    Dim QuNexusInbyte As Byte
    Dim QuNexusFlag As Bit
    Dim UntzInbyte As Byte
    Dim UntzFlag As Bit
    
    'MIDI Variables
    
    Dim MIDICh as byte
    Dim Timbre as Byte
    Dim Status As Byte
    Dim Data1 As Byte
    Dim Data2 As Byte
    Dim StrumDelay As Byte
    Dim ChordArray(4) as Byte
    Dim ScaleArray(5) as Byte
    Dim Vel as Byte
    Dim Pedal as bit
    Dim Notes(5) as Byte
    
    'Main Variables
    
    Dim I As Byte
    Dim ChordType As Byte
    Dim OldChord As Byte
    Dim Root As Byte
    Dim OldRoot As Byte
    Dim OldChordButton As Byte
    Dim OldRootButton As Byte
    Dim ButtonHold As Bit
    Dim Offset as Byte
    Dim Temp as byte
    
    'DEFINE IRQ HANDLERS
    
    On Serial1 PCSerial_isr
    On Serial2 Qunexus_isr
    On Serial3 Untz_isr
    
    'ENABLE INTERRUPTS
    
    Enable IRQ0
    Enable IRQ1
    Enable IRQ2
    Enable Global Interrupts
    
    'DEFINE / DECLARE SUBROUTINES
    
    Declare Sub Midiout(byval Ch As Byte , Byval Note As Byte , Byval Vel As Byte)
    Declare Sub Midipatch(byval Ch As Byte , Byval Patch As Byte)
    Declare Sub Mastervolume(byval Vol As Byte)
    Declare Sub Allnotesoff
    Declare Sub ProcessUntzButton
    
    'MAIN
    
    ' Entering Main Loop
    
    For I = 0 To 15   SerialOut #2 , I                      'All Chord Buttons Off   Waitms 1
    Next
    
    For I = 76 To 79   SerialOut #2 , I   Waitms 1
    Next
    
    For I = 92 To 95  SerialOut #2 , I  Waitms 1
    Next
    
    For I = 108 To 111   SerialOut #2 , I                      'All Trellis Root Buttons Off   Waitms 1
    Next
    
    Chordtype = 0
    SerialOut #2 , 140
    OldChordButton = 12
    
    Root = 0
    SerialOut #2 , 204
    OldRootButton = 76
    Offset = 48                             'Octave 4 * 12
    
    Call ProcessUntzButton
    
    MIDICh = 1                              'Set MIDI Output Channel
    Timbre = 0                              'GM Piano [0]
    Vel = 96                                'Velocity
    StrumDelay = 40                         'Spread Between Notes (mS)
    Pedal = 1                               'Pedal off
    
    SerialOut #1 , &HB0
    SerialOut #1 , &H7B
    SerialOut #1 , &H00                      'All Notes Off
    
    SerialOut #1 , 176
    SerialOut #1 , 7
    SerialOut #1 , 64                        'Set Volume to 96
    
    Call Mastervolume(64)                   'Set Volume to 96
    Call Midipatch(midich , Timbre)         'Change MIDI Intrument Timbre
    
    Do   '// PROCESS UNTZTRUMENT   If UntzFlag = 1 Then      Select Case UntzInbyte
          '// Button Release            Case 12               ButtonHold = 0            Case 13               ButtonHold = 0            Case 14               ButtonHold = 0            Case 15               ButtonHold = 0
                Case 16 to 127               If Pedal = 0 then                  Call MIDIOut(MIDICh , ChordArray(1) , 0)                  Call MIDIOut(MIDICh , ChordArray(2) , 0)                  Call MIDIOut(MIDICh , ChordArray(3) , 0)                  Call MIDIOut(MIDICh , ChordArray(4) , 0)               End If
          '// Chord Selection           Case 140               Chordtype = 0            'Major               SerialOut #2 , OldChordButton       'Turn old chordtype button off               SerialOut #2 , UntzInbyte 'Turn new chordtype button on                If UntzInbyte > 127 Then                  OldChordButton = UntzInbyte - 128               Else                  OldChordButton = UntzInbyte               End If               Buttonhold = 1               Call ProcessUntzButton           Case 141               Chordtype = 1            'Minor               SerialOut #2 , OldChordButton       'Turn old chordtype button off               SerialOut #2 , UntzInbyte 'Turn new chordtype button on               If UntzInbyte > 127 Then                  OldChordButton = UntzInbyte - 128               Else                  OldChordButton = UntzInbyte               End If               Buttonhold = 1           Case 142               Chordtype = 2            'Sus4               SerialOut #2 , OldChordButton       'Turn old chordtype button off               SerialOut #2 , UntzInbyte 'Turn new chordtype button on               If UntzInbyte > 127 Then                  OldChordButton = UntzInbyte - 128               Else                  OldChordButton = UntzInbyte               End If               Buttonhold = 1           Case 143               Chordtype = 3            'Dom7               SerialOut #2 , OldChordButton       'Turn old chordtype button off               SerialOut #2 , UntzInbyte 'Turn new chordtype button on               If UntzInbyte > 127 Then                  OldChordButton = UntzInbyte - 128               Else                  OldChordButton = UntzInbyte               End If               Buttonhold = 1
     '// Root Selection Case 204 SerialOut #2 , OldRootButton 'Turn old root button off SerialOut #2 , UntzInbyte...
    Read more »

  • Project Log 10/4/2018

    Thomas R. Mahanna10/05/2018 at 12:06 0 comments

    • Project Log 10/4/2018

      ==================

      Here is a chart of the layout of the Synchronia♥Duet Harmony Keyboard:

      Holding down the M key sets the keyboard for Major Chords, m for Minor Chords, etc. The left hand would press the M, m, S4, D7 (up for higher octave) and the right hand would select the Root note from the bottom row (C - B) and the Inversion on the Y-Axis. Holding down the M, m, S4, D7 would actually sound the chord, so press and release the M, m, S4, D7 if you just want to choose it without playing it.

      The Melody Keyboard layout:

      in the case that a C Major chord (Root Inversion) was selected, would be mapped as above. The lower keys would sound four cotaves of the open chord notes and the upper keys would sound two octaves of the associated minor pentatonic scale for soloing.

    • Project Log 10/3/2018

      a day ago 0 comments

      Project Log 10/3/2018

      ==================

      I've been really busy lately and almost forgot about this project. Thanks to Stephen Tranovich for reminding me to update it.

      The Synchronia♥Duet is my attempt at solving the problem of creating a musical instrument that utilizes the unique talents of two instrumentalists, playing in concert. It achieves it's end by uniting two keyboards in a 3D Matrix (Harmony / Melody / Time) with the Harmony Keyboardist choosing the musical space in which the melody keyboardist is playing.

      In the video example, the Harmony Keyboardist is playing a simple repeating  I / iii / IV / iii  ( C / D# / F / D#) chord progression. The software reads the Harmony Keyboard and, depending on the whether the Harmony Keyboardist is holding down the <Chord Type> selctor key, strums the chord. The Melody Keyboard is dynamically remapped (with the lower keys representing the selected chord notes (C E G, D# G A#, F A C, etc) in multiple octaves and the upper keys representing two octaves of the associated Minor Pentatonic Scale A C D E G, C D# F G A#, D F G A C).

  • Project Log 10/3/2018

    Thomas R. Mahanna10/05/2018 at 12:05 0 comments

    Project Log 10/3/2018

    ==================

    I've been really busy lately and almost forgot about this project. Thanks to Stephen Tranovich for reminding me to update it.

    The Synchronia♥Duet is my attempt at solving the problem of creating a musical instrument that utilizes the unique talents of two instrumentalists, playing in concert. It achieves it's end by uniting two keyboards in a 3D Matrix (Harmony / Melody / Time) with the Harmony Keyboardist choosing the musical space in which the melody keyboardist is playing.

    In the video example, the Harmony Keyboardist is playing a simple repeating  I / iii / IV / iii  ( C / D# / F / D#) chord progression. The software reads the Harmony Keyboard and, depending on the whether the Harmony Keyboardist is holding down the <Chord Type> selctor key, strums the chord. The Melody Keyboard is dynamically remapped (with the lower keys representing the selected chord notes (C E G, D# G A#, F A C, etc) in multiple octaves and the upper keys representing two octaves of the associated Minor Pentatonic Scale A C D E G, C D# F G A#, D F G A C).

    Share

View all 4 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates