| I've always used
cpsoct(iMIDInn/12 + 3)
John Lato
Quoting "S. Massy" :
> On Wed, Feb 01, 2006 at 09:18:11AM -0600, jlato@mail.utexas.edu wrote:
> > I'd like add that two command-line utilities, readmidi and writemidi, will
> > convert MIDI->score and score->MIDI. They can be obtained from:
> > http://ems.music.utexas.edu/dwnld/rwmidi.zip
> > The binaries are for Windows, but source code is provided. I believe
> readmidi
> > works with format 1.
> The sources compile well and the programme works likewise. However, the
> programme leaves the notes in the score in MIDI Numbers, which would be
> fine, if only I knew what pitch converter to use: the *midi opcodes seem
> to expect midi events, not p-fields, so I'm not sure where to go from
> here. Anybody knows of a suitable way to convert MIDI note numbers to
> more csound-friendly notations?
> Thanks,
> S.M.
> > John Lato
> >
> > Quoting David Akbari :
> >
> > > Thank you for all of your suggestions.
> > >
> > > I wish the link that Kanata posted had the source code available !
> > >
> > > I have checked out Midge and LilyPond and both seem to appear to do the
> > > job as well, but with some more work involved.
> > >
> > > IMHO, this idea of Score to MIDI or vice-versa has taken on a much
> > > larger significance than in previous versions with Csound5 because of
> > > the addition of Format 1 support.
> > >
> > > In the long term I will try and write a wrapper per Steven's
> > > suggestion. I can see there is clearly a need for it and I could
> > > undoubtedly learn much from attempting such an exercise.
> > >
> > > On Jan 31, 2006, at 6:00 PM, S. Massy wrote:
> > >
> > > > Incidentally, would there be a solution in the opposite direction:
> > > > converting a MIDI file, or even some "text" notation to csound score?
> > >
> > > For this I use Istvan Varga's commandline ScoreProc suite. It can be
> > > found at his cSounds.com site
> > > http://www.csounds.com/istvan/html/scoreproc.html
> > >
> > > Although there are also several others that you may find for various
> > > platform specific solutions on the Utilities page at
> > > http://csounds.com/utilities
> > >
> > > Incidentally, you do not even need a third party application to convert
> > > MIDI to Csound score. Here is a Csound file that was made by a leading
> > > Csound developer, Istvan Varga. With some modifications I have found
> > > this tool to be of great usefulness, and use it regularly when I am not
> > > using the commandline 'mid2sco' by the same author.
> > >
> > >
> > >
> > > sr = 44100
> > > ksmps = 100
> > > nchnls = 1
> > >
> > > itmp ftgen 1,0,16384,10,1,.5,.333333
> > >
> > > /*--- ---*/
> > >
> > > opcode cpsmid, k, k
> > >
> > > kmid xin
> > >
> > > #define MIDI2CPS(xmidi) # (440.0*exp(log(2.0)*(($xmidi)-69.0)/12.0)) #
> > > kcps = $MIDI2CPS(kmid)
> > >
> > > xout kcps
> > >
> > > endop
> > >
> > > /*--- ---*/
> > >
> > > instr 1 ; Play MIDI notes, record to score
> > >
> > > inote notnum
> > > ivel veloc
> > > istrt times
> > > krel release
> > > if (krel == 0) kgoto norel
> > > kendt times
> > > kdur = kendt - istrt
> > > fprintks "mid2sco.sco", "i 1 %f %f %d %d\n", istrt, kdur, inote, ivel
> > > turnoff
> > > norel:
> > >
> > > endin
> > >
> > > /*--- ---*/
> > >
> > > instr 2 ; Play back the MIDI notes
> > >
> > > inote cpsmid p4
> > > a1 oscil 3000, inote, 1
> > >
> > > outs a1,a1
> > >
> > > endin
> > >
> > > /*--- ---*/
> > >
> > >
> > > f 0 30
> > > e
> > >
> > >
> > >
> > >
> > > -David
> > >
> > > --
> > > Send bugs reports to this list.
> > > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
> > >
> >
> >
> >
> > --
> > Send bugs reports to this list.
> > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
>
> --
> smassy@sdf.lonestar.org
> --
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
>
|