Cv/gate/midi
Moderator: Moderators
Cv/gate/midi
Now that I am to the point of developing some serious music software for the vic I would also like to produce/use cv,gate and possibly midi options. Cv/gate lines preferable to me personally over midi but I understand the attraction so I would like to shoot for some level of midi support as well.
On midi there is programming for the midi cart. I'm not really sure how many people actually own one other than myself so I am really not sure if it would be the best path. I have also had a difficult time trying to figure out how to actually program the then. I can't find how to initialize the midi or even if it needs to be initialized or even set up for in or out. There is documentation but it is jumbled with unimplemented and unfinished code. I have found register tables but I have achieved no results. Here is a link if any one is interested midi cart
If any one has any other ideas on developing a midi interface i am open for suggestions.
Now for cv/gate lines... Keep in mind that I am a hardware novice so if these ideas are way off please correct me. I definitely don't want to do anything that could potentially damage my vic or synths.
I have been looking for the most simple solutions. First I should mention that I would like to use options other than the expansion port so that it could easily be used along side software carts produced without having to purchase a slot expander. So I started looking at the other ports. From what I have been able to research
Cv lines use to main standards both are 5 volt lines. One determines 1 octave per volt with each volt devided by 12 for each note within an octave. I can't remember the other standard is divided but I know that is still operates between 0 to 5 volts. Gate/trigger/clock lines work off of a 5 volt standard as well but some operate with any voltage above 0 as on some operate with any signal above 2.5 volts as on.
So for cv/gate lines in...
The games port operates at a 5 volt standard. You have 2 cv line in pins for the paddles and 5 on/off pins for joystick/paddle/light pin buttons. Unless there is something that I am missing then this seems like an ideal location for input.
Theoretically the only programming you would need for keyboard input would be writing a note table indexed by the value at the paddle location and then something like...
Poke {voice}, peek({note_table}+peek({paddle_a}))
And the 5 button pins could be wired and programmable for gate/trigger/clock lines.
The only issue I'm not sure about is exactly how to wire the lines. I've been studying schematics and it looks like most cv/gate lines ground out the return wire. Would it be necessary to connect the return if the vic grounds out the cv line in? Should I connect the return to the ground pin or for some reason that I am not seeing should I use the 5v pin with some level of resistance?
I am still scratching my head a bit on outputs. It would be convenient if you could control the voltage of the 5v pin outs internally but that does not look likely. I have been wondering about the voltage on the userport io pins. If their combined voltage could be 5v. Then I could place a resistor at each pin. 0 pins would be 0v. Pin 1 could be dropped to (5/256+1)v, 2 to (5/256+2)v, 3 to (5/256+4)v etc. So that say pin 1 on + pin 8 on would output (5/256+129)v.
Please keep in mind that I'm speaking from a beginners level knowledge on this. I am completely open to correction and suggestions.
On midi there is programming for the midi cart. I'm not really sure how many people actually own one other than myself so I am really not sure if it would be the best path. I have also had a difficult time trying to figure out how to actually program the then. I can't find how to initialize the midi or even if it needs to be initialized or even set up for in or out. There is documentation but it is jumbled with unimplemented and unfinished code. I have found register tables but I have achieved no results. Here is a link if any one is interested midi cart
If any one has any other ideas on developing a midi interface i am open for suggestions.
Now for cv/gate lines... Keep in mind that I am a hardware novice so if these ideas are way off please correct me. I definitely don't want to do anything that could potentially damage my vic or synths.
I have been looking for the most simple solutions. First I should mention that I would like to use options other than the expansion port so that it could easily be used along side software carts produced without having to purchase a slot expander. So I started looking at the other ports. From what I have been able to research
Cv lines use to main standards both are 5 volt lines. One determines 1 octave per volt with each volt devided by 12 for each note within an octave. I can't remember the other standard is divided but I know that is still operates between 0 to 5 volts. Gate/trigger/clock lines work off of a 5 volt standard as well but some operate with any voltage above 0 as on some operate with any signal above 2.5 volts as on.
So for cv/gate lines in...
The games port operates at a 5 volt standard. You have 2 cv line in pins for the paddles and 5 on/off pins for joystick/paddle/light pin buttons. Unless there is something that I am missing then this seems like an ideal location for input.
Theoretically the only programming you would need for keyboard input would be writing a note table indexed by the value at the paddle location and then something like...
Poke {voice}, peek({note_table}+peek({paddle_a}))
And the 5 button pins could be wired and programmable for gate/trigger/clock lines.
The only issue I'm not sure about is exactly how to wire the lines. I've been studying schematics and it looks like most cv/gate lines ground out the return wire. Would it be necessary to connect the return if the vic grounds out the cv line in? Should I connect the return to the ground pin or for some reason that I am not seeing should I use the 5v pin with some level of resistance?
I am still scratching my head a bit on outputs. It would be convenient if you could control the voltage of the 5v pin outs internally but that does not look likely. I have been wondering about the voltage on the userport io pins. If their combined voltage could be 5v. Then I could place a resistor at each pin. 0 pins would be 0v. Pin 1 could be dropped to (5/256+1)v, 2 to (5/256+2)v, 3 to (5/256+4)v etc. So that say pin 1 on + pin 8 on would output (5/256+129)v.
Please keep in mind that I'm speaking from a beginners level knowledge on this. I am completely open to correction and suggestions.
R'zo
I do not believe in obsolete...
I do not believe in obsolete...
Re: Cv/gate/midi
Or on the line out if I can't rely on the voltage of the io pins. Maybe I could wire the 5v out to 8 transistors. Each transistor wired to an io pin and then out to the appropriate resistance.
R'zo
I do not believe in obsolete...
I do not believe in obsolete...
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Cv/gate/midi
I'm considering a similar project, as I noted on your other thread. Thanks for putting this topic out there.
This will sort of depend on what you're interfacing with, but ideally you'd want to support either 10V for unipolar CV or +/- 5V bi-polar CV. This is the range common in Eurorack. And it'll typically be volt-per-octave. Hz-per-volt is mostly restricted to Korg stuff, and the math is harder (12th roots rather than the division by 12 you mentioned, for example).
What I was considering was the VIC-20 communicating via RS-232 with an Arduino, via some invented protocol, and then the Arduino handling the actual DAC with an outboard device. This approach isolates the VIC from having to actually drive voltage levels itself. It just commands the Arduino to talk to the DAC. I was planning on using ESP-32s, which have Wi-Fi and Bluetooh, to "cast" CV across the room to another device.
But as with CV output, I think having a digital interface on the VIC-20 side would provide a lot more precision for CV input. It makes sense (to me) to put the actual CV in the hands of really good DACs and ADCs...
Another advantage of Arduino is that it makes serial communication super-easy for MIDI out using the exact schematic from the 1983 MIDI spec sheeet. I haven't tried MIDI in yet with Arduino.
This will sort of depend on what you're interfacing with, but ideally you'd want to support either 10V for unipolar CV or +/- 5V bi-polar CV. This is the range common in Eurorack. And it'll typically be volt-per-octave. Hz-per-volt is mostly restricted to Korg stuff, and the math is harder (12th roots rather than the division by 12 you mentioned, for example).
What I was considering was the VIC-20 communicating via RS-232 with an Arduino, via some invented protocol, and then the Arduino handling the actual DAC with an outboard device. This approach isolates the VIC from having to actually drive voltage levels itself. It just commands the Arduino to talk to the DAC. I was planning on using ESP-32s, which have Wi-Fi and Bluetooh, to "cast" CV across the room to another device.
It's measuring resistance, not voltage. When I was a kid, I used the paddle lines with a photoresistor to graph light levels in my room throughout the day. You could surely control resistance with voltage.The only issue I'm not sure about is exactly how to wire the lines. I've been studying schematics and it looks like most cv/gate lines ground out the return wire. Would it be necessary to connect the return if the vic grounds out the cv line in? Should I connect the return to the ground pin or for some reason that I am not seeing should I use the 5v pin with some level of resistance?
But as with CV output, I think having a digital interface on the VIC-20 side would provide a lot more precision for CV input. It makes sense (to me) to put the actual CV in the hands of really good DACs and ADCs...
Another advantage of Arduino is that it makes serial communication super-easy for MIDI out using the exact schematic from the 1983 MIDI spec sheeet. I haven't tried MIDI in yet with Arduino.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5
WIP: MIDIcast BASIC extension
he/him/his
WIP: MIDIcast BASIC extension
he/him/his
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Cv/gate/midi
(This digital interface could also be an IEC thing, so then we could use KERNAL routines like CHRIN and CHROUT to send and receive CV and MIDI. This might actually be an awesome approach.)
Re: Cv/gate/midi
I've been considering this as well. My research has not gotten that far yet and how the drive port actually functions and communicates. I know that theres data, clock and +/- lines. But I don't really currently know anything about how the clock and data lines communicate or how those signals are interpreted or output as electrical signals.
Knowing however that the commodore drives used mos cpus and interface chips makes the concept attractive. If period the job can be done with period appropriate tech it could be more simple in design and programming, cheaper to produce and even better received by the community.
Personally I prefer as few levels of interpretation as possible between the vic and the external hardware. But at the end of the day what ever does the job the best, fastest and most efficiently is generally preferable.
I also want to note that an iec port or user port solution could both be potentially designed to be hardware compatible with the vic, c 64 and commander x16. A game port (input) solution would be compatible with most cbm and atari systems maybe even some Sega as well.
R'zo
I do not believe in obsolete...
I do not believe in obsolete...
Re: Cv/gate/midi
@chysn
Ok now, if by some chance you could possibly pull off ardruino or similar microcontroller this would be most attractive. Many machines that use the iec port also use the same kernel routines. Software could be written to be compatible as well. With the exception of separate note tables for input. This would keep the expansion port free for cart based software. Running multiple off of the iec is cheaper and more accessable than slot expanders if people still wanted to use disk/sdiec drives as well.
Ok now, if by some chance you could possibly pull off ardruino or similar microcontroller this would be most attractive. Many machines that use the iec port also use the same kernel routines. Software could be written to be compatible as well. With the exception of separate note tables for input. This would keep the expansion port free for cart based software. Running multiple off of the iec is cheaper and more accessable than slot expanders if people still wanted to use disk/sdiec drives as well.
R'zo
I do not believe in obsolete...
I do not believe in obsolete...
Re: Cv/gate/midi
I've been threatening to write an IEC library for the AVR for a while. If that would be useful for this project I'd be happy to start it.
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Cv/gate/midi
I suggested it because I've done it before. I built a MIDI/CV interface for a the Sharp PC-14xx series of pocket computers from the 80s. The principle here was to use the printer port, and then emulate a printer on Arduino. The pocket computer thinks it's sending data to a printer, but my Arduino is interpreting the text as commands, and sends data to an I2C DAC (for CV) or a digital output (for gate) or to a MIDI output.
Software on the pocket computer simply has to use the LPRINT command to send these commands to the Arduino. (https://www.youtube.com/watch?v=QHonHXq ... ad&index=3)
On pocket computers, it's super slow. But it's not the Arduino's fault, it's the pocket computer, of course. So, I'm not really too worried about getting things running on the Arduino side of the interface. I'm less confident with what's going on with the VIC-20. I have a user port PCB that I'm looking forward to trying out.
I think it's worth checking out! What would the hardware between the DIN and the Arduino look like for that kind of thing?
Re: Cv/gate/midi
There are a few drawbacks with this. The bit rate of the IEC isn't very high and the kernal routines aren't really suitable to run from IRQ so there are going to be latency issues. Actual MIDI is 31250 bits/s to keep latency reasonably low.
You could use the VIA serial port to feed an external midi/CV interface though. It is fairly fast, but there is a catch. There is a bug with serial input on the VIA that will corrupt data. If you are only doing output I believe it works but don't quote me on that.
Last edited by tlr on Fri Aug 27, 2021 11:47 am, edited 1 time in total.
Re: Cv/gate/midi
Gate signals differ too. Older Moogs use s-trig, which grounds the gate to activate it. Some older Roland stuff uses 0/12V for trig, but maybe it trigs on 5V too? Korg stuff may use inverted trigs. Also note that old Moogs commonly used 0.95V/oct CV.chysn wrote: ↑Thu Aug 26, 2021 9:08 pm This will sort of depend on what you're interfacing with, but ideally you'd want to support either 10V for unipolar CV or +/- 5V bi-polar CV. This is the range common in Eurorack. And it'll typically be volt-per-octave. Hz-per-volt is mostly restricted to Korg stuff, and the math is harder (12th roots rather than the division by 12 you mentioned, for example).
I have one of these which may give a clue on useful configuration options: http://www.encoreelectronics.com/exp01.pdf
I believe it has 16-bit DACs. It has a lot of LFO stuff and so on, but skip that part of the manual, I've only ever used the straight CV/gate stuff.
While we are at it, Sync24/48 is also a useful option. As an example Victracker has support for slaving to Sync24/48 with just some simple userport connections.
Re: Cv/gate/midi
Would this be helpful (see pdf page 16 - printed page number 24)?
http://datassette.nyc3.cdn.digitalocean ... ojects.pdf
http://datassette.nyc3.cdn.digitalocean ... ojects.pdf
Music I've made with 1980s electronics, synths and other retro-instruments: http://theovoids.bandcamp.com
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Cv/gate/midi
What an amazing book!ral-clan wrote: ↑Fri Aug 27, 2021 7:56 pm Would this be helpful (see pdf page 16 - printed page number 24)?
http://datassette.nyc3.cdn.digitalocean ... ojects.pdf
I just bought a copy. I'm hoping I'll have some time this weekend to mess around with the user port's data lines. I'm kind of expecting this to become a user port project.
- javierglez
- Vic 20 Hobbyist
- Posts: 108
- Joined: Sat Jun 03, 2017 3:33 pm
Re: Cv/gate/midi
I've been working on a (windows .NET) program to import a midi file and export part of it as data for the VIC 20 in the form of lines of code. Then I append them to the code of a kind of generic player program and finally I assemble it.
The program lets you select 3 of the channels to be exported as data bytes for the VIC 20. It is more complicated than it seems because usually you need to divide the play in parts and select different channels on each part.
It takes into account the NoteOn and NoteOff commands but ignores other sound effects. It reads tempo/division parameters too, provided they don't change. I'm attaching a version of Oxygene 4, it requires 16k.
I considered buying the cartridge but I won't as I can't play any instrument. But it's a fantastic addon and could change my mind in if it gains traction. For the moment I just wanted to hear some "VIC20 cover music".
The program lets you select 3 of the channels to be exported as data bytes for the VIC 20. It is more complicated than it seems because usually you need to divide the play in parts and select different channels on each part.
It takes into account the NoteOn and NoteOff commands but ignores other sound effects. It reads tempo/division parameters too, provided they don't change. I'm attaching a version of Oxygene 4, it requires 16k.
I considered buying the cartridge but I won't as I can't play any instrument. But it's a fantastic addon and could change my mind in if it gains traction. For the moment I just wanted to hear some "VIC20 cover music".
- Attachments
-
- osigeno4.zip
- (2.97 KiB) Downloaded 45 times
- chysn
- Vic 20 Scientist
- Posts: 1205
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: Cv/gate/midi
It's definitely cool and worth taking a look at in its own right, but it's a bit off-topic here. We're exploring ways to generate MIDI (and CV) output with a hardware device to other hardware devices.javierglez wrote: ↑Sat Aug 28, 2021 12:35 pm I've been working on a (windows .NET) program to import a midi file and export part of it as data for the VIC 20 in the form of lines of code. Then I append them to the code of a kind of generic player program and finally I assemble it.