GithubHelp home page GithubHelp logo

pch2csd's People

Contributors

aglioni avatar eu-ch avatar gleb812 avatar holotape avatar zappfinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pch2csd's Issues

Default output of pch2csd

@ech2 Hey Euge, I thought maybe after you run pch2csd, there should be something at the output, i.e. >> blah-blah-blah created CSD file something.csd. Total modules count 25.

Important Update

Hi everybody! I am writing this issue just to briefly let you know, that we simplified the description format of modules due to the reasons of better compatibility with further GUIs and real-time modulations.

I soon write all details in main section, but briefly you don't need to use 'd' and 's' operators in mapping header. The only thing you have to do there is to list all dependent tables, i.e.
;@ map table1 table2

On the one hand, it complicates the understanding of csd, because OscA [....], 440, [...] turns into something like OscA [...], 69, [...], BUT on the other hand it allows to usage of table opcodes inside of UDOs and you can modulate everything so easy now.

Improve test coverage

Many tests in the project are rather ad-hoc now: nist if them test multiple things at the same time (like code generation results) and don’t test methods and classes in isolation.

Unable to build on Ubuntu: ERROR: For req: pch2csd==0.1.dev0.

Hi, i'm unable to build the binary on ubuntu, any clue about this error

Successfully built pch2csd
Installing collected packages: bitarray, tabulate, pch2csd
WARNING: The script tabulate is installed in '/home/david/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
ERROR: For req: pch2csd==0.1.dev0. Invalid script entry point: <ExportEntry pch2csd = pch2csd:None []> - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.

error: error (163.txt): the UDO 'OscShpA' is invalid

EDIT: Nevermind, I looked back at the start of the doc and found what I needed, module creation and list of modules that aren't implemented, and I luckily got the regular editor going on my laptop, but it doesn't make any sound, so I might have to borrow a friends nord modular to edit.


I tried my first patch conversion and I got this error:

NICHOLASs-MacBook-Pro:~ nicholascraftisiii$ pch2csd /Users/nicholascraftisiii/Dropbox/_OMI_NICO/NORDG2-CSOUND-CABBAGE/G2P
atches/magicbox2.pch2
error: error (163.txt): the UDO 'OscShpA' is invalid
please, run 'pch2csd -c 163' for details
NICHOLASs-MacBook-Pro:~ nicholascraftisiii$ pch2csd -c 163
checking module type '163' (163.txt)
module name: OscShpA
error: no template file for the module with id 163
NICHOLASs-MacBook-Pro:~ nicholascraftisiii$

How can I potentially help in resolving some of these modules that don't exist to work?

I would really love it if I could convert the really awesome nord modular patches I have made in the past into cabbage to turn them into VSTs I can use in the future. This would also be a really cool workflow for programming virtual instruments depending on what is supported. I'd just love to test convert one of my cool patches to see if it is a viable thing, but I am fairly sure that nearly all of my patches make use of one or a few unsupported modules.

is there either A) a way I can help figure out how to convert the unsupported ones or for now B) replace the modules that don't work with something nearby that might work as a replacement without needing to use the Nord hardware / software? as I sold my nord a while back and am fairly sure that my laptop no longer runs the demo editor.

Print human readable labels for the module parameters

Currently, the only way to see parameters of a module is by printing the contents of a patch using the -p argument, like this

$ pch2csd -p lfoA2OscA.pch2
Patch file: lfoA2OscA.pch2

Modules
Name      ID    Type  Parameters                 Area
------  ----  ------  -------------------------  ------
LfoA       1      26  [0, 0, 0, 66, 2, 1, 4, 0]  VOICE
OscA       4      97  [64, 64, 1, 127, 2, 0, 3]  VOICE
Out2       2       4  [0, 1, 0]                  VOICE
LfoC       3      24  [64, 0, 4, 2, 1]           VOICE

Cables
From                   To                Color    Type    Area
-----------------  --  ----------------  -------  ------  ------
LfoA(id=1, out=0)  ->  OscA(id=4, in=1)  blue     out-in  VOICE
OscA(id=4, out=0)  ->  Out2(id=2, in=0)  red      out-in  VOICE
OscA(id=4, out=0)  ->  Out2(id=2, in=1)  red      out-in  VOICE

This represents parameters as an array of number ordered as they appear in the patch. To figure out to what UI element each parameter corresponds to, one would need to twiddle something in the NM editor, save the patch, print its contents again and compare the changes.

This is a bit tedious and error prone when creating special annotations for UDOs. To improve this we can print human-readable names of the parameters in the order they appear in a patch. There is an XML file flying around on the internets, supposedly with module parameters listed together with human-readable labels. @gleb812 knows about it. We need to find it, parse, add as metadata to the converter, and add some command-line parameter that would allow to access it.

RFC: new mapping annotations

Hey @gleb812 @zappfinger!

I was thinking about printing the human-readable names for the parameters. And I think I know a way to do this. My proposal is to change the format of annotations and make them more convenient. Check the full text: https://github.com/gleb812/pch2csd/wiki/UDO-annotations

First, ditch ;@ args. And replace it with two separate ;@ ins and ;@ outs. Second, add human-readable aliases for ;@ map.

Here is an example:

;@ map Amp s LinLogSwitch LVLamp CLAEXP 
;@ map LinLogSwitch d BUT002

;@ ins k:In
;@ outs k:Out
opcode LevAmp,0,iiii
  iKnob, iScale, izIn, izOut xin
  iMult = iKnob  ; TODO properly implement logarithmic mapping
  kIn zkr izIn
  zkw kIn*iMult
endop

;@ ins a:In
;@ outs a:Out
opcode LevAmp,0,iiii
...
endop

Let’s break it down into parts.

;@ map Amp s LinLogSwitch LVLamp CLAEXP 
;@ map LinLogSwitch d BUT002

So right after map we have a human-readable name for the parameter. Also check how the s map now refers to such name instead of an index.

;@ ins k:In
;@ outs k:Out
opcode LevAmp ...

So now we can annotate inlets and outlets with readable names too. Multiple ins and outs may look like this:

;@ ins a:In k:EnvMod k:LfoMod
;@ outs a:Out
opcode ...

What do you think about this?

Make patch parsing unit tests agnostic to template implementation

Our test suite checks parsing correctness by evaluating templates and their mappings and comparing results with those, that are expected by tests and hardcoded. That means, if someone changes, e.g. a mapping table for some parameter in a template, tests that rely on this template will fail. We need to overcome this, e.g. by mocking mapping table or something similar.

A Funny Thing with CLKGEN

Actually, NM's clock generator doesn't generate 1-sample length pulses. Moreover, it isn't some kind of fixed length pulses. Nord clock generator behaves almost like an ordinary oscillator. I just checked different BPM with different clock dividers (Sync every 1, 2, 4, etc beats) and I can say that

a) A Sync osc is approximately 1:400 pulse
b) 1/16 osc is approximately 1:18 pulse
c) 1/96 osc is approximately 1:12 pulse

ClockActive is always 1 if Clk is ON.

So I need to fix my code to make it closer to the original. BTW, you can even try Amplitude Modulation using ClkGen...

We need a level normalisation convention

Folks,

NM is MIDI compatible and uses 0..+64 range for unipolar k-rate signals, and -64...+64 for bipolar signals.
The audio signals seem to be of the same level.

Since there are lots of options, we should set a convention on levels.

  • We can have even 0dbfs = 64
  • We can normalise all signals to -64...64 / 0...64.
  • On the other hand, it would be harder to combine pch2csd instruments with normal Csound way of coding in case of 64 based scaling
  • We can do some re-scaling inside each UDO. But it literally means we have to do kOut /= 64 at the output and kIn *= 64 at the input layer of each UDO.

Any suggestions are welcome!!

Error -bash: pch2csd: command not found on mac

trying to get this working, installed pip and the newest python as mentioned,
I get this warning when I do the pip3 install command :

NICHOLASs-MacBook-Pro:~ nicholascraftisiii$ sudo pip3 install pch2csd
WARNING: The directory '/Users/nicholascraftisiii/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: pch2csd in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (0.1.dev311)
Requirement already satisfied: tabulate in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from pch2csd) (0.8.7)
Requirement already satisfied: bitarray in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from pch2csd) (1.2.2)

the -H command took away the warning but still
when I try terminal command pch2csd it gives the error:
Error -bash: pch2csd: command not found on mac

Add check if `ins` / `outs` annotations are duplicated in a UDO

There was a user mistake of adding two ins annotations instead of a ins-outs pair. It resulted in a cryptic error. Error message should be more user-friendly in this case.

Erroneous annotation (module 144):

;@ ins k k k k k k
;@ ins k k k

Error message:

error: error: couldn't connect module with id 1 (outlet 1) to module with id 4 (outlet 0)

Add a contributor list

Hej! We need mention all contributors of this project somehow.

My proposal is to add a separate file like CONTRIBUTION.md to the repository root. This file will contain some statements like “by contributing you’re agreeing that your code will be licensed under MIT …” after which a list of contributors will follow.

If there’re no objections I’d create it.

Рефакторинг кода

Привет!

Я пофиксил чтение файлов и проблемы с путями: https://github.com/gleb812/pch2csd/tree/cmake_build

Сейчас, правда, есть косяки. Конвертирую файл Gleb2.pch2, но в результат получается следующим:

</CsInstruments>
<CsScore>
i1 0 [60*60*24*7]
i2 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>

;******************************
; Initialize the ZAK space
zakinit 2, 2

;******************************
; Opcode Definitions


instr 1
	 Out2 0.000, 0.000, -2054565793904463970304.000, 0, 0
	 OscD 22.000, 0.000, -2054565793904463970304.000, 0.000, -2054565793904463970304.000, 0.000, 0, 1
endin
instr 2
endin

;******************************
</CsInstruments>
<CsScore>
i1 0 [60*60*24*7]
i2 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>

@Aglioni знаешь, в чем проблема может быть?

PCSend & CtrlSend

Modules PCSend & CtrlSend. I tested them on external MIDI sequencer via soundcard's MIDI port. They work. But regarding MID Channel settings of these modules, Nord also had This and SlotA, SlotB, SlotC, SlotD.
'This' is a shortcut to current MIDI channel of selected slot. Others are self-explaining. So far we are far away from Slot concepts. So maybe we may leave it as is.

Another thing is time interval between input impulse and output impulse. My card shows it varies (from dozens of samples @ 96K to several hundreds). Demo (even hacked one) doesn't support these modules.
If we prove that this variable interval is a Clavia special, then we can just insert some random delay...

Очистка репозитория от ненужных файлов

Сейчас в репозитории куча хлама, который не нужен. Его можно смело удалять, а если он когда-нибудь понадобится, то можно будет восстановить из истории.

@Aglioni подскажи, пожалуйста, что в репозитории сейчас не используется, что можно почистить и т.д.

List index out of range in csdgen.py

list index out of range

-----------
  File "/home/muranyia/.local/lib/python3.8/site-packages/pch2csd/app.py", line 164, in main
    convert_pch2(args.arg)
  File "/home/muranyia/.local/lib/python3.8/site-packages/pch2csd/app.py", line 98, in convert_pch2
    udos = zak.connect_patch(p)
  File "/home/muranyia/.local/lib/python3.8/site-packages/pch2csd/csdgen.py", line 115, in connect_patch
    udos = deepcopy({m.id: Udo(p, m) for m in p.modules})
  File "/home/muranyia/.local/lib/python3.8/site-packages/pch2csd/csdgen.py", line 115, in <dictcomp>
    udos = deepcopy({m.id: Udo(p, m) for m in p.modules})
  File "/home/muranyia/.local/lib/python3.8/site-packages/pch2csd/csdgen.py", line 30, in __init__
    self.udo_variant = self._choose_udo_variant(len(ins))
  File "/home/muranyia/.local/lib/python3.8/site-packages/pch2csd/csdgen.py", line 61, in _choose_udo_variant
    tpl_v1_ins = self.tpl.ins[1].types

This happens with every patch that has no invalid UDOs.

idea for GUI interface

I was just thinking, interfacing with any GUI should be rather easy!
Say we use chnget (or OSC) to get a slider value, then thanks to zkwm we can mix this with the existing connection! Should be very simple...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.