YM music in Cubase?

Somewhere to chat about MIDI music creation, sequencers and related hardware

Moderators: Mug UK, lotek_style, Moderator Team

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

YM music in Cubase?

Postby Foxie » Tue Apr 03, 2018 6:51 pm

Has anyone made an MROS driver which allows you to make YM music inside Cubase?

I ask this for two reasons. If it exists, I could disassemble it and learn more about MROS. If it doesn't exist, I could make a driver as a proof of concept for MROS development. This would be more interesting than just writing values to Hatari debug registers - as I'm doing currently.

I don't really know anything about SID effects, and I don't know if MROS will allow me to steal a timer anyway. Someone else who knows about such things could extend the code.

User avatar
Atari74user
Captain Atari
Captain Atari
Posts: 302
Joined: Mon Aug 10, 2009 8:00 pm

Re: YM music in Cubase?

Postby Atari74user » Tue Apr 03, 2018 9:20 pm

I am almost certain that doesn't exist, hence why trackers are often used for using either samples or YM sounds. The nearest thing Cubase has is EPSS, and that's allowing the use of samples within Cubase, similar to what Breakthru had built in.

e.g. http://dhs.nu/files.php?t=single&ID=64
Atari Falcon 14mb, 68882, Dual 8gb CF, Steinberg FDI & Analog 8
Atari Jaguar, Rotary controller, Skunkboard & Cat Box
Atari 520STFM 4mb, TOS 2.06 switcher, OverScan, GigaFile, PARCP-USB, Unicorn-USB, System Solutions MiniS HD, SyQuest drives, ICD Link II, PhatBoy MIDI Controller, Philip Rees 5M MIDI merge box, SoundPool MO4, Steinberg MIDEX, SMP II, Emagic Log 3, C-Lab Unitor 2, Combiner & Export expanders

distantminds
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 106
Joined: Thu Sep 29, 2005 5:03 pm

Re: YM music in Cubase?

Postby distantminds » Thu Apr 05, 2018 9:40 am

Great idea.

If you could generate a packet of information (note on, instrument(?), midi channel) then it would be conceivable to pipe that into an existing YM engine.

The engine could be sat atop the system Timer C (done in the cleanest way possible) and as you say - timer management for special FX is a questionmark.

Good luck!

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: YM music in Cubase?

Postby Foxie » Thu Apr 05, 2018 3:34 pm

distantminds wrote:Great idea.

If you could generate a packet of information (note on, instrument(?), midi channel) then it would be conceivable to pipe that into an existing YM engine.

The engine could be sat atop the system Timer C (done in the cleanest way possible) and as you say - timer management for special FX is a questionmark.

Good luck!


Do you know of any existing YM engines which could be used? It wouldn't need to be open source, but I'd need to be able to use it legally and have enough documentation.

I could steal timer D for SID effects, but that would prevent you from using a modem port MIDI expander at the same time. Also I don't know how time-critical SID effects are. Cubase does turn interrupts off sometimes, and it might prevent the timer running for anything up to 0.3ms.

So far I've managed to get something very basic working. Notes can be played on each of the three channels, with velocity. But that's all. I need to do more work to implement pitch bend, envelopes, envelope frequency, noise. I also tried to implement lowest-note priority, but there's a bug stopping it working.

Ideally it would be nice to have a software envelope generator, LFO and arpeggiator but that's much more work.

Do you know if there's a clean way of hooking into timer C, like there is with the VBL? I could just rewrite the interrupt vector, but it might cause a conflict if another driver hooks into timer C.

Here's the very first version:

FOXIE_YM.DRV.zip


Remember to turn the metronome beep off in Cubase! It uses channels 1, 2, 3. I'll release the source when I've fixed the bugs.
You do not have the required permissions to view the files attached to this post.

ranix
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
Joined: Sun Jan 14, 2018 8:01 pm

Re: YM music in Cubase?

Postby ranix » Fri Apr 06, 2018 4:24 am

Wow Foxie, this is really something.

I tested this on my 1040STF with 4MB of RAM at 16mhz.

I was able to load the driver in Cubase. The first time I ran it, I started Cubase with the Metronome on and tried to turn it off in Cubase while the driver was loaded. I did so, and saved my default settings. I think having both the Metronome and FOXIE_YM pissed Cubase off and it gave me 3 bombs when I quit. Crashed on relaunch with 5 bombs. However, I was able to see the FOXIE_YM output device and create a channel.

I then restarted the Atari and relaunched Cubase. The save loaded properly and my new output device was present. I entered 3 notes and put them into a 1/4 bar loop. At first I wasn't getting any sound, but I began hearing something when I raised the velocity for each note above about 80%. The pitch of the notes didn't sound quite right to me, and the velocity curve does not affect the volume like I would expect (maybe linear vs exp response for velocity or maybe you just didn't put much effort here yet).

Anyway I am impressed, I would say this test was a rousing success.

ranix
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
Joined: Sun Jan 14, 2018 8:01 pm

Re: YM music in Cubase?

Postby ranix » Fri Apr 06, 2018 4:45 am

oh yeah, this test was performed with the MCA cracked cubase 201

dbsys
Captain Atari
Captain Atari
Posts: 360
Joined: Fri Aug 31, 2012 6:11 am
Location: Germany

Re: YM music in Cubase?

Postby dbsys » Fri Apr 06, 2018 7:11 am

ranix wrote:...the MCA cracked cubase 201


I doubt that this version is error free and a good basis for developping new Cubase drivers.

Also keep in mind, between Cubase 2 and Cubase 3 many things happened under the hood to make Cubase more stable, faster and more compatible to external hardware. Who knows what this means for a driver developper.

If I were a developper I would invest in a red Cubase 3 dongle which will also work with Cubase Score 2. In addition to that it also is compatible to the Atari TT. Red Cubase dongles pop up every now and then. Last week I saw one for 20 Euros on ebay Kleinanzeigen in Germany.

yungjoon
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 121
Joined: Tue Aug 08, 2006 7:15 am
Location: France

Re: YM music in Cubase?

Postby yungjoon » Fri Apr 06, 2018 4:25 pm

Well done Foxie,

I tested it on my TT with cubase audio 1.1 (CBX version, dongle plugged), it worked well. I could use it with metronome off, on all three channels, but played together (chords in a sequence) it sounds a bit crappy. An editor would be welcome to adjust all parameters but it is already great!

Thanks !

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: YM music in Cubase?

Postby Foxie » Fri Apr 06, 2018 5:25 pm

Thanks for testing!

ranix wrote:I was able to load the driver in Cubase. The first time I ran it, I started Cubase with the Metronome on and tried to turn it off in Cubase while the driver was loaded. I did so, and saved my default settings. I think having both the Metronome and FOXIE_YM pissed Cubase off and it gave me 3 bombs when I quit. Crashed on relaunch with 5 bombs. However, I was able to see the FOXIE_YM output device and create a channel.


I found the bug, it was a typo that caused a crash when shutting down. Hopefully that should be fixed now, but I'll wait until I've fixed the note priority bug before uploading a new version.


ranix wrote:The pitch of the notes didn't sound quite right to me, and the velocity curve does not affect the volume like I would expect (maybe linear vs exp response for velocity or maybe you just didn't put much effort here yet).


I think this is because the YM chip only has 16 steps for volume. It also covers a very large volume range, so only the top part of the range is usable. Should I limit the range to the top half of the velocities (64-127)?

I'm not even sure if velocity control is necessary or a good idea. I'll be implementing controller 7 for volume, it might be better to use a controller instead of velocity.

I don't know why the pitch is wrong, would it be possible to record an audio sample? Is there any particular pattern to the pitch errors, do they occur over the whole keyboard range? There's a lookup table for determining pitches, so if part of it gets overwritten the pitches would be changed.

The YM chip does have a limit to the lowest note which can be reproduced. If you try to play a note below that, it will just play the lowest pitch instead.

Rather than trying to fix the existing note priority code, I think I'll just delete it and implement an arpeggiator instead. It's really needed for the chip music sound. Speed control will be via one of the MIDI controllers. I'll use timer C instead of the MIDI clock for timing, because I want the arpeggiator to work when Cubase is stopped.


yungjoon wrote:I could use it with metronome off, on all three channels, but played together (chords in a sequence) it sounds a bit crappy.


I noticed this too, I assumed it was distortion caused by the LMC1992? Has anyone with an STFM or Falcon heard the distortion too? I'll be implementing some MIDI controllers to adjust the master volume / bass / treble, which hopefully will stop the distortion.


yungjoon wrote:An editor would be welcome to adjust all parameters but it is already great!


I'll do a Cubase mixermap when I've actually implemented the controllers. I intend to make all the parameters adjustable via MIDI controllers and program changes, so it should be easy to do a mixermap for it. I think it's a shame so many synths hide interesting parameters behind sysex messages.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: YM music in Cubase?

Postby Foxie » Fri Apr 06, 2018 11:37 pm

Here's a preliminary mixer map. The controllers aren't implemented in the driver yet.

Screen Shot 2018-04-07 at 00.24.09.png


I think it's every possible control I want to implement. That includes software LFO and software envelopes. I'm not planning to do glide, if you overlap notes it will arpeggiate them instead. Pitch bend range can be set very wide, you can use that for glides.

If you switch noise and square off and turn modulation on, you'll hear the output of the hardware envelope generator directly. These are the so-called hard waveforms. You can get triangle and sawtooth that way.

I don't have any provision for drums. You could simulate it by using two or three channels in unison with pitch and volume envelopes. I think there are many techniques to do drums, and I don't know much about them.
You do not have the required permissions to view the files attached to this post.

User avatar
Cyprian
Atari God
Atari God
Posts: 1517
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: YM music in Cubase?

Postby Cyprian » Sat Apr 07, 2018 11:11 am

looks really cool,
what about using maxYMise engine? This is the best YM editor/player IMO
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.appspot.com/

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: YM music in Cubase?

Postby Foxie » Tue Apr 10, 2018 2:25 am

Good news, timer D appears to be stable enough to produce tones. This means some of the more interesting YM effects can be done with Cubase running. It gets noisy and unstable at the upper octaves, but the lower octaves are good enough.

Does it work on other people's system configurations? Here's a new version.

FOXIE_YM.DRV.zip


It only responds on channel 1. The tuning of the notes is wrong because it's a test. Try low and high notes to see which give the cleanest sound. The low and high notes wrap around so try moving the note around until you get the right pitch. I hear a grainy distortion on the higher notes.

It will not work with Export. You need to rename MODEM.DRV to MODEM.DR otherwise it could lock up.
You do not have the required permissions to view the files attached to this post.


Return to “MIDI Software and Hardware”

Who is online

Users browsing this forum: No registered users and 8 guests