electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Assembler Code, help needed (ATTiny85 midi to CV&GATE)
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
beep



Joined: May 05, 2013
Posts: 105
Location: Germany

PostPosted: Thu Apr 12, 2018 10:52 am    Post subject: Assembler Code, help needed (ATTiny85 midi to CV&GATE)
Subject description: "Mitxela MidiMonotron" need advice how to modify the code for the CV out to stay.
Reply with quote  Mark this post and the followings unread

Hello,

on my search for the ultimatively simple midi to CV interface,
I stepped across this https://github.com/mitxela/MidiMonotron

Built the circuit and programmed the chip with the .hex file, it worked. YAAY!
But when you release the keys, the CV output jumps back to zero.

So I figured out how to compile the .asm file to hex with AVR Studio 4, got it.

Spent the whole day on modifying the code by trial and error.
(I have no clue about Assembler or barely about coding in general)
disabling the "setNote" call in the "noteOffMove" sub resulted in a a stuck CV, which stayed but didn't change
when playing legato. And the Gate stayed HIGH. undo.

Then I tried by disabling and re-enabling single lines in all subroutines that
had something to do with notes, including the outputtOff subroutine at the end.

When I removed the line "out OCR1A.r16" in the outputOff sub
and the last two "ldi" and "out" lines before the "ret" command,
the CV out behaved as I wanted, but then the gate output got stuck.

After six hours I decided to give up the trial&error thing and ask in the
forums.

I'd aprecciate your advice.

_________________
Is the future obsolete?
Back to top
View user's profile Send private message
Grumble



Joined: Nov 23, 2015
Posts: 1294
Location: Netherlands
Audio files: 30

PostPosted: Fri Apr 13, 2018 11:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

My guess is:

Almost at the bottom of the code you find:
Code:

outputOff:
   clr r16
   out OCR1A,r16

   cbi PORTB,3
   cbi PORTB,0
   ldi r16, 0b00000000
   out DDRB,r16

   ret

Here the cv for notes is set to 0 where it says: clr r16 (cleares r16) and out OCR1A, r16 (output r16 to OCR1A) effectively stopping the pwm that causes the cv for notes. So just remove these two statements while keeping the rest of the code and try again.

_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
beep



Joined: May 05, 2013
Posts: 105
Location: Germany

PostPosted: Sun Apr 15, 2018 12:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Your guess was right, but that' only half of the enemy killed.
The last two commands turn off the PWM outputs, so they have to go.
CV works like a charm then but the GATE output cannot retrigger unless
you change the note.

That was the point where I got stuck before I decided to ask people out there.
Got help in the SDIY facebook group. Someone found out that those lines:


in r16,OCR1A
cp r16,r19
breq setNoteEnd

in the SetNote: sub cause the retriggering problem. just delete them too.
voila.

_________________
Is the future obsolete?
Back to top
View user's profile Send private message
beep



Joined: May 05, 2013
Posts: 105
Location: Germany

PostPosted: Sun Apr 15, 2018 12:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Next things I want to find out is how to restrict the whole thing either to
high note or to low note priority. I think of two ATTinys being triggered
from the same midi signal, but outputting high and low note CV -> duophony!

And it should be possible to change the MIDI channel for each chip.

_________________
Is the future obsolete?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use