Guitar-to-MIDI project article

Started by Mark Hammer, November 02, 2009, 01:07:26 PM

Previous topic - Next topic

Diodac


Written I have made changes to the hardware, and also in the code. Later describe more because at the moment I do not have time.

potul


deadastronaut

https://www.youtube.com/user/100roberthenry
https://deadastronaut.wixsite.com/effects

chasm reverb/tremshifter/faze filter/abductor II delay/timestream reverb/dreamtime delay/skinwalker hi gain dist/black triangle OD/ nano drums/space patrol fuzz//

Diodac

The changes that I made in the code
Setup

        PAGE1
MOVLW B'01101100'
MOVWF OSCCON ;INTERNAL OSC SET TO 8MHZ


Waveform Peak Level Detection,   line 222  change to 250

;--- WAVEFORM PEAK LEVEL DETECTION ---

PEAKS
CLRF PEAKH
MOVLW 255
MOVWF PEAKL
MOVLW 4
MOVWF DELAY1
CL2 MOVLW 250
MOVWF DELAY2


Turn on line 439

;Insert here code to keep tracking frequency

CALL    NOTE_CHANGE
movwf TEMP
btfss TEMP,0
    GOTO NOTE_OFF ;KEEP READING ADC
BCF MARKER,0 ;AMPLITUDE DETECTION ACTIVE
goto NEXT2


Later I will update hardware changes. Although I would prefer to wait until the end of the experiments and publish all in one thread. In order not to make a mess in the topic  :icon_biggrin:

potul

#164
Some comments regarding the code change:

The last one, the "amplitude detectio active".... Looks OK. I remember I put this line of code thinking it should work but I had some issues with the LEDs not working as expeted and I commented the line. But... if it now works, great.

Regarding the OSC change, I'm a little puzzled here.You changed the system frequency to 8Mhz, but you did not change the TMR1 prescaler, so at the end the timer is running at double speed. Are you getting the notes in the correct octave? I would expect that everything is now one octave low.
On the other hand, I don't see much benefit in increasing the frequency without adding something else, ... you gain some ADC resolution, so you will probably improve something in the higher notes, but that's it.

And, you didn't change most of the delays in the code, so now everything is happening in half of the time. I see you increase a little the delay when detecting amplitude, but only around 25%. This means that now your amplitude detection range is around 15ms... If it works this way, great! But I would expect some issues with pulse and velocity detection for the lower notes because you are not waiting for a full note period.
There are some other delays in the project that control somehow how long to wait until deciding that the note detection failed. These are now half of the time, so you might have issues with notes not detected (too soon)


Diodac

Not quite done as I would like, I'm not sure the correct values​​. Especially in raising the 8Mzh.
Some errors happen.
You could share scraps properly revised code? Would be the a reference point. :D

Diodac

Small update:
- Separation of the ground and power supply for the digital part and the analog signal quality has improved much. Gone interference.
Still ongoing experiments using active lowpass filters MAX Linear Technology Series, LTC and various high quality Op-Amp.

Although I now have less time to design and writing of the work in progress. After Xmas write that filter worked best and I will add an updated schematic.

Diodac

#167
So far the best working version of B2M or G2M

https://drive.google.com/file/d/0B54jdI_xntNTT1JPSDZQOHBUSms/edit?usp=sharing

As can be seen above I made major changes. I invite colleagues to test the system.

I test yet 3 other projects and I finish testing I'll report.

I think that when Potul will optimize the code by which we discussed will be full of happiness.

Regarding the polyphonic
Potul advised to do it at a faster processor. I do not really feel up to do it. I have no such knowledge.

At the beginning I thought  do six parallel systems and combine them into one MIDI output. I see how this will work as a polyphonic system.

I wonder how to connect the 6 inputs to one output, all on channel 1
I use the gate AND - CD4073B in a way as in the attached diagram.

https://drive.google.com/file/d/0B54jdI_xntNTR3M5cERjSm14NEU/edit?usp=sharing

Does it have a chance to work properly? Is the unused pin 12 connect to ground?

How about it?

potul

This midi merger will not work. Midi is a stream of serial data, you can't simply connect the outputs because the messages will be scambled. You need some sort of intelligence here (pic or similar) to read the messages, and then send them into a single output.

This is one of the reasons I told you I think it's much better to do this with a sinbgle unit. This way you don't have to merge because all messages are genetared by a single PIC.

Diodac

The idea of using the AND gate someone suggested to connect a MIDI (found on the internet) but seems to me that it will not work.

Using single PIC is the best idea.
I thought about 16F886 because it has more ADC.
16F88 is 7 ADC it would be enough, but the project B2M, the PIC has already occupied 4 ADC:

AN2 AN3 - enter of voltage. (It seems necessary, might be able to move to other pins?)
AN1 - designed for GLIDE
AN4 - audio input

Remains of 3 ADCs, bass 4 strings can be done. I still have a 6 string bass and guitar.
I would like to make these instruments polyphonic MIDI.
Here I have a problem because they lack the ADC.
Potul see any way out other than the use of a PIC with more ADC?

Diodac

I would try first MIDI Merger 6IN to 1OUT.
Processing of the code so that single PIC controlled and sent is to do, but it seems to me difficult.
Besides the option to 6 controllers has one serious advantage for each string, you can customize the code. Perhaps ..

I found a cool project MIDI Merger, 2IN 1 OUT is also on the PIC16F88. This can be extended to 6 IN.
; $Id: main.asm 224 2008-03-27 19:53:03Z tk $
;
; Source Code of MIDI Merger

; ==========================================================================
;
;  Copyright 2003-2008 Thorsten Klose (tk@midibox.org)
;  Licensed for personal non-commercial use only.
;  All other rights reserved.
;
; ==========================================================================

#include "midibox.h"
#include "macros.inc"

; ==========================================================================
; Explanations of the include files
;
;  CODE PAGE #0
;    midibox.h:    A lot of flags, defines, register locations
;    macros.h:     my private macros
;    reset.inc:    reset handler
;    irq.inc:      interrupt handler, the MIDI IN part
;    init.inc:    various initialization routines
;    midi.inc:    Send and Learn MIDI
;    mainloop.inc: The MIDI Receive Handler
; ==========================================================================

;; org in include file
#include "reset.inc"
#include "irq.inc"
#include "init.inc"
#include "midi.inc"

Start
call Init
#include "mainloop.inc"

org 0x0700
#include "contab.inc"

;; ==========================================================================

END



I add a diagram where I plan another entry, is also a code that supports 2 IN.



Colleagues, as you do on 6 IN? I have no idea..

potul

Hi

Can you give us the link of this midi merger project? I need to check if it is using the internal USART or bit banging... And I need to review the full code.

Mat

potul

Quote from: Diodac on December 28, 2013, 04:01:53 AM
The idea of using the AND gate someone suggested to connect a MIDI (found on the internet) but seems to me that it will not work.

Using single PIC is the best idea.
I thought about 16F886 because it has more ADC.
16F88 is 7 ADC it would be enough, but the project B2M, the PIC has already occupied 4 ADC:

AN2 AN3 - enter of voltage. (It seems necessary, might be able to move to other pins?)
AN1 - designed for GLIDE
AN4 - audio input


Oh... you are right... I forgot agbout the reference voltages in AN2 and AN3.... I'm not completely sure they are needed indeed... maybe we could do it without them. We might lose some ADC resolution, but at the end we are more interested in the frequency than in amplitude...

Diodac



a link to the draft merger: http://www.ucapps.de/midimerger.html

Well, there are reference voltage must remain there.

It remains to migrate to larger PIC or merger.

For me the merger is a better option because it will allow each PIC and code set individually for strings. In one MCU is difficult to achieve. It requires a lot of new code.





Freppo

Hi there folks

I built this one yesterday (the original projects with a mods suggested here). Works wonderfully. :)

Here is a verified vero layout that I made


cheers
/ Freppo
Check out my building blog at www.parasitstudio.se

potul


jishnudg

Quote from: Freppo on June 12, 2014, 04:13:39 AM
Hi there folks

I built this one yesterday (the original projects with a mods suggested here). Works wonderfully. :)

Here is a verified vero layout that I made


cheers
/ Freppo



Thanks Freppo!  could you also put up a link to the files and schematics you have been used for this build? I'd like to make a few different folders on my PC for all the verified builds for this project, just to compare.

jishnudg

Quote from: Diodac on December 27, 2013, 08:18:38 AM
So far the best working version of B2M or G2M

https://drive.google.com/file/d/0B54jdI_xntNTT1JPSDZQOHBUSms/edit?usp=sharing

As can be seen above I made major changes. I invite colleagues to test the system.

I test yet 3 other projects and I finish testing I'll report.

I think that when Potul will optimize the code by which we discussed will be full of happiness.

Regarding the polyphonic
Potul advised to do it at a faster processor. I do not really feel up to do it. I have no such knowledge.

At the beginning I thought  do six parallel systems and combine them into one MIDI output. I see how this will work as a polyphonic system.

I wonder how to connect the 6 inputs to one output, all on channel 1
I use the gate AND - CD4073B in a way as in the attached diagram.

https://drive.google.com/file/d/0B54jdI_xntNTR3M5cERjSm14NEU/edit?usp=sharing

Does it have a chance to work properly? Is the unused pin 12 connect to ground?

How about it?



Diodac, regarding your link,  https://drive.google.com/file/d/0B54jdI_xntNTT1JPSDZQOHBUSms/edit?usp=sharing

Is this verified? Are there significant changes to the HEX files as well?

markeprice

Did the Vero/strip board version work well?  Is it polyphonic?

potul

It is NOT polyphonic.
Accordig to Freppo the stripboard layout is verified..
Mine is built with stripboard but with another layout, so I can't tell personally.

Mat