Send trigger/sync/gate signal from max

Giorgio Tidei's icon

Hi guys!! I have i little semi-modular synth (KASTLE 1.5 V) and I would to control it from a clock source using max msp. The synth needs to be feed with control signals between 0 and 5 Volt (doesn't work with others voltages).
I need the control signal to reset the LFO or the step sequencer. Does anyone know how can I handle this??
Thank you all

back's icon

hi, look into the Arduino world and the maxuino (however Arduino is pretty easy to code in).
The Arduino uno, mega and nano are all 5v.
Ive not used a Kastle so don't really know what code you will need to write.
but if its just a 5v trigger Id advise building a midi din to cv.
You could easily build one with a few components if you have any soldering experience, failing that you could look at getting one of these http://www.hobbytronics.co.uk/midi-breakout?utm_source=google&utm_medium=googleshopping&utm_campaign=googlebase&gclid=EAIaIQobChMIw_rR78_E3AIVCbTtCh0Z-A7kEAQYBCABEgIdXfD_BwE
Lee

back's icon

also you won't need a DAC to send a trigger (just incase you find cv info online that uses a DAC).
If you are interested in doing it this way and would like a step by step instructions to follow, let me know. Id be happy to write the code for the Arduino too.
Lee

Giorgio Tidei's icon

Hey thank you so much for your help! I have some experience in soldering so I could do it!
I 'd be so thankful if you could send the Arduino code and instructions. It would be great!
Thank you and let me know

Anyways yes, I think it's just a 5v trigger

back's icon

Kastle.zip
application/zip 540.23 KB

back's icon

didn't realise I could post more than a maxpat on here :)

back's icon

sorry the schematic is to build your own midi in circuit, but this will be loads cheaper and you will learn more. believe me once you pop the auduino world you can't stop.

back's icon

Here is a video for building a midi in circuit. its for the Arduino Uno but you just connect to same pins on Nano

https://www.youtube.com/watch?v=GxfHijjn0ZM

Giorgio Tidei's icon

Wow Lee!! Thank you very much for everything you are my savior!!
I'll sure get through this I'm really interested.
Thank you again, enjoy your holiday;)

back's icon

Not a problem. If you have any further queries don’t hesitate to ask. If you make a general query on the forum then put a link on here I’ll get a notification from this feed.
Enjoy
Lee

back's icon

bug fix in Arduino code

Kastle.zip
application/zip 540.24 KB

Source Audio's icon

Just few infos :
midiout will not work with prepended midievent, that's for vst
object only.


Having Arduino connected via usb, why doing midi conversion ?

back's icon

Hi Source,
Yeah my bad, been a while since using midi toarduino in max, as for using usb to Arduino, I presume you are suggesting using the serial object? in my experience the serial object has really bad timing issues.
The Arduino micro does allow for midi usb but the micro is 3.3v, the voltage could be stepped up, but I figured this was the best route for if Giorgio wanted to add any more trigger outputs at a later date, as its just a resistor per output.
revised patch here

kastle_midi.maxpat
Max Patch

Source Audio's icon

No problem, I just thought it would be better to get this little mistake out.
I never had any problems with serial object's timing, and if it needs to be fast,
a better baud rate than midi is possible.
If one wanted to generate clock, that can be done in arduino, and just send
frequency from max over serial.

But as You say if one is learning, why not learn how to make arduino midi
capable, only that it needs extra midi interface.
By the way, if one uses midi interface powered from Usb port,
just as arduino, one can leave optocoupler on midi input out.

back's icon

I will have a look at this (higher baud rates) when I get home and send some revised Arduino code. Thinking back when I was having timing issues I was using the delay() method in my Arduino code (for some reason this seems to be the way the Arduino world does things) but now I use a different method to delay without pausing the code. That may have actually been the issue. I learned to code in the Arduino world and have slowly realised they teach some really bad practise

Source Audio's icon

Sure, using delays is not good when timing is envolved.
Arduino is not multitasking champ.
So one needs to use millis or other solutions when tasks like
creating pulses of specific length etc are envolved.
I don't know where You had such bad practise while learning arduino basics.
Usually it is all quite well documented.
I think that maybe coming from Max with all the possibilities, one tends to forget
the limits of this little but still so helpfull platform.